Schedule - Nordic PGDay 2024

Beginner's Guide to Partitioning vs. Sharding in Postgres

Date: 2024-03-12
Time: 14:05–14:55
Room: Main room

Partitioning has come a long way in Postgres since the Postgres 10 days, as has sharding via the Citus extension. If you need to scale your Postgres, your friends may recommend you look into partitioning and/or sharding. But what’s the difference between these two approaches?

This beginner’s guide is for those who want to start with the basics and advance from there. You’ll learn what partitioning and sharding are in Postgres; how they’re different; as well as why (and when) these capabilities can help improve query performance. You’ll learn why some people call partitioning invaluable and others call sharding a lifesaver.

But there are gotchas and they’re not for every use case. As David Rowley says, “Understanding why partitioning helps is key to making the decision about whether to partition, what to partition on, and the type and number of partitions.” Similarly, understanding why sharding helps is key to deciding whether sharding is right for you. The concept of data locality will be touched on as well. And for those who prefer to learn by example and not just theory, yes, there will be examples.

Speaker

Claire Giordano