# Revisiting the Outbox Pattern

DevFeed: [Revisiting the Outbox Pattern](<https://devfeed.tech/articles/revisiting-the-outbox-pattern-18865.md>)

Original publisher: [Read original article](<https://www.morling.dev/blog/revisiting-the-outbox-pattern/>)

Published: 2024-10-31T00:00:00Z

Content type: tutorial

Language: en

Sources: [Gunnar Morling](<https://devfeed.tech/sources/gunnar-morling.md>)

Topics: [Microservice](<https://devfeed.tech/topics/microservice.md>), [Kafka](<https://devfeed.tech/topics/kafka.md>), [Database](<https://devfeed.tech/topics/database.md>), [Architecture & Design](<https://devfeed.tech/topics/architecture-design.md>), [Streaming](<https://devfeed.tech/topics/streaming.md>), [Back end](<https://devfeed.tech/topics/backend.md>), [REST API](<https://devfeed.tech/topics/rest-api.md>)

Tags: [architecture](<https://devfeed.tech/tags/architecture.md>), [backend](<https://devfeed.tech/tags/backend.md>), [database](<https://devfeed.tech/tags/database.md>), [kafka](<https://devfeed.tech/tags/kafka.md>), [latency](<https://devfeed.tech/tags/latency.md>), [microservices](<https://devfeed.tech/tags/microservices.md>), [rest-api](<https://devfeed.tech/tags/rest-api.md>), [streaming](<https://devfeed.tech/tags/streaming.md>)

## AI overview

This article revisits the outbox pattern for reliably coordinating local database updates with notifications between microservices. It explains implementation considerations, including polling and log-based change data capture, then discusses drawbacks such as database overhead, complexity, and latency, along with alternatives including 2PC and durable execution.

## Source excerpt

Table of Contents Recap: What's The Outbox Pattern? Implementation Considerations Polling vs. Log-Based CDC The Outbox Table pg_logical_emit_message() Format Considerations Backfills Idempotency for Consumers Criticisms of the Outbox pattern Database Overhead Complexity Latency Discussion Alternatives to the Outbox Pattern Dapr Read-yourself Stream Processing on "Raw" Change Event Streams 2PC Durable Execution Summary This post originally appeared on the Decodable blog. All rights reserved. Over the last few years, the outbox pattern has become a common solution for implementing data exchange flows between microservices. It allows services to safely and reliably update their own local datastore and at the same time send out notifications to other services via data streaming platforms such as Apache Kafka. But time isn't standing still: people ask about disadvantages of the pattern (is the database becoming a bottleneck?), alternative solutions such as "listen-to-yourself" have been proposed, Kafka is about to get support for participating in 2-phase commit (2PC) transactions, and more. It's time to take another look at the outbox pattern, what it is and how to implement it, whether it's still relevant in 2024, and which alternatives exist!