๐ŸŽ New User? Get 20% off your first purchase with code NEWUSER20 ยท โšก Instant download ยท ๐Ÿ”’ Secure checkout Register Now โ†’
Menu

Categories

Databases Advanced

What is Database Sharding?

A horizontal scaling strategy that distributes data across multiple database servers based on a partition key.

Sharding splits a database into shards, each on a separate server. A shard key (e.g., user_id) determines which shard stores each row. This distributes both data and query load, enabling horizontal scaling beyond a single server's capacity.

Challenges include cross-shard queries (joins across shards), rebalancing shards as data grows, maintaining consistency, and choosing an effective shard key. Some databases support native sharding (MongoDB, CockroachDB). Often avoided until truly needed due to complexity.

Related Terms

Database Proxy
A middleware server that sits between applications and databases, providing connection pooling, load balancing, and query routing.
Database Backup
The process of creating copies of database data to protect against data loss from failures, corruption, or human error.
Soft Delete
A pattern where records are marked as deleted with a flag or timestamp rather than being physically removed from the database.
Database Constraint
Rules enforced by the database to maintain data integrity, including NOT NULL, UNIQUE, CHECK, PRIMARY KEY, and FOREIGN KEY.
Row-Level Security (RLS)
A database feature that restricts which rows a user can access in a table based on security policies.
ETL (Extract, Transform, Load)
A data pipeline process that extracts data from sources, transforms it into a suitable format, and loads it into a destination system.
View All Databases Terms โ†’