Breakout Session
summary
Claims an open‑source PostgreSQL extension pg_shard that manages placement distribution and replication of shards and plugs into the regular Postgres toolchain; uses Citus for distributed query planning, JSONB, CloudFormation and PG tooling (pgbench pg_stat_statements pgBadger). Shows a working system used in production (one customer hitting 30,000 inserts/sec and hundreds of GBs per month), explains logical shards and rebalancing, and notes limits such as no cross‑shard transactions.
AI-written summary · about
chapters (17)
- 0:00Intro
- 2:15Horizontal partitioning [...] involves putting different rows into different tables. - Wikipedia, "Shard (database architecture)"
- 5:16How does that scale?
- 6:08What about load characteristics?
- 9:45Logical!
- 10:44Operations burden Network resiliency - ACID tradeoffs? - No return
- 12:31Pyramids!
- 14:251. Generate realistic load 2. Measure, measure, measure... 3. Change one thing 4. Determine the impact 5. GOTO the first step
- 18:43Change and Compare
- 19:28Denormalize where necessary. Add indexes to all commonly used columns. Locally partition tables if it makes sense. Move hot columns to separate tables.
- 28:33Sharding principles
- 29:40Pass into hash function (smooths out distribution) – Use contiguous range - Specify a list of columns - Generalize to any expression
- 30:17Choosing a key
- 30:46the correct shard key can have a great impact on [...] performance [and] capability... - ib., Considerations for Selecting Shard Keys
- 31:23What is most important to your application? - Spreading incoming writes – Targeting reads to reduce latency - Consider key frequently in WHERE clauses - Use a hybrid approach when it makes sense (shard on customer, partition on time) Mind the "hot spots"
- 41:13Locks enforce safe commutation - Replicas visited in predictable order – Per-session libpq connection pool – If replica errors out, mark as inactive
- 48:03Questions
related talks
38mPostgreSQL as a distributed computing platform
42mPostgreSQL Distributed & Secure Database Ecosystem Building
33mFive Sharding Data Models and Which is Right
31mPostgreSQL Distributed & Secure Database Ecosystem Building
44mDistributed Postgres with Citus
45mThe Future of Postgres Sharding
34mPostgreSQL sharding, state of the art
45mThe Future of Postgres Sharding
