What Is the AT Protocol? A Developer's Mental Model

Most social networks use a single database with an app, storing usernames, posts, algorithms, moderation rules, and HTML within the same company. Building on top means relying on the vendor’s rate-limited API, which can change or disappear unexpectedly.

The AT Protocol (ATproto) divides the monolith into parts that different people can run, use different languages for, and swap out without…

Read more →
Replica Set

A replica set is MongoDB's name for a group of database nodes that maintain the same data and provide automatic failover. One node is the primary (accepts writes); the rest are secondaries that asynchronously apply the primary's operation log. If the primary becomes unreachable, the secondaries elect a new primary among themselves.

How it works

Writes go to the primary, which records them in…

Sharding is the practice of horizontally partitioning a dataset across multiple database instances so each shard holds a subset of the data and serves a subset of the load. Sharding is the standard answer when a single database server cannot keep up with storage, read throughput, or write throughput.

How it works

A shard key (one or more fields) determines which shard each row or document…

CAP Theorem

The CAP theorem states that a distributed data store cannot simultaneously provide all three of: Consistency (every read returns the latest write), Availability (every request receives a response), and Partition tolerance (the system continues to operate despite network splits). Under a network partition, a system must give up either consistency or availability.

What the three properties mean…

Eventual consistency is the property that, given enough time without new updates, all replicas of a piece of data will converge to the same value. Reads may see stale or out-of-order data in the short term, but the system guarantees convergence rather than instantaneous global agreement.

Why it exists

Strong consistency (every read sees the latest write) requires coordination on every write,…

Consensus is the problem of getting a set of distributed processes to agree on a single value despite failures, message delays, and out-of-order delivery. Consensus protocols are the foundation under any replicated state machine, leader election, distributed lock, or strongly consistent database.

The classical guarantees

  • Agreement. All correct processes decide the same value.
  • Validity.…
Saga

A Saga is a pattern for executing a business transaction that spans multiple services or databases by chaining local transactions together, with compensating actions to roll back partial progress on failure. Sagas replace distributed transactions (two-phase commit) in microservice systems where global ACID across services is impractical.

How it works

A saga breaks a business transaction into a…

Event-Driven Architecture (EDA) is a style in which services communicate by publishing and subscribing to events on a message bus, rather than calling each other synchronously. Producers emit events when something happens; consumers react to those events independently. The pattern reduces coupling and enables fan-out, replay, and asynchronous processing.

How it works

A producer publishes an…

Modular Monolith

A modular monolith is a single-deployable application built with strict internal module boundaries: clear ownership per module, explicit interfaces between them, no shared mutable state across boundaries. The result combines monolithic operational simplicity with most of the structural benefits of microservices.

How it works

Each module owns its own data, its own domain logic, and exposes a…

Monolith

A monolith is an application packaged and deployed as a single unit: one codebase, one build, one process, one database. Everything ships together. Most applications start as monoliths and many remain so for their entire useful life; the term has acquired a pejorative tone in recent years that obscures how often it is the right choice.

Strengths

  • Simple operations. One thing to deploy, one…
Cache Stampede

A cache stampede (or thundering herd) is the failure mode where many concurrent requests for the same hot key all miss the cache at the same time, hit the origin simultaneously, and overwhelm it. Stampedes typically happen the instant a popular key expires, when a cache is cold-started, or when a downstream system briefly fails and recovers.

How it happens

Consider a homepage feed cached with…

Idempotency is the property that repeating an operation produces the same outcome as performing it once. An idempotent operation can be safely retried after a network failure, timeout, or partial failure, without risking duplicate side effects.

Idempotency by HTTP method

  • GET, HEAD, OPTIONS: safe and idempotent by definition
  • PUT, DELETE: idempotent (replacing or removing the same resource…
Fundamentals of Software Traffic Management

Why Traffic Management Becomes the Real System

Distributed systems fail at the boundaries between services. A single user request crosses many network hops, each with different latency, failure behavior, and ownership. Without shared traffic controls, every team invents its own retry logic, timeout values, routing rules, and access policy. That creates inconsistent behavior, hidden coupling,…

Read more →
Page 1 Older →