Systems

Systems thinking, with the decisions written down.

Marketing performance rests on an engineering base. Six domains mapped, gaps included, and one backend design written end to end, with every decision, assumption and open question labeled.

Six domains

What I can explain today, and what I'm learning next. The gaps are listed too.

01

Foundations

How a request travels

  • Browser, DNS lookup, IP, server: the full path of one click
  • HTTP and HTTPS in plain words: verbs, status codes, headers, TLS
  • Web server vs app server
  • Vertical vs horizontal scaling, and why horizontal wins long term

Next: TLS handshake details, HTTP/2 vs HTTP/3

02

API design

Contracts other people build on

  • Modelling resources and nested routes
  • Idempotency, and why POST needs idempotency keys
  • Versioning, validation, and auth at the gateway
  • Rate limiting as product behavior

Next: OpenAPI-first design, REST vs GraphQL

03

Databases

Where the truth lives

  • Relational schemas with real constraints
  • Indexes: what they speed up and what they slow down
  • Leader and follower replication, and the lag it introduces
  • When NoSQL actually fits

Next: Sharding strategies and hot-spot avoidance

04

Caching

The polite lie that buys speed

  • Cache-aside vs write-through
  • Redis for hot rows, a CDN for assets, object storage for files
  • Stampedes and request coalescing
  • Hit ratio as the metric that matters

Next: Consistent hashing for cache clusters

05

Big data

Moving bytes with intent

  • Logs as first-class data
  • The ETL shape: ingest, process, store, analyze
  • Batch vs stream processing
  • Message queues for things that fail independently

Next: At-least-once vs exactly-once delivery

06

Production infra

Designed for the bad day

  • Multi-region deployment, latency and blast radius
  • Load balancers, health checks, autoscaling
  • Failover and graceful degradation
  • Logs, metrics and alerts worth waking up for

Next: SLOs and chaos testing

Case study: scaling a products and orders backend

A design document, not a deployed system. It is written the way a real design doc should read: decisions, assumptions and open questions labeled.

The problem. A storefront runs a single monolith on one database. Catalog browsing is read-heavy, orders are write-sensitive, because duplicates cost money, and traffic spikes on sale days. The goal is to keep p95 catalog reads under 200 ms while making order creation exactly-once from the client's point of view.

The assumptions. About 100,000 daily users at roughly 50 product views each, so around 5 million reads a day. A read-to-write ratio near 100 to 1. A price in the catalog may be up to 60 seconds stale; checkout always reads the source of truth.

Clients
  → CDN (static assets, product images)
  → Load balancer
      ├─ Read APIs (N instances)
      │    → Redis cache-aside for hot products (target ≥80% hit ratio)
      │    → Postgres read replicas (catalog queries)
      └─ Write APIs (N instances)
           → Postgres leader (orders, checkout, always the source of truth)
                → async replication to followers
DecisionWhyTrade-off accepted
Redis cache-aside for product detailReads dominate at about 100 to 1; the cache turns most database reads into single-digit-millisecond hits.A price can be up to 60 seconds stale in the catalog. Checkout bypasses the cache, so money is never stale.
Read replicas for catalog queriesCheap horizontal read scaling that leaves the write path alone.Replication lag. Solved by pinning a user to the leader for 30 seconds after they write.
A CDN in front of images and assetsOffloads most of the bytes from the origin and helps distant users most.Image updates are eventual. Solved with versioned URLs, not cache surgery.
Idempotency keys on order creationMobile networks retry, and duplicate orders cost money and trust.One extra lookup per order, trivial against the cost of a duplicate.
Token-bucket rate limiting per API keyProtects the origin from scrapers and buggy clients before they reach the app servers.Bursty legitimate clients may see 429s. Softened with a generous burst and a retry hint.

What it defends against, and what it skips

Failure modes. A cache stampede when a hot key expires during a sale, handled by request coalescing. Leader failover, handled by promoting a follower and having order clients retry with the same idempotency key. Flash-sale traffic, handled by pre-warming the cache and autoscaling the read tier.

Metrics. Cache hit ratio, p95 and p99 per endpoint, order error rate, replication lag, and the number of healthy hosts behind the load balancer.

Deliberately not done. Database sharding. At these volumes replicas and caching are enough, and sharding adds operational complexity that can't be justified without real growth data. Saying "not yet" is part of the design.

Want someone who reads the numbers and the architecture?

I'll show you how the reporting behind this portfolio is built.