Inspiration

Live trivia (HQ Trivia / Kahoot) is the perfect stress test for global scale: massive concurrent writes on every answer, real-time leaderboard reads, and players everywhere. We wanted to prove a data model that actually survives millions of concurrent players — not just claim it.

What it does

Thousands of players join a live room, questions broadcast to everyone at the same instant, and players answer against a timer (faster correct answers earn more points). A global leaderboard updates live. The headline is the data model: a deliberate DynamoDB single-table design with documented access patterns, a write-sharded leaderboard that scatters each room's answer firehose across N partitions and gathers the top-K on read, and a correct atomic-then-index scoring flow that can't lose or corrupt scores under concurrency.

How we built it

Next.js + TypeScript + Tailwind on Vercel. Amazon DynamoDB single-table design with GSIs for the per-room (sharded) leaderboard and the seasonal ranking, using a zero-padded score sort key so DynamoDB orders leaderboards correctly as strings. DynamoDB Streams trigger a Lambda aggregator for fan-out. Global Tables provide active-active multi-region replication for low-latency reads worldwide. A "Scale" dashboard visualizes the even write-shard distribution as proof the design doesn't hot-spot.

Challenges we ran into

The naive approach hot-spots a single partition per room and corrupts leaderboard order under concurrent writes. We fixed the score write to be an atomic increment first, then index from the true cumulative total, and sharded the leaderboard writes to remove the hot partition.

Accomplishments that we're proud of

A leaderboard that stays single-digit-millisecond under a write storm because the hot-partition problem is actually solved — and a Scale page that shows it.

What we learned

At millions of writes, your partition-key strategy is your architecture; scatter-gather and correct atomic ordering are the difference between a demo and a system.

What's next for PulseRooms

API Gateway WebSockets for AWS-native realtime fan-out, a load-test artifact (k6) with CloudWatch no-throttle graphs, and seasonal tournaments.

Built With

Share this project:

Updates