Feature flag service inspired by LaunchDarkly and Unleash: flag rules live in a database, apps read them from a cache or the CDN edge, and changes are pushed out in the background with an audit trail.
See why querying the database for every flag check does not scale.
What was missing: A flag check should not need a database query.
Why that's risky: Flags change a few times a day but are read 10K times a second, so the database spends its capacity re-reading data that almost never changes, and a database blip breaks every app that depends on flags.
What gets added: One server that queries the database for every flag check and saves flag changes.
Trade-offs: Always fresh, but flag availability becomes database availability.
Separate reads from changes and serve reads from memory.
What was missing: Reads and changes share one path and every check hits the database.
Why that's risky: After a change the cache can serve the old rule until refreshed, and a mass expiry can stampede the database.
What gets added: A read service answers from a cache of flag rules and refills it from the database on a miss; a separate admin service writes changes.
Trade-offs: A few seconds of staleness is fine for a gradual rollout, but not for an emergency kill switch.
Serve flag snapshots from the edge so a restart storm never reaches origin.
What was missing: Every instance still calls our servers, and a release that restarts thousands of instances sends them all at once.
Why that's risky: An edge copy lives until its TTL ends or it is purged, so a kill switch needs a short TTL or an explicit purge.
What gets added: A CDN serves each environment's flag snapshot from the edge so SDKs fetch it without reaching our servers.
Trade-offs: A long TTL means less origin load but a slower kill switch. Services such as LaunchDarkly keep a streaming connection open to each SDK and push changes, using the CDN only for the first download.
Push changes out in the background and keep an audit trail.
What was missing: Changes are not published, nothing is audited and anyone can flood the admin.
Why that's risky: Without an audit trail you cannot answer 'who turned that off?' during an incident.
What gets added: A change queue and publish workers that refresh the cache, purge the CDN snapshot, push the change to connected SDKs over a streaming connection and write an audit record; an audit database and an admin rate limiter.
Trade-offs: Publishing is asynchronous, so a flip reaches SDKs in about a second instead of inside the admin request, in exchange for never blocking the admin.
You're in the middle of an interview session. Leaving now will end your current attempt.
Explore concept overviews, real-system examples, key tradeoffs, and interview talking points for each roadmap section.
You've conquered this phase. These are the skills you now own: