'Database user shared across microservices [closed]
In my project there are 10 microservices. 3-4 APIs are required to pull data from same database but different table. Is it fine to use the same database user by those 3-4 APIs ? Will it create any performance issues if same DB user been used by more than one API ?
I can create 4 database user but it adds maintenance effort for the password to be renewed. Also I feel if connection pool is going to take care of the DB connections then there should not be any issues if we share the DB user with multiple APIs ? I did not get proper information by searching the web.
Solution 1:[1]
It is all about your application really. A general test of availability could be to ask what are the minimum requirements for a db user that each of your micro-services need. If they all need the same privileges, then it is -usually- alright to use a single db user, but I would highly recommend to not decide based on that question -it is just the most relevant one to ask-.
It is better to learn more about your dbms, users and privileges for dbms systems, and the better practices for your use case.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | gsan |