What is the Listen to Yourself Pattern? | Designing Event-Driven Microservices

preview_player
Показать описание

The Listen to Yourself pattern is a technique to improve latency, while ensuring data consistency in microservices. It is implemented by having a microservice emit an event to a platform such as Apache Kafka, and then consuming its own events to perform internal updates. Since it separates Kafka and database writes into different processes, it can be used to avoid data consistency issues caused by the dual-write problem. However, it also allows microservices to respond quickly to requests by deferring processing to a later time.

RELATED RESOURCES

CHAPTERS
00:00 - Intro
01:07 - What is the dual-write problem?
01:30 - What is the listen-to-yourself pattern?
01:51 - How does the listen-to-yourself pattern eliminate dual writes?
02:24 - When are the events processed in the listen-to-yourself pattern?
02:55 - Is the listen-to-yourself pattern eventually consistent?
03:43 - How can we deal with eventual consistency?
04:14 - How do we validate events?
05:02 - Closing

--

ABOUT CONFLUENT

#microservices #apachekafka #kafka #confluent
Рекомендации по теме
Комментарии
Автор

Thanks a lot for the video. With the Listen to Yourself pattern, it implies that when our microservice performs a calculation or similar operation, the resulting data should be included in the event payload. This enables the service to rely on the data within the event payload to update its own database when it listens to itself.

In this setup, I feel it's crucial to pay careful attention to the message bus configuration, particularly aspects like order delivery guarantees.

Alternatively, employing event sourcing might be beneficial to provide a mechanism for reconciliation in case of discrepancies. For instance, if the process involves calculating a deposit check, merely having a snapshot of the calculation in the event payload might be insufficient.

kevinding
Автор

The Transactional Outbox pattern (with CDC) always works nicely as a way to avoid the Dual Write problem!

robreid_io
Автор

Thank you so much for sharing this with us on YouTube ❤️‍🔥 from SeoulNatU

sabaokangan
Автор

How is it different than the saga pattern

SwapnilDharane