TAG
Distributed Systems
46 notes
- 1.1 Distributed Systemshistorical
An overview of why distributed systems are needed and how replication, partitioning, consistency, transactions, communication, and common distributed components fit together.
- 1.2 How to Implement Distributed Lockshistorical
Requirements and failure cases for locks across processes or machines, with Redis- and ZooKeeper-style approaches and the importance of ownership and fencing.
- 1.3 How to Generate Distributed IDshistorical
Design goals and trade-offs for globally unique IDs using database sequences, UUIDs, Redis counters, and Snowflake-style timestamp/worker/sequence layouts.
- 1.4 How to Implement Distributed Sessionshistorical
Why process-local sessions break under horizontal scaling and how replication, shared session stores, and centralized authentication address the problem.
- 1.5 How Distributed Storage Workshistorical
The core building blocks of distributed storage: partitioning, replication, consistency, metadata, routing, and failure recovery.
- 1.6 BASEhistorical
BASE as an availability-oriented distributed-systems design idea: basic availability, soft state, eventual consistency, and its relationship to flexible transactions.
- 1.7 CAPhistorical
The CAP theorem: consistency, availability, partition tolerance, and the C/A trade-off a distributed system faces when a network partition occurs.
- 1.8 Cluster Metadata Managementhistorical
What cluster metadata represents, why routing and ownership depend on it, and centralized versus peer-to-peer metadata management.
- 1.9 Distributed Consistencyhistorical
Why replicated distributed systems face consistency problems, how consistency models define observable guarantees, and how consensus algorithms help nodes agree on state.
- 1.10 Distributed Computinghistorical
A compact introduction to distributing computation across machines, with batch and stream processing as two common execution models.
- 1.11 Distributed-System Communicationhistorical
Synchronous and asynchronous service communication, RPC versus resource-oriented HTTP APIs, API compatibility, and message encoding choices.
- 1.12 Stateful and Stateless Serviceshistorical
How state placement changes routing, scalability, recovery, and storage dependencies in distributed services.
- 1.13 Distributed-System Upgrades and Rollbackshistorical
Deployment strategies for multi-instance services: downtime, blue-green, rolling, canary rollout, A/B testing, and practical rollback mechanisms.
- 1.14 Distributed-System Failureshistorical
Failure detection and common resilience behaviors including failover, fail-fast, fail-safe, fail-silent, failback, hedged/forked calls, and broadcast calls.
- 1.15 Inter-Node Communicationhistorical
How distributed nodes exchange cluster metadata and the trade-offs between centralized coordination and peer-to-peer dissemination.
- 2. Distributed Transactionshistorical
Why transactions become harder across services and data stores, and how 2PC, TCC, Saga, reliable messaging, reconciliation, and best-effort notification address different consistency requirements.
- 2.1 Two-Phase Commit (2PC)historical
How two-phase commit coordinates atomic commit across transactional resources, and why blocking, coordinator failure, and long-held resources are its main costs.
- 2.2 TCC: Try, Confirm, Cancelhistorical
Application-level distributed transactions using Try, Confirm, and Cancel operations, including reservations, compensation, retries, idempotency, and business-code cost.
- 2.3 Reliable Messaging and Eventual Consistencyhistorical
How a durable business change and a durable outgoing message are coupled so downstream services can converge through retries and idempotent consumption.
- 2.4 Best-Effort Notificationhistorical
A notification pattern for external or loosely coupled systems using bounded retries, durable result lookup, and reconciliation instead of atomic cross-system commit.
- 2.5 Sagahistorical
Long-running distributed transactions as a sequence of local transactions plus compensating actions, with orchestration/choreography and isolation trade-offs.
- 2.6 Three-Phase Commit (3PC)historical
The CanCommit, PreCommit, and DoCommit structure of 3PC, why it was proposed to reduce blocking, and why partitions still make it uncommon in practice.
- 2.7 Two-Stage Transaction Patternshistorical
A conceptual comparison between resource-level two-phase commit and application-level TCC, both of which separate preparation from the final decision.
- 2.8 Transactional Outbox / Local Message Tablehistorical
How to commit business state and an outgoing event in one local database transaction, then asynchronously publish with retries and idempotent consumption.
- 2.9 Two-Stage Implementation: 2PChistorical
A compact implementation-oriented view of two-phase commit and XA resource coordination.
- 2.10 Two-Stage Implementation: TCChistorical
An implementation-oriented summary of application-level Try/Confirm/Cancel transactions and their idempotency and compensation requirements.
- 2.11 Best-Effort Notification with a Message Queuehistorical
Using an MQ for retryable notifications while keeping an authoritative query path for receivers that miss or cannot process a callback.
- 2.12 RocketMQ Transactional Messageshistorical
RocketMQ's half-message, local-transaction, commit/rollback, and transaction-check protocol for coupling producer-side local state with message visibility.
- 3. Distributed Consensus Algorithmshistorical
Why distributed nodes need consensus, how Paxos, Raft, ZAB, and Gossip differ, and how consensus relates to strong or eventual consistency.
- 3.1 Paxoshistorical
Basic Paxos roles and two-phase decision flow, why contention is expensive, and how Multi-Paxos uses a stable leader to make repeated consensus practical.
- 3.2 ZABhistorical
An entry point to ZooKeeper Atomic Broadcast (ZAB), ZooKeeper's leader-based protocol for ordered, reliable state updates.
- 3.3 Rafthistorical
Raft's leader, follower, and candidate roles; leader election; replicated-log operation; quorum commitment; and recovery after leader failure.
- 3.4 Gossiphistorical
How gossip protocols spread information through randomized peer-to-peer exchanges, why they scale well, and the redundancy and convergence trade-offs they introduce.
- 3.5 Distributed Consistency Modelshistorical
A practical map of linearizability, eventual and causal consistency, read-your-writes, session consistency, monotonic reads and writes, and consistent-prefix reads.
- 4. Distributed-System Replicationhistorical
Why distributed systems keep multiple replicas of the same data, how replication improves availability and read capacity, and the major design dimensions behind replication.
- 4.1 Multi-Leader Replicationhistorical
Why multiple leaders are useful across regions or offline-capable systems, and how concurrent writes create conflicts that require prevention, detection, or resolution.
- 4.2 Leaderless Replicationhistorical
Leaderless replication with multi-replica reads/writes, quorum-style coordination, version reconciliation, read repair, and anti-entropy.
- 4.3 Single-Leader Replicationhistorical
How leader/follower replication handles writes, reads, initial synchronization, incremental catch-up, leader election, and failover.
- 4.4 Replication Logshistorical
Physical and logical change logs, statement- versus row-oriented replication, and why deterministic replay and schema/storage coupling matter.
- 4.5 Replication Strategieshistorical
Synchronous, asynchronous, and semi-synchronous replication and how acknowledgement rules change latency, durability, availability, and replica lag.
- 4.6 Replication Architectureshistorical
The three common replication topologies: single-leader, multi-leader, and leaderless replication, and the trade-offs each introduces.
- 5. Distributed-System Partitioninghistorical
How partitioning splits a dataset across nodes, why it scales storage and read/write throughput, and how partitioning differs from replication.
- 5.1 Partitioning: Splitting Datahistorical
How to choose a partition key and compare explicit, random, range, modulo-hash, consistent-hash, virtual-node, and hash-slot partitioning.
- 5.2 Partitioning: Request Processinghistorical
How shard keys determine targeted routing, why missing shard keys cause scatter/gather, and the difference between local and global secondary indexes.
- 5.3 Partition Routing Componentshistorical
Three ways to locate a partition owner: client-side routing, a dedicated proxy, or server-side forwarding/redirects.
- 5.4 Partition Assignment and Rebalancinghistorical
How logical partitions are assigned to machines, static versus dynamic placement, and what changes when a cluster rebalances.