Sharding PostgreSQL using Foreign Data Wrappers
summary
Shows how to shard PostgreSQL using postgres_fdw and declarative partitioning, with concrete features and limits: join/aggregate/order-by pushdown, partition-wise joins, parallel foreign scans, bulk insert batching and parallel commits (PG15), plus connection pooling and automatic reconnect. It supports full DML (insert/update/delete) but lacks safe global 2PC and deadlock detection, so partial commits and prepared-transaction recovery require an external coordinator or Citus/ShardingSphere. Notes practical gotchas: default fetch_size=1, search_path reset to pg_catalog, and remote-repeatable-read snapshot semantics.
AI-written summary · about
chapters (11)
- 0:00Introduction to sharding
- 3:27Understanding SQL/MED and FDW
- 5:57Business use cases
- 8:40Postgres FDW mechanics
- 11:03Optimizer and performance
- 18:51Query optimization tuning
- 23:57Implementation examples
- 28:02Transaction management
- 34:41MVCC and data consistency
- 40:16Alternative sharding tools
- 43:15Q&A and closing








