How to implement the Outbox pattern in Go and Postgres
37 comments · go
- Comments37
37 comments · go
Story details from Lobsters ↗ · linked article on medium.com.
How to implement the Outbox pattern in Go and Postgres was first seen on Lobsters · Hottest on Oct 30, 2026. Since then it has appeared in 1 check on 1 different day. Its best position was #18 of 25, reached on Oct 30, 10:19 UTC. It dropped off the list after Oct 30, 10:19 UTC.
Position on Lobsters · Hottest at every check (lower is better).
Best rank per day (UTC).
A few top-level comments from Lobsters, shortened. Read the full thread on Lobsters.
I’ve used this pattern a lot with both Kafka and NATS in Go and Java. This is one of those “seems simple but isn’t” patterns. It’s really great when you get it working, but more complex than it seems - approach with caution. I’m a bit weirded out that they do a LIMIT 1 on the message retrieval. It’s much more…
As you touch on there, a common pitfall is that it's easy to implement the outbox in a way that works fine in testing and fails disastrously in production when you have a lot of stuff in the outbox — which is exactly the scenario you're trying to handle! Particularly before Postgres got `SELECT FOR UPDATE SKIP LOCKED`.
> Finally, instead of polling, you can use NOTIFY/LISTEN. This makes it feel magically instantaneous in dev. NOTIFY messages are deduped by poatgres so it’s also efficient. It's important to note a publisher still needs to poll both on startup and after a lost connection to the database. NOTIFY is not an alternative…
Archived daily, weekly and monthly lists that include this entry.
Not at the moment. It was last on the list on Oct 30, 10:19 UTC, after 1 day of trending.
#18 on Lobsters · Hottest, on Oct 30, 10:19 UTC. Trendoday checks this list every 30 minutes.
It was first seen on Oct 30, 2026 and has been on the list on 1 day (1 check) since.