Not Everything is a Distributed Systems Pattern — Here’s What Actually Is

I see Sidecar and Circuit Breaker misclassified all the time. Let’s set the record straight


Photo by

I keep bumping into posts on public forums where someone calls Circuit Breaker or Sidecar a “distributed system pattern.” I understand the confusion — I’ve been there myself. Patterns like Ambassador, Bulkhead, or Cache-Aside are often critical in microservices-based architectures, but they aren’t quite the same as distributed systems patterns.

1. Replication

Replication covers how data is copied and kept consistent across nodes to ensure fault tolerance and durability.

  • Write-Ahead Log — Like keeping a diary where you write down plans before doing anything. If something crashes, you can replay your log and pick up where you left off.
  • Leader and Followers — Think of a lead singer with backup singers. The leader performs, and the backups stay in sync. If the lead singer drops, a backup steps in.
  • Paxos — A method for getting a group to agree on a decision, like passing a note in class where everyone must sign off before action is taken.
  • Replicated Log — Instead of each machine keeping its own version, all machines record the same events in the same order — like a shared group journal.

2. Partitioning

Partitioning is about splitting data across multiple nodes so no single machine gets overloaded.

  • Fixed Partitions — Predefined, equal slices of data, like cutting a pizza before serving it.
  • Consistent Hashing — A method where data is assigned to a node using a formula, minimizing movement when nodes come and go.
  • Directory-Based Partitioning — Think of a phone directory that tells you exactly where to find data, reducing guesswork.

3. Coordination

Coordination ensures that distributed nodes agree on decisions and act in a synchronized way.

  • Consensus — Like a group of friends voting on a restaurant. No action happens until most people agree.
  • Leader Election — If the team captain leaves, a new one is elected to lead decisions.
  • Two-Phase Commit — Think of a wedding ceremony: The officiant asks both people if they agree before the final “I do.” If either side backs out, the wedding doesn’t happen.
  • Gossip Protocols — Instead of announcing to the whole room, you whisper news to a few people, who then pass it along — fast and efficient communication.

4. Distributed Time

Keeping time synchronized across a distributed system is hard because different machines have different clocks.

  • Lamport Clock — Instead of relying on real-world time, it numbers events in order — like versioning a document.
  • Hybrid Clock — A mix of real-world time and event-based numbering to provide a reliable timeline.
  • Clock-Bound Wait — Ensuring all nodes wait a safe amount of time before assuming a task failed.

5. Cluster Management

Cluster management ensures nodes know who is online, who is offline, and who is in charge.

  • Lease — A temporary permission slip given to a node, ensuring no two machines do the same job at the same time.
  • Gossip DisseminationUpdates spread organically, like a rumor mill ensuring all nodes get the latest info.
  • State Watch — Like a security camera, constantly watching for changes in cluster state.

6. Nodes Communications

Nodes need efficient ways to talk to each other.

  • Single-Socket Channel — One direct line of communication instead of redialing every time.
  • Request Batch — Instead of sending one letter at a time, you batch multiple requests together to reduce overhead.
  • Request Pipeline — A factory assembly line where data continuously flows through a pipeline instead of waiting for a full batch.

So, Why Aren’t Circuit Breaker or Sidecar “Distributed Patterns”?

Every time I explore these patterns, I’m reminded that distributed systems have different challenges than microservices.

Yes, a Sidecar helps standardize logging or networking, and Circuit Breakers prevent cascading failures. But they don’t help coordinate data across nodes or elect leaders in a cluster.

For example, replication answers “Which node should I send the write to?” or “How do I ensure my data is durable?”. That’s where Write-Ahead Log and Replicated Log come into play. Meanwhile, Consensus (under Coordination) helps elect a leader or decide which node’s data is the source of truth.

The Right Tool for the Right Job

Once people see the difference, they reach for the right tool:

  • If I need to keep data consistent across regions, I use Replication and Consensus.
  • If I just need to prevent a microservice from crashing, Circuit Breaker is enough.

I’m always happy when someone asks, “But why can’t I call Ambassador a distributed systems pattern?” because it means they’re curious about the bigger picture.

If you’ve ever wondered the same, I hope this guide gives you a clearer map!


要查看或添加评论,请登录

Bran Kop的更多文章

社区洞察

其他会员也浏览了