~/talk

Postgres as a Message Broker

Talkat PGConf India 2025 · 2025-03-05..03-07· [databases, microservices]
links:none on file
slides:none on file

Postgres replaces RabbitMQ/Redis for async work by storing tasks in SQL, using Redis as a buffer and Lambdas to bulk insert 1k–2k rows, consumers fetching batches of ~10 with select for update skip locked, and a sidecar that marks abandoned tasks; runs ~200–300 workers, cuts queue infra cost ~50–60%, and drops RMQ RAM overloads. Solves high API latency with buffering, fixes queue starvation by isolating heavy queues, and reduces lock manager contention by removing unused indexes and shortening transactions.

AI-written summary · about

  1. 0:00Introduction to Postgres as message broker
  2. 1:07Why switch from RabbitMQ
  3. 3:16PGQ introduction and features
  4. 5:03Producer and consumer workflow
  5. 7:52Producer reliability and retry logic
  6. 9:19Consumer flexibility and code snippet
  7. 10:00Cron runner and task scheduling
  8. 11:08Sidecar process for worker monitoring
  9. 11:50Final architecture overview
  10. 12:11High response time issue and solution
  11. 14:59Task starvation issue and fix
  12. 16:03Lock manager weight events problem
  13. 19:13Solutions for lock manager issues
  14. 20:39Performance optimization results
  15. 21:00Conclusion and benefits summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.