liveBook · Manning

NetworkTopologyStrategy

As explained in ScyllaDB in Action

NetworkTopologyStrategy is a Cassandra-compatible keyspace replication strategy that places replicas according to datacenter and rack topology and supports per-datacenter replication factors.

NetworkTopologyStrategy replicates keyspace data with awareness of datacenters and racks. It lets each datacenter have its own replication factor, making it suitable for production clusters where failure domains matter. section 5.2.2 section 5.4

For each partition, the strategy:

  • Uses the configured replication factor separately for each selected datacenter. section 5.2.2
  • Selects replicas on different racks within a datacenter whenever possible. section 5.2.2
  • Continues selecting nodes in the same datacenter after every rack has already contributed a replica. section 5.2.2
  • Handles multiple datacenters independently, rather than placing replicas solely on the next nodes around the ring. section 5.2.1 section 5.2.2

Creating a reviews keyspace

A keyspace replicated three ways in datacenter1 can be created with: CREATE KEYSPACE reviews WITH replication = {'class': 'NetworkTopologyStrategy', 'datacenter1': '3'};. With three racks represented in a datacenter, this arrangement can tolerate losing an entire rack; suitable consistency levels can also support continued service after a datacenter failure. section 5.2.2

How ScyllaDB in Action covers it

How deep it goes
Explains replica selection across racks and datacenters, while deferring consistency-level and topology configuration details.
Examples
Uses a reviews keyspace, a two-datacenter three-rack cluster, and a CQL CREATE KEYSPACE statement.
What you can do after
Operate/configure a keyspace with per-datacenter replication factors and rack-aware replica placement.
How it connects
Connects replication factors with keyspaces, datacenters, racks, partitions, consistency levels, and ring placement.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of ScyllaDB in Action. The section links point to the parts of the book it draws on.