A lightweight, database- and broker-agnostic Go library for implementing the transactional outbox pattern.
Outbox is a Go library that implements the transactional outbox pattern to ensure reliable message delivery in distributed systems. It decouples database transactions from external message publishing, guaranteeing that messages are eventually delivered even if the system fails immediately after a transaction commits.
Go developers building distributed systems or microservices that require reliable, eventually consistent messaging between services, particularly those using relational databases and various message brokers.
Developers choose Outbox for its lightweight, database-agnostic, and broker-agnostic design, which provides core transactional guarantees without locking them into specific technologies. It offers flexible transaction management, observability features, and optional optimistic publishing for reduced latency.
Lightweight library for the transactional outbox pattern in Go, not tied to any specific relational database or broker.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Adds only one external dependency (google/uuid), keeping the library lean and easy to integrate without bloating the project, as highlighted in the README.
Supports multiple relational databases (PostgreSQL, MySQL, etc.) and any message broker via a simple publisher interface, offering flexibility in technology choices without vendor lock-in.
Provides both user-managed and library-managed transaction models, allowing developers to choose based on existing patterns or reduce boilerplate, as shown in the usage examples.
Exposes channels for errors and discarded messages, enabling seamless integration with metrics and alerting systems for monitoring poison messages and failures, detailed in the monitoring section.
Optional immediate async publishing after commit reduces latency, with the background reader as a fallback to ensure delivery guarantees, though it requires idempotent consumers.
Requires creating the outbox table manually for each database and writing custom publisher implementations for brokers, adding significant initial development and testing overhead.
As acknowledged in the FAQ, running multiple reader instances can lead to duplicates, necessitating idempotent consumers or broker deduplication features, which adds complexity.
Does not support NoSQL databases, restricting its use to systems that rely on SQL-based data stores, despite claims of being database-agnostic.
The background reader needs to be managed (started/stopped) and monitored, adding operational burden compared to simpler messaging solutions or managed services.