Is a shared database in microservices actually an anti-pattern?
1–10 of 93 posts
Re: Is a shared database in microservices actually an anti-pattern?
#2Re: Is a shared database in microservices actually an anti-pattern?
#3Re: Is a shared database in microservices actually an anti-pattern?
#4Yes, you can design around it. Good discipline around libraries with schemas, and such. These are almost always more code than letting a service own all communication with an infrastructure.
Re: Is a shared database in microservices actually an anti-pattern?
#5Re: Is a shared database in microservices actually an anti-pattern?
#6Re: Is a shared database in microservices actually an anti-pattern?
#7Re: Is a shared database in microservices actually an anti-pattern?
#8Moreover, the real dependency is from the report to the orders and the users; the article takes for granted that the report is shoehorned into the orders component, but it's clearly arbitrary.
Re: Is a shared database in microservices actually an anti-pattern?
#9Completely agree with the article. If each piece of code has its own data store, you lose all the advantages of the DBMS: you have to handwrite your joins, your transaction system and get all sorts of problems with cache invalidation, data inconsistencies and n+1 fetching. Encapsulation is important, but there are better ways to do it, such as using the authorization system of your DBMS.
It’s hard to see this until you’ve built domain driven micro service based systems properly.
Re: Is a shared database in microservices actually an anti-pattern?
#10This is more likely to be a problem if you split your services up by noun (Users,Orders) rather than by function (makeOrder, loginService, etc). This isn't bulletproof either but I've seen it helps reduce this occurrence a lot. Pardon the poor examples
I feel the OPs pain but I’ve built MSAs from DDD principals and it really is a better architecture for complex systems.