Database guides
Queries, indexes, transactions and data modelling.
45 guides · Newest first · Updated
- Shopping Cart System Design: Guest Merges, Price Changes and Stock HoldsGuest cart merges on login, price and stock changes, short stock holds and reminder jobs. One festive fashion sale runs through it.System design · 23 min read ·
- Postgres Full Text Search: Ranking, Typo Matching and When Elasticsearch WinsTsvector and tsquery, GIN indexes, ranking, pg_trgm for typos and the limits that call for a search engine.Backend · 18 min read ·
- Coupon System Design: Single-Use Codes, Stacking Rules and AbuseUnguessable codes, single-use redemption that survives concurrent requests, stacking rules and coupon farming.System design · 19 min read ·
- N+1 Query Problem Explained: Lazy Loading, Eager Loading and DataLoaderWhy ORMs send one query per row, how to spot it in query logs, and how joins, eager loading and DataLoader fix it.Backend · 19 min read ·
- Geofencing System Design: Matching Moving Phones Against Millions of FencesCell and R-tree indexes, exact point-in-polygon checks, enter, exit and dwell events, hysteresis and battery-aware phones.System design · 22 min read ·
- Contextual Retrieval Explained: Chunk Context, Index Cost and RecallWhy chunks lose meaning when split, how a short context line helps BM25 and embedding search, what it costs at index time and which cheaper fixes to try first.AI and GenAI · 24 min read ·
- Auction System Design: Proxy Bids, Anti-Sniping and a Consistent Top BidProxy bids and increments, bid storms near the close, anti-sniping soft close, race-free top bids in PostgreSQL and Redis, and safe closing.System design · 30 min read ·
- Facebook TAO Explained: Objects, Associations and Leader-Follower CachingHow objects and associations model the social graph, how leader and follower cache tiers sit over sharded MySQL and what eventual consistency cost.System design · 26 min read ·
- Inngest's October 2026 Outages Explained: When Deadlines Drained the PoolWhy short query deadlines made PgBouncer destroy database connections faster than it could replace them.Backend · 19 min read ·
- Classifieds Marketplace System Design: Expiry, Geo Search and Scam ChecksListing lifecycle and expiry, nearby search with PostGIS and Redis, search index sync, duplicate and scam checks, seller ratings and paid boosts.System design · 26 min read ·
- DuckDB Agent Mode Explained: How the CLI Detects and Adapts to AI AgentsHow the command-line tool spots an AI coding agent, what it prints instead, what DuckDB's own test saved, and how to copy the idea.AI and GenAI · 20 min read ·
- Columnar Databases Explained: Why Analytics Queries Read Less DataColumn storage, dictionary and run-length compression, row groups with min-max statistics, vectorised execution and why single-row writes are slow.System design · 21 min read ·
- Postgres Job Queue: SKIP LOCKED, Leases, Retries and When to SwitchClaiming jobs with FOR UPDATE SKIP LOCKED, leases for crashed workers, retries and dead jobs, LISTEN/NOTIFY, indexes and vacuum.Backend · 21 min read ·
- Redis 8.0 End of Life Explained: How to Upgrade to 8.2 Before 1 December 2026Why only 8.0 ends on 1 December 2026, Standard vs Extended releases and how to upgrade to 8.2.Backend · 23 min read ·
- LangGraph's October 2026 Namespace Flaw Explained: Why Dot-Joined Keys CollideWhy dot-joined namespaces collided, which versions fix it and how to check.AI and GenAI · 18 min read ·
- Pandas 3.1 Explained: Inplace Deprecation, Select, Filter and Faster CSV ReadsWhy inplace is deprecated and how to migrate, the new select and filter tools, faster read_csv and the date unit change.Backend · 19 min read ·
- Pgvector vs Vector Database: When Postgres Is Enough and When to SwitchRecall, filters, memory and write cost measured on 100,000 vectors.AI and GenAI · 24 min read ·
- Presence System Design: Heartbeats, Last Seen, Fan-Out and PrivacyHeartbeats and TTL keys for online status, last seen without a write storm, contact fan-out and privacy rules.System design · 25 min read ·
- Redis Internals Explained: Event Loop, RDB vs AOF and EvictionThe single-threaded event loop, what blocks the server, RDB and AOF persistence, fork and eviction.Backend · 24 min read ·
- AWS US-EAST-1 Outage (October 2025) Explained: How a DNS Race Broke DynamoDBHow a DNS automation race emptied DynamoDB's record and how EC2 and load balancers followed.System design · 21 min read ·
- Database Indexes Explained: B-Trees, Composite Keys and Write CostsHow a B-tree finds a row, how to order composite index columns, covering indexes, selectivity and what each index costs on writes.Backend · 24 min read ·
- Postgres MVCC Explained: Row Versions, Dead Tuples and VACUUMRow versions with xmin and xmax, snapshots, dead tuples, VACUUM, autovacuum and wraparound.System design · 21 min read ·
- Text to SQL Explained: Schema Context, Read-Only Roles and SQL ChecksSchema context, read-only database roles, parser checks, timeouts, row limits and result-based tests.AI and GenAI · 26 min read ·
- Design Distributed Search: Inverted Indexes and ShardsHow an inverted index works, and how shards, replicas and a coordinator spread search across machines, built on one running marketplace example.System design · 25 min read ·