Database Partition
Database Partition
Created on Jan 15, 2026, Last Updated on Jan 15, 2026, By a Developer
Partitioning is a design technique to provide better scalability in database. The problem statement is fairly simple, the table become too large to manage.
Vertical Partitioning
There are cases that tables grow horizontally, one table can contain hundreds of, even thousands of column. This hurt performance badly, since more columns means more Indexes, and slower scanning.
The solution is split the table into multiple, with each containing same amount of records but different non-overlapped set of columns. Records in different table share primary key.
Sharding
Horizontal Partitioning also called Sharding. It splits table into multiple ones with same schema.
There are many different way of defining the partition criteria:
- Hash based, or better with consistent hashing.
- Based on one enum like column value.
- Based on ranges of values on one column.
- Combining multiple techniques.