Database sharding strategies: hash-based vs range-based in practice
Marcus Ahmed
·223 views
we're hitting scaling limits with our main postgresql database, seeing around 50k writes per second, and sharding seems inevitable. we're a b2b saas with a very skewed tenant distribution: a few huge tenants, many small ones. this makes choosing a sharding key critical. we're weighing hash-based sharding on tenant id versus range-based. hash sharding seems simpler for even distribution but doesn't easily allow dedicated shards for our largest tenants. range sharding offers more control but risks hot spots if ranges aren't managed well. for those managing postgresql at this scale, what have been your experiences and recommendations for sharding strategies, especially when dealing with highly variable tenant sizes and write patterns?
9 comments