Contents
Should each user have its own database?
There is no need for separate table for each user. But there could be some kind of optimizations involved with database. user actually represents row of single table. In relation to user there could be other tables for specific purpose.
What should each database user account have?
To connect to the database, each user must specify a valid user name that has been previously defined to the database. An account must have been established for the user, with information about the user being stored in the data dictionary.
Does each microservice have its own database?
The short answer is yes. In order to be able to independently develop microservices , they must be loosely coupled. Each microservice’s persistent data must be private to that service and only accessible via it’s API .
Can microservices share database?
In the shared-database-per-service pattern, the same database is shared by several microservices. This pattern does not reduce dependencies between development teams, and introduces runtime coupling because all microservices share the same database.
Why microservices have their own database?
It would allow you to pick the database technology which fits your Business requirement best in order to get the best performance or usage of it. For example some specific micro-service might have some Read-heavy operations with very complex filter options and a full text search requirement.
How to create more than one contained database?
Some applications might require that a user to have access to more than one database. This can be done by creating identical contained database users in each database. Use the SID option when creating the second user with password. The following example creates two identical users in two databases.
Can a database owner create a contained user?
Database owners and database users with the ALTER ANY USER permission can create contained database users. After connecting to a contained database on an instance of SQL Server, a contained database user can access other databases on the Database Engine, if the other databases have enabled the guest account.
What happens if I connect to a contained database?
The connection will be evaluated as the contained database user with password principal on the contained database instead of as a user based on the SQL Server login. This could cause an intentional or accidental denial of service for the SQL Server login.
Can a user grant access to a database without permission?
Users in a contained database that have the ALTER ANY USER permission, such as members of the db_owner and db_accessadmin fixed database roles, can grant access to the database without the knowledge or permission or the SQL Server administrator.