Partitioning Data and Replicating Data

Partitioning divides data across storage roles. Replication keeps several copies of selected data for another purpose.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace a small catalogue
  2. Keep failure implications distinct
  3. Draw two orthogonal dimensions of a storage design
  4. Check what changes when availability or capacity changes

Trace a small catalogue

You might place IDs 1 through 100 in one partition and 101 through 200 in another. Each partition can then hold a primary and an additional copy. Sharding by key identifies the partition.

Keep failure implications distinct

Losing a partition can remove a subset of data from queries. Losing one replica can still allow alternatives depending on their state. See replica roles.[1]

Draw two orthogonal dimensions of a storage design

A catalogue can partition entries into two groups, north and south. Each group can have a primary and a copy. Partitioning decides which records belong together. Replication decides where copies of the same records are kept. See primary and replica duties.

North subset: primary N1, replica N2
South subset: primary S1, replica S2
An item belongs to one subset in this model and can have two copies

Check what changes when availability or capacity changes

Adding a replica can add redundancy or read capacity according to the design. Adding a partition changes placement and can split write workload. Test a write, a replica read and a cross-partition report.

References

  1. Google, Site Reliability Engineering ↩