Sunday, April 4, 2021

6.2 Using Events to Maintain Data Consistency Event Driven Microservices

 April 4, 2021

Event-driven order processing 

Eventually consistent credit checking 

Place order, order created, credit reserved, or credit check failed 

Order management   customer management 

Problem #1: How to design eventually consistently? 

Problem #2: How atomically update database and publish an event 

Failure = inconsistent system 

Order service 

Update and publish using 2PC 

  • Guaranteed atomicity BUT
  • Need a distributed transaction manager
  • Database and message broker must support 2PC
  • Impacts reliability
  • Not fashionable
  • 2PC is best avoided 

No comments:

Post a Comment