← Back to list

I Thought I Needed a Circuit Breaker. I Was Wrong.

Source: Medium

Read on Medium ↗

Don’t Build an 8-Lane Bridge for Two Bicycles

There’s a peculiar pattern in software engineering: greater knowledge of system design patterns correlates with increased overengineering tendencies.

I initially believed I was constructing robust systems. Instead, I was introducing unnecessary complexity. Here’s how that realization emerged through experience.

The Circuit Breaker Mistake

While designing a Change Data Capture (CDC) pipeline to synchronize data from a primary database to a search engine, I became preoccupied with hypothetical failure scenarios:

  • Downstream service outages
  • Cascading failures
  • System instability under load

This thinking led to implementing a Circuit Breaker pattern — a full week of development effort. The solution seemed textbook perfect: preventing cascading failures, failing quickly, and protecting resources.

Reality Check

During a design review, my manager posed a straightforward question: “What is this for?”

After explaining the Circuit Breaker’s benefits, the response was direct: “Remove it. The data volume isn’t substantial. Just implement retries. You’re constructing an 8-lane bridge for two bicycles.”

Understanding the Mismatch

Initially resistant, I eventually recognized the critical insight: the mistake wasn’t using a Circuit Breaker itself, but applying it to the wrong context.

Circuit Breakers address synchronous systems requiring immediate responses — API calls between services or time-sensitive user requests. CDC is fundamentally different: asynchronous, event-driven, and eventually consistent. No user awaits a response.

What CDC Actually Needs

Well-designed CDC pipelines incorporate built-in resilience mechanisms:

  1. Queue buffering prevents data loss during downstream failures
  2. Exponential backoff retries replace fail-fast approaches
  3. Dead Letter Queues handle persistent failures
  4. Idempotency ensures safe message reprocessing

YAGNI: Discipline Over Laziness

YAGNI (You Aren’t Gonna Need It) represents engineering discipline, not laziness. I added complexity based on hypothetical scenarios rather than actual requirements.

Effective YAGNI implementation means:

  • Solving problems existing today, not imagined future ones
  • Maintaining simplicity to enable evolution
  • Prioritizing speed over perceived perfection

Final Reflection

“Overengineering doesn’t make your system safer. It only makes you feel safer.”

Senior engineering expertise involves knowing when to remove patterns, not just when to apply them.