Notes
Engineering notes, plainly written.
Short explainers on the parts of a product that break first: tenancy, queues, caching, billing.
28 notes
FeaturedData
Multi-tenancy
How I keep one tenant out of another tenant data: tenant keys, row-level security and composite foreign keys.
Read noteLoad balancer
How I spread traffic across app instances: strategies, health checks, and why the app tier has to stay stateless.
Read noteCaching
Cache-aside, TTLs and the four ways to invalidate. What a cache buys, what it costs, and when I would not add one.
Read noteMessage queues
Taking work out of the request: queues, retries, outboxes and the pg-boss choice I made in IMS and the outbox I designed for POS.
Read noteFailover
What failed means, automatic versus manual switching, and why an untested failover path is only a hope. Includes my POS design notes.
Read noteIdempotency
How an idempotency key stops a retry from charging twice, where duplicates come from, and the open question in my POS fiscal design.
Read noteDNS
How a name becomes an address, what the common records do, and why TTL is the setting I check before any migration.
Read noteCDN
Serving static files from an edge near the user: what a CDN caches, how it pairs with object storage, and when it adds nothing.
Read noteRate limiting
How I think about request limits: what they protect, why the counters must be shared, and which endpoints get one first.
Read noteAPI gateway
One front door for several backend services: what a gateway can centralise, and why a monolith usually does not need one.
Read noteStateless architecture
Why any server instance should be able to answer any request, where state goes instead, and what a JWT does not fix.
Read noteHorizontal scaling
Adding machines instead of a bigger machine: what it requires, what it costs, and why I do not reach for it early.
Read noteAuthentication
Sessions, argon2id, OIDC and TOTP: the defaults I use for a multi-tenant web app, and what I never build myself.
Read noteFeature flags
Runtime switches that separate deploying code from releasing it: the four kinds of flag, per-tenant rollout, and flag debt.
Read noteDatabases
Choosing a database from access patterns instead of product names: SQL versus NoSQL, indexes, and the scaling path before sharding.
Read noteRead replicas
Copies of the primary that serve reads: when they help, what replication lag does, and why a replica is not a backup.
Read noteObject storage
Keeping files outside the database: metadata in rows, bytes in storage, and temporary access through signed links.
Read noteBackups
Why replication is not a backup: backup types, recovery objectives, restore tests, and where disaster recovery starts.
Read noteAsynchronous processing
Taking work off the request path: queues, workers, schedules, and the retry and idempotency rules that come with them.
Read noteWebhooks
Receiving and sending HTTP callbacks safely: signature checks on the raw body, an inbox, dedupe, fast 2xx and retries.
Read notePayments and billing
Letting a provider hold the money while the app keeps entitlements in sync: webhooks, idempotency keys, metering and reconciliation.
Read noteLLM integration
Treating a language model as a slow, costly, non-deterministic dependency: one gateway module, timeouts, token budgets, injection and evals.
Read noteRAG
Retrieval before generation: chunking, embeddings, hybrid search, reranking, citations, and what to do when retrieval finds nothing.
Read noteObservability
Logs, metrics and traces as three questions, why percentiles beat averages, and a short checklist of what a service must tell you.
Read noteLogging
Structured logs with correlation ids, sensible levels, and the things that must never be logged.
Read noteMetrics
Request rate, error rate, latency percentiles and saturation: the four signals, and why the average hides the slow requests.
Read noteDistributed tracing
Following one request across services to see where the time went, and why a single-service app usually does not need it yet.
Read noteProduction architecture
What separates a system running for real users from a demo: environments, deploys, monitoring, backups, secrets and a readiness checklist.
Read note