Software Development

What are the pros and cons of Database Sharding vs Vertical Scaling for high-write apps?

CH Asked by Christopher Lee · 14-05-2025
0 upvotes 6,512 views 0 comments
The question

Our social media app’s "likes" table is growing by 5 million rows a day. We’ve already upgraded our RDS instance to the largest size available. Should we start implementing application-level sharding now, or is there a better way to handle this write-heavy load without making the code too complex?

3 answers

0
NA
Answered on 17-05-2025

Sharding is the "nuclear option." It gives you infinite scalability but at a huge cost in application complexity—joins across shards become nearly impossible and re-sharding later is a nightmare. Before going there, I'd suggest looking at "Read Replicas" for the read load and "Write-Through Caching" using Redis to batch your updates. In 2023, we faced this and instead of sharding, we moved to a "Distributed SQL" database like CockroachDB. It handles the sharding automatically at the storage layer while giving you a standard SQL interface. It saved us from rewriting our entire backend logic while still giving us the horizontal growth we needed.

0
DA
Answered on 19-05-2025

Is your data naturally partitionable by something like UserID or Region, which would make a sharding strategy much simpler to implement at the architectural level?

CH 20-05-2025

Daniel, yes, we can definitely partition by UserID. Most of our queries are user-specific anyway. My concern is the "Global Feed" or analytics. If I shard by UserID, how do I run a query to find the "Top 10 most liked posts globally" without querying every single shard and aggregating the results in the application? That sounds like it would be incredibly slow and resource-intensive for the web server to handle.

0
MA
Answered on 22-05-2025

Vertical scaling is always cheaper in terms of "human hours." If you can buy a bigger server, do it. Only shard when you literally cannot buy a bigger box.

NA 23-05-2025

Mary is right. Sharding introduces "technical debt" that you'll be paying off for years. Max out your hardware and optimize your queries first.

Share your thoughts

Your email address will not be published. Required fields are marked (*)

Professional Counselling Session

Still have questions?
Schedule a free counselling session

Our experts are ready to help you with any questions about courses, admissions, or career paths. Get personalized guidance from industry professionals.

Request a Call Back

Search Online

We Accept

We Accept

Follow Us

"PMI®", "PMBOK®", "PMP®", "CAPM®" and "PMI-ACP®" are registered marks of the Project Management Institute, Inc. | "CSM", "CST" are Registered Trade Marks of The Scrum Alliance, USA. | COBIT® is a trademark of ISACA® registered in the United States and other countries.

World globe icon Country: Canada

Book Free Session