Urgent.News

the world's headlines, one feed

Tech

One Database Can't Hold Everything: Learn Database Sharding

This is Part 9 of my "From One User to One Million" series, where we'll build an understanding of System Design by following a simple application as it grows from a single user to millions. Instead of memorising technologies, we'll learn why they exist by solving real problems as they appear. Look at what we've built so far. We started with a single server. We added more application servers when…

The ability of a single database to handle an ever-increasing amount of data is limited. While adding more application servers and caching layers can address traffic growth, the sheer volume of data eventually becomes a bottleneck. As the database grows, backups take longer, indexes consume more memory, and routine maintenance operations become risky and time-consuming.

Upgrading hardware by adding more RAM, faster disks, or CPU cores provides temporary relief but ultimately reaches its physical and economic limits. Shrinking the data by vertically scaling the server, from a small machine to larger ones, also becomes increasingly expensive and offers diminishing returns. The fundamental issue remains: the data itself is too large to be efficiently managed in a single database.

This realization leads to the idea of database sharding, which involves dividing the data across multiple databases based on a specific criterion, such as user IDs. By splitting the data into smaller, more manageable chunks, each database handles a fraction of the total data, resulting in smaller indexes, faster backups, and reduced write loads on individual databases.

Each shard can be located on its own server, allowing for parallel processing and improved scalability. Sharding transforms the approach from simply trying to make the database bigger to actively splitting the data across multiple databases, addressing the core problem of data management as the application scales from a single user to millions of users.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written; read the original for the full account.

Read the original at dev.to →

More in Tech

LINE Service Messages vs Messaging API: Choose the Right Message Path

LINE MINI App Service Messages and the LINE Messaging API can both deliver messages to users, but they solve different problems.

  • Service Messages confirm actions within LINE MINI Apps, like reservations or orders.
  • Messaging API enables conversations, outreach, and mass communication via LINE Official Accounts.
  • Misuse can result in rejected templates, unusable tokens, and inefficient architecture.