liveBook · Manning

Chapter 7: Partitioning

What you will learn in chapter 7 of Think Distributed Systems

The introduction contrasts partitioning with replication and previews the partitioning topics covered in the chapter.

After this chapter you will be able to

Section by section

Introduction

The introduction contrasts partitioning with replication and previews the partitioning topics covered in the chapter.

Key terms: partitioning, replication, scalability, reliability, static and dynamic partitioning, vertical and horizontal partitioning, item-based lookup, directory-based lookup, common strategies

7.1 Encyclopedias and volumes

The section uses an encyclopedia split into volumes to introduce partitioning a software system across nodes and the challenges that follow.

Key terms: logical object, physical objects, disjoint subsets, partitions, node, producer, consumer, place, fetch, uneven distribution

7.2 Thinking in partitions

This section defines partitioning as a way to spread a logical object and its demands across nodes, then shows why both resource limits and the meaning of “big data” depend on the node.

Key terms: partitioning, logical object, physical objects, partitions, nodes, data volume, request volume, intrinsic property, extrinsic property, big data

7.3 The mechanics of partitioning and balancing

The section separates the two assignments involved in partitioning and shows why a partitioning strategy must fit—and adapt to—a system’s workload.

Key terms: key-value items, partitions, nodes, assignment, partitioning strategy, well-balanced reads and writes, skewed, unique characteristics and requirements, requirements and conditions, moves data between partitions

7.4 (Re)partitioning

This section distinguishes assigning data items to partitions from reassigning them when the partition layout changes.

Key terms: partitioning, repartitioning, data items, partitions

7.4.1 Types of partitioning

This section distinguishes two ways to classify partitioning—static versus dynamic and horizontal versus vertical—and shows how the latter two can be combined for user data.

Key terms: static partitioning, dynamic partitioning, elastic, online, offline, horizontal partitioning, sharding, vertical partitioning, rows, columns

7.4.2 Data item to partition assignment strategies

This section compares item-based and directory-based ways to assign data to partitions, including how to judge their suitability and the tradeoff between simplicity and placement control.

Key terms: variance, relocation, item-based assignment, directory-based assignment, stateless, stateful, directory, lookup table, coarse-grained, fine-grained

7.5 Common item-based assignment strategies

The section sets up an experiment for comparing item-to-partition assignment functions by how well they let the system find items and balance them across partitions.

Key terms: assignment function, find an item, balance items, words file, five partitions, count the items, Listing 7.3

7.5.1 Range partitioning

This section shows how range partitioning assigns keys to partitions and illustrates that it can produce an uneven distribution.

Key terms: range partitioning, key range, assignment function, distribution, well-balanced, hotspots

7.5.2 Hash partitioning

This section introduces hash-based assignment of keys to partitions and observes that the example produces a balanced distribution.

Key terms: hash value, key, partition, assignment function, well balanced, hotspots, distribution

7.6 Repartitioning

This introduction explains why changing the number of partitions can disrupt item placement and sets up a count of items that stay or move when partitions increase from five to six.

Key terms: repartitioning, item-based assignment strategies, number of partitions, placement, items remaining in their partition, items that must be relocated, 5 to 6

7.6.1 Range partitioning

This subsection reports how many items stay put or move when the author tests range-partitioning placement functions.

Key terms: range partitioning, placement functions, partition, relocate

7.6.2 Hash partitioning

This subsection shows that hash partitioning minimizes variance but, like range partitioning, can require extensive item relocation during repartitioning.

Key terms: hash partitioning, range partitioning, minimizing variance, minimizing relocation, placement function, current partition, relocate

7.7 Consistent hashing

The section presents consistent hashing through its partitioning effects and argues for understanding those effects before its implementation.

Key terms: consistent hashing, minimal variance, minimal relocation, partitions, specification, signatures or interfaces, effect of consistent hashing

7.8 (Re)balancing and overpartitioning

This section explains how assigning multiple partitions to each node makes it easier to rebalance capacity, while the number of partitions still limits how many nodes can be used.

Key terms: balancing, rebalancing, partitions, nodes, overpartitioning, number of partitions, maximum number of nodes

7.9 Summary

The section recaps how partitioning scales a system, distinguishes partitioning from balancing, and summarizes choices for dividing and assigning data as requirements change.

Where this is used later

Concepts explained in this chapter

← Chapter 6: Distributed transactions Chapter 8: Replication →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.