Software Architecture

Software Architecture

Scalable systems from first principles. Architecture patterns, code quality, performance, and the craft of building software that lasts.

Application Availability: How Many Nines Do You Need?

Application Availability: How Many Nines Do You Need?

Application availability decoded honestly: what 99%, 99.9%, 99.95%, 99.99%, and 99.999% actually allow in downtime, the two formulas that calculate it, why every extra nine costs roughly 10x the last, how dependencies in series cap your ceiling before your effort does, and SLA/SLO/SLI/error budgets. The argument underneath it all: past four nines for most teams, the number that saves your night isn't a bigger percentage — it's how fast you recover.

·20 min readRead now
The Codebase Only AI Understands: Why 3am-Fixability Is the Metric Nobody's Tracking

The Codebase Only AI Understands: Why 3am-Fixability Is the Metric Nobody's Tracking

AI coding assistants roughly doubled code duplication while cutting refactoring in half, and experienced developers report AI tools make them slower, not faster. The fix isn't banning AI-authored code — it's gating on one question: if the person who wrote this isn't on the call, can the on-call still fix it at 3am? A concrete diagnostic, not a moral panic, with three guardrails an architect can put in place this quarter.

·13 min readRead now
Multi-Agent Architecture Is Premature Optimization With a New Name

Multi-Agent Architecture Is Premature Optimization With a New Name

Teams are reaching for planners, critics, and orchestrators before a single well-scoped agent has been pushed to its limit — the same over-engineering mistake wearing an agent diagram. A constraint-aware framework for the four costs coordination has to pay off (state handoff, failure-mode multiplication, non-deterministic debugging, cost/latency compounding) before multi-agent earns its complexity, from someone who built the orchestrator and still says most teams don't need it yet.

·15 min readRead now
Retrieval Failure vs Generation Failure: How to Diagnose Which Layer Is Killing Your RAG System

Retrieval Failure vs Generation Failure: How to Diagnose Which Layer Is Killing Your RAG System

A retrieval-augmented system that answers wrong failed in exactly one of two places — the retriever handed the model garbage, or the model had good material and still wrote garbage. They look identical from the outside and need completely different fixes. This is the diagnostic discipline that stops teams from rewriting prompts for six weeks while retrieval is quietly broken: measure retrieval on its own, then generation on its own, in that order — and fix the layer that's actually failing instead of the one that's cheapest to edit.

·14 min readRead now
I Over-Engineered a SaaS for Millions. It Got 3 Users.

I Over-Engineered a SaaS for Millions. It Got 3 Users.

I built a SaaS with multi-tenancy, event-driven architecture, and elaborate domain abstractions — for millions of users that never arrived. The product now serves two or three internal people in the same building. This is the architecture post-mortem, and the operating patterns that would have changed the outcome.

·12 min readRead now
Scaling to Millions of Users: A Real-World Architecture Teardown

Scaling to Millions of Users: A Real-World Architecture Teardown

An anonymized teardown of a consumer platform I scaled to several million users. The architecture that carried ~30K req/s at peak, the four walls we hit on the way up — database connections, a cache stampede that caused a 19-minute outage, payment double-charges, and a credential-stuffing attack that looked like organic growth — and the trade-offs behind each fix. Topology, layered caching, the data tier, WAF and rate-limiting stack, and four real ADRs. No vendor named; the engineering is exactly as it happened.

·24 min readRead now
Software Architecture Patterns: A Reference Catalog with Diagrams, Failure Modes, and Code

Software Architecture Patterns: A Reference Catalog with Diagrams, Failure Modes, and Code

A practical reference catalog of the eight architectures worth knowing — layered, modular monolith, hexagonal, event-driven, CQRS + event sourcing, microservices, serverless, and the strangler fig. Each with a diagram, the forces that make it the right call, the failure mode that makes it the wrong one, and a link to runnable reference code. Plus a decision flowchart so you pick on fit, not hype.

·18 min readRead now
Evals for LLM Features: Building the Regression Net for a Non-Deterministic Dependency

Evals for LLM Features: Building the Regression Net for a Non-Deterministic Dependency

You can't ship a reliable LLM feature on vibes. Evals are the regression net for a dependency that's non-deterministic, drifts when the provider updates the model, and fails silently. How to build one without boiling the ocean: start with 30 real examples, layer three kinds of checks (assertion, LLM-as-judge, human), measure faithfulness, and run it on every prompt, model, and retrieval change.

·11 min readRead now
LLM Architecture in Production: RAG, Vector Databases, and the 7-Point System-Design Checklist

LLM Architecture in Production: RAG, Vector Databases, and the 7-Point System-Design Checklist

Adding an LLM to your product is a distributed-systems problem with a non-deterministic dependency, not a single API call. When RAG actually helps (and when a prompt will do), how to think about vector databases and chunking without cargo-culting, the retrieval pipeline that separates demos from products, and the seven-point production checklist — evals, guardrails, cost ceilings, latency budgets, fallbacks, observability, and a human-in-the-loop boundary — to put in place before a real user touches it.

·15 min readRead now
RAG in Production: Chunking, Re-ranking, and Hybrid Search (The Deep Dive)

RAG in Production: Chunking, Re-ranking, and Hybrid Search (The Deep Dive)

Naive RAG gets you a 70%-quality demo and a plateau. The gap to production is three retrieval levers most teams never pull: chunking on structure (not character counts), hybrid search (vector + keyword), and re-ranking an over-fetched candidate set. The deep dive on each, plus citations and the metrics that tell you where retrieval is failing. Retrieval quality beats model quality.

·11 min readRead now
Event-Driven Architecture Without the Hype: When Queues Help and When They Hurt

Event-Driven Architecture Without the Hype: When Queues Help and When They Hurt

Events are a powerful tool and a terrible default. The three legitimate reasons to go event-driven, the anti-pattern that wrecks most implementations (events for request/response), the non-negotiables (idempotent consumers, dead-letter queues, versioned schemas), and choreography vs orchestration — with a decision rule so you reach for events when they earn their keep, not because a talk said microservices need a bus.

·13 min readRead now
Caching, Idempotency, and Retries: The Three Things That Break at Scale

Caching, Idempotency, and Retries: The Three Things That Break at Scale

Three patterns separate systems that survive scale from systems that get paged at 3am. Cache invalidation and the stampede problem, idempotency keys done right, and retries with exponential backoff, jitter, and circuit breakers — plus how the three fit together into one reliability story. Get them right and most of your 3am pages quietly disappear.

·12 min readRead now
Architecture Decision Records That People Actually Maintain

Architecture Decision Records That People Actually Maintain

Most architecture docs are write-once, read-never. ADRs are different because they capture the one thing that stays valuable: why a decision was made and which forces drove it. Five rules that make ADRs survive a busy team — keep them tiny, in the repo, record the forces and rejected options, write them at the right moment, and never edit a decided ADR (supersede it). Includes a minimal template.

·11 min readRead now
Multi-Tenant SaaS Architecture: Shared, Siloed, or Hybrid?

Multi-Tenant SaaS Architecture: Shared, Siloed, or Hybrid?

The tenancy model is an early, hard-to-reverse decision that touches every query you write. Shared (one DB, tenant_id per row), siloed (a DB per tenant), and hybrid (shared for the long tail, siloed for enterprise) — the isolation/cost/complexity trade-off, the data-isolation and noisy-neighbor traps, per-tenant cost visibility, and why most startups should start shared but build the routing seam to earn their way to hybrid.

·12 min readRead now
Software Architecture: The Complete Guide for Practicing Engineers

Software Architecture: The Complete Guide for Practicing Engineers

A comprehensive guide to software architecture for practicing engineers: what architecture actually is, core patterns (monolith, microservices, event-driven, DDD), making and recording good decisions, the most expensive mistakes, and how architecture changes as systems scale.

·19 min readRead now
Common Software Architecture Mistakes and How to Avoid Them

Common Software Architecture Mistakes and How to Avoid Them

The same architecture mistakes repeat everywhere — premature microservices, eventual consistency where money moves, observability and security bolted on late. Each is a right pattern at the wrong constraint. Here's how to name the condition that makes each one a mistake.

·12 min readRead now
Choosing the Right Technology Stack: A Decision Framework for CTOs

Choosing the Right Technology Stack: A Decision Framework for CTOs

A comprehensive framework for technology stack decisions. Learn how to evaluate options, avoid common pitfalls, and choose technologies that scale with your business. Updated for 2026 with TypeScript-first approaches, AI tooling considerations, and modern runtime options.

·4 min readRead now
Enterprise Architecture Principles That Actually Scale

Enterprise Architecture Principles That Actually Scale

The architectural principles that actually work in practice: design for change not perfection, treat data ownership as an architecture decision, use Conway's Law deliberately, build observability in from day one, and evolve incrementally using the Strangler Fig pattern. From leading architecture at companies scaling from 10 to 150 engineers.

·13 min readRead now