While each microservice generally will have its own data - certain entities are required to be consistent across multiple services.
For such data consistency requirement in a highly distributed landscape such as microservices architecture, what are the choices for design? Of course, I do not want shared database architecture, where a single DB manages the state across all the services. That violates isolation and shared-nothing principles.
I do understand that, a microservice can publish an event when an entity is created, updated or deleted. All other microservices which are interested in this event can accordingly update the linked entities in their respective databases.
This is workable, however it leads to a lot of careful and coordinated programming effort across the services.
Can Akka or any other framework solve this use case? How?
EDIT1:
Adding the below diagram for clarity.
Basically, I am trying to understand, if there are available frameworks today that can solve this data consistency problem.
For the queue I can use any AMQP software such as RabbitMQ or Qpid etc.
For the data consistency framework, I am not sure if presently Akka or any other software can help. Or is this scenario so uncommon, and such an anti-pattern that no framework should be ever needed?
Theoretical Limitations
One important caveat to remember is the CAP theorem:
So by "requiring" that certain entities are consistent across multiple services you increase the probability that you will have to deal with timeout issues.
Akka Distributed Data
Akka has a distributed data module to share information within a cluster: