DEV Community

Mohan Sharma
Mohan Sharma

Posted on

Database Partitioning

A database can be partitioned horizontally, vertically, or functionally.

In horizontal partitioning, also called sharding, each partition holds data for a subset of the total data set. The partitions share the same data schema. For example, customers whose names start with Aā€“M go into one partition, Nā€“Z into another partition.

In vertical partitioning, each partition holds a subset of the fields for the items in the data store. For example, put frequently accessed fields in one partition, and less frequently accessed fields in another.

In functional partitioning, data is partitioned according to how it is used by each bounded context in the system. For example, store invoice data in one partition and product inventory data in another. The schemas are independent.

Top comments (0)