Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

One user per database vs single user for all databases

I'm working on SaaS application that uses the one DB per client model. It also has common "accounts" database where some basic information about the account is kept and also provides log-in functionality.

My question - is it worth creating new database user for each client database that has permissions only on that database or a single database user with access to all client databases makes more sense (i.e. "account\_%.*")?

like image 364
arnaslu Avatar asked Jun 05 '11 10:06

arnaslu


People also ask

Why do we need multiple users in a database?

Multiple users can access databases and use computer systems simultaneously because of the concept of Multiprogramming. The data is neither integrated nor shared among any other user. The data is integrated and shared among other users.

Can we use multiple databases for a single application?

If you can work with single database, working with multiple is no different. You will need a connection string for each database. There rest is, as they say it, history.

What problem can occur when a database is processed by more than one user?

What problem can occur when a database is processed by more than one user? Answer: Locking. The problem that can occur when multiple people process a single database is known as “locking.”

Which database supports multiple users?

Industry-standard relational databases such as SQL Server, Oracle and MySQL are designed to deal with multiple concurrent users, while access to a file is always single-user.


1 Answers

If security is the concern, user per database is a way to go.

like image 66
Konstantin Tarkus Avatar answered Sep 20 '22 06:09

Konstantin Tarkus