3 ms·
So my understanding is that there is are practical differences between a partition and a shard. They both are ways to stored separately, based on the partition
by mywittyname 6y ago
So my understanding is that there is are practical differences between a partition and a shard. They both are ways to stored separately, based on the partition key. But a partitioned table has one table, while a shard uses multiple tables which share the same schema.
For example, with a partitioned database, you might have a single `transaction` table, partitioned by date, but with a shard database, you'd have multiple `transaction_${date}` tables which needed to be queried from, but they'd share a common schema.
- greenshackle2 6y agoLast time I did partitioning by date in postgres (on postgres 9.?), multiple transaction_${date} tables is exactly what I got. They are exposed as a single 'transaction' table but they were really different physical tables. My understanding is that partitioning is a more general term. Partitioning can be on one or multiple servers. Sharding is a type of partitioning that is always across multiple servers.