1.

How will you ensure data consistency in microservice based architecture?

Answer»

One should avoid sharing database between microservices, instead APIs should be exposed to perform the change.

If there is any dependency between microservices then the service holding the data should PUBLISH MESSAGES for any change in the data for which other services can CONSUME and update the local state.

If consistency is required then microservices should not maintain local state and instead can pull the data whenever required from the SOURCE of truth by making an API call.



Discussion

No Comment Found