Commit and roll-back with micro-services.

Often a business goal is achieved when multiple resources are updated in sequence, parallel, etc. In terms of microservices, perhaps, it means to have services that update **a particular** resource (data store, messaging items, etc.) only. Otherwise, a microservice will no longer remain granular. But, this brings up the challenge of synchronizing the updates across different services (e.g. 2-phase commit protocol) so that, the “before-and-after” scenarios of the resources are consistent.

With multiple, independent micro-services, how is this synchronizing enforced? One option could be to bring all these services under an ESB (e.g. IBM IIB); but, that is a monolithic service. Yet another option is to implement a consensus protocol such as [Raft][1]. What are some of the known practices?



Leave a Reply