5 min readJust now

Press enter or click to view image in full size

Intro

Building services that sit on top of a Postgres replication slot and continuously stream data into Elasticsearch is a great way to get low‑latency search without hammering your primary database with ad‑hoc queries. But as soon as traffic ramps up, these services become a stress test for Go’s memory allocator, garbage collector, and JSON stack.

This post walks through optimizations applied to a real-world service that:

  • Connects to a Postgres replication slot
  • Transforms and enriches the change events
  • Uses Elasticsearch’s bulk indexer to index and delete documents

The constraints: the service cannot stop reading from the replication slot for long (or Postgres disk will grow), and it cannot buffer u…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help