Mastering Microservices: Ensuring Data Consistency with the Outbox Pattern

In an e-commerce application, when a customer places an order, it is common to need to send an order_placed event to an event bus for further processing. A straightforward approach would be to make an entry in the order table and then publish the event synchronously. However, this raises significant concerns regarding the availability and reliability of the event bus. Message queue is unavailable while placing order For instance, what happens if the event bus is not available at the moment of publishing? In this case, one might consider rolling back the transaction in the order service to ensure that the order is not created without the corresponding event being sent. This rollback, however, introduces a delay in the user experience and creates a tight coupling between the order creation and event publishing processes. ...

September 28, 2024 · 5 min · Saddam H

Mastering Microservices: The Battle Between Choreography & Orchestration

In Choreography, dancers perform independently based on cues or signals from each other, without a central leader directing them. Each dancer knows their part and reacts to the movements or signals from others, much like how microservices communicate through events. The performance unfolds naturally as each dancer responds to the rhythm and flow. Dancers performing choreography in sync with the music In Orchestration, however, a conductor leads the musicians, directing them when to start, stop, or change tempo. The conductor has full control over the entire performance, much like how an orchestrator in microservices coordinates each service, managing the flow and ensuring everything happens in the right sequence. ...

September 24, 2024 · 6 min · Saddam H

Mastering Microservices: The Power of Effective Communication

The way you communicate, Does It Affect Your Way of Life? Certainly it does, communication is essential for understanding each other; nearly every living organism relies on it. While that’s not our topic today, it’s crucial to consider how communication impacts distributed systems. So, what happens when hundreds of services need to interact with each other? How do you manage this in your daily work? Are your services becoming overly chatty and tangled, like a plate of spaghetti? ...

September 16, 2024 · 6 min · Saddam H