sys-d
// distributed systems lab
Fixed Window CounterSliding Window LogSliding Window CounterToken BucketLeaky Bucket
Circuit BreakerRetry with BackoffTimeout WrapperBulkheadHedged RequestsFallback Strategy
LRU CacheLFU CacheTTL CacheCache AsideWrite-Through/BackCache StampedeBloom Filter
Round RobinWeighted Round RobinLeast ConnectionsIP HashingConsistent Hashing
In-Memory QueuePub/Sub BrokerAt-Most-OnceAt-Least-OnceDead Letter QueueConsumer GroupsPartitioned Log
Distributed LockLeader ElectionHeartbeat MonitorService RegistryService Discovery
Primary-ReplicaRead/Write QuorumVector ClocksCRDT Counters
Two Phase CommitThree Phase CommitSimplified Raft
Key-Value StoreAppend-Only LogWrite Ahead LogSSTableLSM Tree
Metrics CollectorHistogramStructured LoggerTrace ID Propagation
JWT ValidationAPI Key ValidationIdempotency KeyHMAC Verification
v1.0 · MIT
consistency

Consistency Patterns

Models for keeping data consistent across distributed replicas with different trade-offs.

// concept

The CAP theorem states you can only have two of: Consistency, Availability, Partition Tolerance. These patterns explore different consistency models and their trade-offs.

Primary-Replica

One primary handles writes and replicates to read replicas. Scales reads but introduces replication lag.

Read/Write Quorum

Require W writes and R reads where W+R > N for strong consistency. Tunable consistency-availability trade-off.

Vector Clocks

Track causal ordering of events across nodes. Detect concurrent updates and resolve conflicts.

CRDT Counters

Conflict-free replicated data types that converge without coordination. Increment/decrement across replicas.