MySQL
10 posts
Design Problem: A Distributed Scheduler, Where a Million Delayed Tasks Must Each Run Only Once, at the Right Time
System Design series Part 9-7: delayed tasks like payment deadlines and reminders: SKIP LOCKED, leases and claim IDs, retries, jitter, missed runs, and a threat model.
Distributed IDs: UUIDv7, Snowflake, and Segment Allocation, Compared on Order, Size, and What They Leak
System Design series Part 4-4: a simulation of random vs time-ordered keys in a B+Tree, UUIDv7 vs Snowflake vs segment allocation, and what public IDs leak.
Full-Text Search and Inverted Indexes: Chinese Tokenization, BM25 Ranking, Index Sync, and the Authorization Boundary of Search
System Design series Part 3-7: beyond LIKE, an inverted index with Chinese bigram traps and BM25, MySQL FULLTEXT vs Elasticsearch, index sync, and search authorization.
Geohash and Geospatial Indexes: Cell Boundaries in Nearby Search, Redis GEO, and How Distance Leaks Location
System Design series Part 3-8: Geohash makes coordinates searchable by a B+Tree; cell boundaries, 9-cell queries, Redis GEO vs MySQL SPATIAL vs H3, and trilateration.
Indexes and B+Trees: From Disk Pages to Composite Indexes, Index-Defeating Queries, and Keyset Pagination
System Design series Part 3-2: why three B+Tree levels hold 100M rows, clustered vs secondary indexes, leftmost prefixes, index-defeating SQL, write costs, keyset paging.
Redundancy, Failover, and Disaster Recovery: From Availability Numbers to Restore Drills
System Design series Part 6-1: availability math, RPO, and RTO for redundancy; the four failover steps; why replication is not a backup; restore drills and ransomware.
Replication and Replication Lag: Why Users Cannot Read What They Just Wrote After Read/Write Splitting
System Design series Part 4-1: simulating four read routings under lag spikes, Spring read/write splitting, read-your-writes with GTIDs, and stale permission checks.
Sharding: Choosing a Shard Key, Moving Data When You Reshard, and What You Lose Across Shards
System Design series Part 4-2: shard key skew, resharding cost, and fan-out latency simulated; sign-ups sharded by talk in Spring with an outbox index; tenant isolation.
SQL vs NoSQL: Choose a Database by Access Pattern, Not by Buzzword
System Design series Part 3-1: the trade-offs of five data models, why NoSQL is fast and what it costs, and MySQL JSON columns and partitioning to delay a new database.
Transactions and Isolation Levels: MVCC, Lost Updates, Write Skew, and Spring Transaction Boundaries
System Design series Part 3-4: lost update and write skew in sign-ups; conditional UPDATE, locks, unique constraints; isolation levels by database; Spring transactions.