.NET Architecture & System Design Interview Question #57

What is horizontal partitioning?

Database Scaling, Partitioning, NoSQL & Data Consistency Mid-Level Intermediate

Quick Interview Answer

Horizontal partitioning divides rows of the same logical table into separate partitions. Each partition has the same columns but stores a subset of rows based on a key or range.

Detailed Explanation

Horizontal partitioning divides rows of the same logical table into separate partitions. Each partition has the same columns but stores a subset of rows based on a key or range.

Examples include partitioning orders by date or tenants by tenant ID. Queries that include the partition key can often avoid scanning unrelated partitions.

Code Example

Orders_2025 -> rows for 2025
Orders_2026 -> rows for 2026
Orders_2027 -> rows for 2027