0

What is a best practice to manage different user accounts in one application? I saw the same topics here but i didn't find answer on my question. Is it a best practice to use different "userId-appName.db" for each user in application?

Or need to add userId in each table?

1 Answer 1

1

No it is not a best practice to use separate databases for each user in the application. Use a table with all the users in your application and pass the userId elsewhere. It will eliminate a lot of head ache down the road. and you don't have to track every user's database. Imagine if your app have 10 users in a mobile. How will you track each user's database? another database with all those details?

Sign up to request clarification or add additional context in comments.

2 Comments

I understood. Thank you. But is it possible to open different db when user logging in? And if yes how to do this? Just provide different names into dbHepler constructor?
Sorry man i've never tried that. try it for yourself and tell us your experience, for the whole world to know :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.