
5/31/2017 · Ben Stopford
What this post added
This post introduces the concept of building microservices using an event-driven architecture with Apache Kafka as the backbone. It contrasts this with traditional request-response models, highlighting the challenges of synchronous interactions in distributed systems. The post defines Commands, Events, and Queries, and illustrates how an event-driven flow can reduce coupling and improve pluggability. It introduces the 'Query by Event-Carried State Transfer' pattern to avoid remote queries and internalize them by caching event data within services, leading to better decoupling, autonomy, and efficient joins. The 'Single Writer Principle' is also presented as a way to manage consistency and validation by assigning responsibility for event propagation to a single service. The post uses examples of customer orders and stock management to demonstrate these concepts.