~/talk

Scaling a Saas application beyond a single Postgres with Citus

Talkat PostgresOpen Silicon Valley 2017 · 2017-09-06..09-08· [databases]
links:none on file
slides:none on file

SaaS primary DB moves from a single Postgres (~0.7 TB) to Citus with 64 shards, a 60 GB coordinator and 661 GB data nodes totaling ~3.8 TB available; migration costs about 3 dev‑months of prep, a 19‑hour cutover day for eight people, and extra hotfix hours. Rails code gets shard keys everywhere (acts_as_tenant), PG Bouncer is tuned, indices rebuilt with tuned maintenance_work_mem and create index concurrently where possible. Result: no data loss, much easier indexing and headroom, but coordinator overload from distributed scans forces index reordering and adding explicit shard hints to fix performance.

AI-written summary · about

  1. 0:00Introduction
  2. 1:02Who are we
  3. 1:51Agenda
  4. 3:35Stealing work
  5. 4:16We dont have an elite problem
  6. 7:37Level of effort
  7. 15:44Code examples
  8. 19:42ActiveRecord Multitenant
  9. 20:51Rails ActiveRecord
  10. 22:45Read with Shard ID
  11. 24:44Save with Shard ID
  12. 25:14Wrappers
  13. 25:36Reads
  14. 25:55Distributed queries
  15. 28:03Index build speed
  16. 29:17Creating an index
  17. 32:56Postmortem
  18. 34:10Citus Fix
  19. 36:25Lucas Fix
  20. 37:25Hotfixes
  21. 42:08What went right
  22. 44:10What went wrong
~/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.