architecture Designing a Real-Time Leaderboard: Why Sorted Sets Beat a SQL ORDER BY at Scale josedacruz, September 16, 2026September 16, 2026 TL;DR: A leaderboard looks like a simple feature — sort some scores, show the top N — but a plain SQL table falls over once you have millions of players updating scores in real time. The fix isn’t a bigger database, it’s a different data structure: a sorted set (like… Continue Reading
architecture Designing a Distributed Counter: Why Global Counts Don’t Scale josedacruz, September 10, 2026September 10, 2026 TL;DR: A single database row that stores a count (likes, views, votes) works fine until enough people hit it at once — then it becomes a bottleneck that slows down or breaks your whole app. The fix isn’t a bigger database, it’s splitting the count into several pieces that get… Continue Reading
architecture Designing a Distributed Job Scheduler: Why “Just Use Cron” Doesn’t Scale josedacruz, August 26, 2026August 26, 2026 TL;DR: A single cron job looks simple until the server it lives on goes down, and “just add a second cron server” quietly turns into a duplicate-execution bug. A real distributed job scheduler needs a shared source of truth for what’s due, a way for exactly one worker to claim… Continue Reading
architecture How ‘Seen’ Receipts Actually Work: Avoiding the Write Amplification Trap josedacruz, August 9, 2026August 9, 2026 TL;DR: A “seen” checkmark looks like the simplest feature in a chat app, but the naive way to build it — storing a read flag for every message and every recipient — creates a database write explosion that gets worse as your group chats grow. The fix most real apps… Continue Reading
architecture How Instagram-Style Feeds Work: Fan-Out on Write vs. Fan-Out on Read josedacruz, August 2, 2026August 2, 2026 Imagine you’re on the backend team at a small photo-sharing app called Snapstream. Every user has a home feed: a scrolling list of photos from the people they follow, newest first. For your first 10,000 users, this is easy. For your next 10 million, it turns into one of the… Continue Reading