Cover of Designing Data-Intensive Applications by Martin Kleppmann - Business and Economics Book

From "Designing Data-Intensive Applications"

Author: Martin Kleppmann
Publisher: "O'Reilly Media, Inc."
Year: 2017
Category: Computers

🎧 Free Preview Complete

You've listened to your free 10-minute preview.
Sign up free to continue listening to the full summary.

🎧 Listen to Summary

Free 10-min Preview
0:00
Speed:
10:00 free remaining
Chapter 5: Replication
Key Insight 2 from this chapter

Single-Leader Replication Principles

Key Insight

Single-leader replication, also known as active/passive or master-slave, is a prevalent solution for ensuring data consistency across multiple database replicas. In this model, one designated replica serves as the leader, or primary, responsible for processing all client write requests. Upon receiving a write, the leader first commits the new data to its local storage, establishing the authoritative state of the database.

Subsequent to its local write, the leader transmits the data change to all other replicas, termed followers, or secondaries, through a replication log or change stream. Each follower receives this log and meticulously updates its local database copy by applying all writes in the exact sequence in which they were processed by the leader. From a client's perspective, followers are strictly read-only, accepting no direct write requests.

Clients wishing to retrieve data can direct their read queries to either the leader or any of the available followers. This architecture is widely adopted across various database systems, including relational databases such as PostgreSQL, MySQL, and Oracle Data Guard, as well as nonrelational databases like MongoDB and RethinkDB. Beyond traditional databases, it is also a core mechanism in distributed message brokers like Kafka and RabbitMQ.

📚 Continue Your Learning Journey — No Payment Required

Access the complete Designing Data-Intensive Applications summary with audio narration, key takeaways, and actionable insights from Martin Kleppmann.