Reputation: 4154
Is it an anti pattern if multiple micro-services read/write to/from the same DynamoDB table?
Please note that:
Upvotes: 2
Views: 1549
Reputation: 3652
I have a different opinion here and I'll call this approach as anti-pattern. Few of the key principles which are getting violated here:
Solution,..IMO,
Hope this helps!!
Upvotes: 1
Reputation: 1893
When you writing microservices it is advised to not share databases. That is there because it provides for easy scaling and provides each to services to have their own say when it comes to their set of data. It also enables one of these services to take a call on how data is to be kept and can change it at their will. This gives services flexibility.
Even if your schema is not changing you can be sure of the fact that one service when throttled will not impact the others.
If all your crud calls are channeled through a rest service you do have a service layer in front of a database and yes you can do that under microservices guidelines
I will still not call the approach an anti pattern. Its just that the collective experience says that its better not to talk to one databases for some of the reasons I mentioned above.
Upvotes: 3