Menu

Black Friday Sale: System Design
πŸ“°

Black Friday Sale: System Design

DEV Community: redisΒ·Bhanu partapΒ·about 13 hours ago
#SMuPYCBC
#devtoredis#devto#dev#databases#postgresql
Reading 0:00
15s threshold

Imagine, there are 4 database sharding strategies with 4 completely different outcomes. Pick the wrong one and your primary database melts on Black Friday.

Your Postgres orders table just hit 500 million rows. Queries that used to take 40ms are now crawling at 800ms. Vertical scaling is dead. You have to shard.

But before you pick a strategy, look at your actual workload.

80% of reads are customers checking their own order history from the last 30 days.

15% are analytics queries on date ranges.

Only 5% are new writes, around 400 requests per second, doubling on sale days.

So which sharding strategy do you choose?

A) Hash sharding on order_id

B) Range sharding on created_at

C) Directory based sharding

D) Consistent hashing with virtual nodes

What would you pick? Drop your answer below. πŸ‘‡

All four are real production strategies. But only one fits this specific e-commerce pattern.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.