Cassandra Cluster Architecture (Nodes, Data Centers, Racks, etc.)

Node (Node)

A Cassandra node is a computing resource within a cluster responsible for storing and processing data. In a Cassandra cluster, each node has the following attributes:

  • IP Address: Each node has a unique IP address.
  • Port Number: Each node uses a specific port number (the default port number is 9042).
  • Network Interface: Each node must run on the local network.

Data Center (Data Center)

A data center is the physical location where data is stored and processed within a cluster. A data center typically contains multiple racks and is located in one or more buildings. In Cassandra, a data center can be selected in the following ways:

  • Single Computer: A single computer can serve as a single data center.
  • Multiple Computers: A cluster composed of multiple computers can serve as a single data center.

Rack (Rack)

A rack is a physical resource within a data center, typically containing one or more machines. In Cassandra, each rack is independent and can run on different networks. Each rack has the following attributes:

  • IP Address: Each rack has a unique IP address.
  • Port Number: Each rack uses a specific port number (the default port number is 9042).
  • Network Interface: Each rack must run on the local network.

Partition and Replica (Partition and Replica)

Cassandra supports a design involving partitions and replicas, allowing data to be distributed across multiple nodes, thereby improving availability and reliability. Among these, replicas are data copies of a partition held by multiple nodes, used to ensure data consistency.

Partition

A partition is the basic unit of data storage in Cassandra. Data is distributed across multiple nodes based on specific key-value pairs (such as timestamps or sequence numbers). Each partition represents a continuous range. Partitions have the following attributes:

  • Key-Value: Determines the distribution of data.
  • Size: Determines the capacity of the data.

Replica

In Cassandra, a replica is a data copy of a partition held by multiple nodes, used to ensure data consistency. Replicas have the following attributes:

  • Partition Count: Determines the number of replicas.
  • Replica Distribution: Determines the location of the replicas.

Partition and Replica Combination

Partitions and replicas are the fundamental units for data storage in Cassandra, ensuring data consistency and availability. By distributing them across multiple nodes, the system's reliability and high availability are enhanced.