1

Lets say we have a micro service U which manages user data. Now we have two other micro services A and B that require user data which is replicated through e.g. a messaging queue. Both micro services A and B update some data based on the new user data and publish the result to another queue.

Now we have another service C wich depends on the the results from service A and B. Service C will aggregate the data from A and B and publish the result. Now we have two issues:

  1. Each update of a users data in Service U will result in two updates in Service C (because it will first trigger an update in Service A and B and each of those updates will trigger one update in C). If there are more services in the chain after C that also require date from U or data based on U this may get even worse.
  2. The data from A and B may be based on different versions of the user data from U. If Service C aggregates both it may result in inconsistent data.

Are they any solution patterns for this problem?

The one I currently have in mind is: services A and B must include in their result which version of U there data is based on. Then C can wait until it has a consistent version of data from A and B that is based on the same version of U. The disadvantage I see with this solution is that now C has to know that data form A and B is based on U.

Daniel Seidewitz
  • 720
  • 8
  • 23
  • Sounds like you need to find the correct boundaries of your microservices, it sounds like there is too much cross dependencies... – Sean Farmar Feb 25 '17 at 11:14

0 Answers0