💾DatabasesDEV CommunityContent type: Blog

A Go outbox library that runs inside your own DB transaction (opens in new tab)

Discussed on DEV

TL;DR — tickr is a Go library. It stores messages in one Postgres table. You add messages inside your own database transaction. A worker pool in the same Go process reads them back using SELECT … FOR UPDATE SKIP LOCKED and runs your handler. It ships with Prometheus metrics, OpenTelemetry tracing, and a Grafana dashboard. No broker. No second datastore. The problem: two writes, one of them will fail Most services I've worked on end up with code like this: func CreateOrder(ctx context.Context,...

Read the original article
Sign in to keep reading the full article.

Keyboard Shortcuts

Navigation

Next / previous post
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Discover
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help