EngineeringHow Trophy Aggregates Over 30 Million Streaks in ClickHouse
How we power our analytics dashboards with ClickHouse querying over 100M+ rows with 100ms latency.
Jason LouroBehind the scenes on how we do dev at Trophy
EngineeringHow we power our analytics dashboards with ClickHouse querying over 100M+ rows with 100ms latency.
Jason Louro
Users will find ways to game your points system. Rate limiting and anomaly detection are partial defenses. Idempotent event tracking is the architectural solution — here's why, and how Trophy implements it

Every gamification feature has known technical problems. The harder problem is designing a data model where those features can talk to each other — and where the features you'll want later don't require a rebuild.

Naive UTC-based streak logic breaks for users in non-UTC timezones and fails silently twice a year on DST transitions. Here's the correct implementation, with code.
EngineeringFirebase solves XP sync by treating it as a data problem. There's a better model — server-authoritative XP that any device reads from a single source of truth.
Read more →
EngineeringRedis ranking is fast and correct. Segmentation, resets, and durability are the hard parts. Here's the full production architecture — and where Trophy fits.
Read more →
EngineeringWe built calculators based on common questions we hear from customers with an emphasis on shareability, performance and auditability. Here's how we did it.
Read more →
EngineeringTime zones break gamification features in subtle ways. A user in Tokyo and a user in New York can't fairly compete on daily goals without careful handling.
Read more →
Migration and EvolutionBuilding gamification that works at 1,000 users is different from building for 100,000. Here's what changes and why.
Read more →
EngineeringRead about how we built our email-builder. Hear the difficulties and successes we had + lessons learned.
Read more →
EngineeringLearn how we built our developer docs site at Trophy.
Read more →