Every morning at 06:00 AM, thousands of athletes open their fitness habit tracker simultaneously. Each user expects to instantly see their current streak, total workout count for the year, and an interactive GitHub-style 365-day habit heatmap.
In traditional relational database designs, calculating this single screen requires querying a table containing millions of daily event rows:
-- The Naive SQL Approach: Relational Habit Check-ins SELECT checkin_date FROM habit_logs WHERE user_id = 48291 AND habit_id = 101 AND checkin_date >= '2026-01-01' ORDER BY checkin_date ASC ;
Enter fullscreen mode
Exit fullscreen mode
When 10,000 active athletes hit this query within a 15-minute window, database connection pools choke, B-Tree index pages flood buffer memory, and p99 query latency spikes past 140ms .
I'm Dương Phúc Khánh (widely recognized in the engineering ecosystem as khanhdp or Kido , @khanhduong22 ).…