What is a database cluster?
A database cluster is a group of servers (or database instances) working as a single system, providing shared storage, processing, and data access.
The idea behind a cluster isn't one powerful machine, but several linked nodes that share the load, storage, and fault tolerance among them.
The main goals of a cluster
- Scaling. It spreads load across several servers, more requests, more data, higher performance.
- Fault tolerance. If one node fails, the rest keep working, preserving the system's availability.
- Load balancing. Requests automatically get routed to free or less-loaded nodes.
- Replication and consistency. The cluster synchronizes data across nodes so it stays consistent.
Examples of cluster types
- Master-replica (primary-replica). One server for writes, the rest for reads.
- Multi-master cluster. Several nodes can write data at once (e.g. Galera Cluster, PostgreSQL BDR).
- Shared-nothing cluster. Each node stores its own data (used with sharding).
Example
In PostgreSQL, the term "cluster" often refers to a set of databases managed by a single PostgreSQL server process. In the broader sense (in production), it means a physical or logical set of servers joined by a shared architecture and replication.
Summary: A database cluster is a "team of servers" that together provide speed, fault tolerance, and scalability, while keeping the data consistent overall.
Short Answer
Interview readyA concise answer to help you respond confidently on this topic during an interview.