TGViewer
Computer Science and Programming Computer Science and Programming @computer_science_and_programming · 140K subscribers
Post #2324 11.7K
Scaling Down Costs, Not Performance: How We Migrated from Couchbase to PostgreSQL
Trendyol's product content team details a phased, zero-downtime migration of five 'helper bucket' datasets (2.24 billion documents across two clusters) from Couchbase to PostgreSQL to cut infrastructure costs while preserving read performance. The strategy combined dual-writes via Kafka consumers, a custom CDC-based migrator tool for historical backfill, and feature-flagged cutover of read traffic. Key production challenges included a mysterious TPS spike traced to PgBouncer's server_reset_query_always setting, a connection-limit incident causing a primary node failover, and a hidden scaling issue where PgBouncer's own horizontal autoscaling multiplied backend connections beyond expectations (20 pods × 150 default_pool_size = 3000 potential connections). Final production benchmarks showed stable P50 latency and only a brief P99 spike (200ms to 400ms) under peak load, validating the migration.
  • ❤ 10
  • 👍 4
  • 🗿 1
More from @computer_science_and_programming
  1. Oct 3, 2026BYD says it will have a solid-state car next year, the earliest date anyone has given BYD…
  2. Oct 1, 2026Introducing G#: A Go-like language for .NET G# is a new open-source, Go-inspired programmi…
  3. Sep 30, 2026Chrome for Developers Chrome 146 introduces three notable features for web developers. Scr…
  4. Sep 26, 2026Introduction to Solon A comprehensive tutorial walks through building a REST API with Solo…
  5. Sep 25, 2026The strangler fig pattern: modernizing without a big-bang rewrite A detailed guide to the…
  6. Sep 24, 2026Lessons From Four Years of Writing a Weekly Newsletter A .NET blogger reflects on four yea…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →