Design a Feature Preview Environment

Medium45 min
1 / 30
System design answer

Design a Feature Preview Environment

Medium45 min30 sections
understanding•10 min read

Problem Statement: Beyond Feature Flags and Canary Deployments

Frames the feature preview environment as a distinct system that combines targeted routing, isolated configuration, session persistence, and automated lifecycle management.

Problem statement

Design a Feature Preview Environment platform that allows specific users or groups to interact with unreleased features in a near-production setting, behind a special routing path, without affecting the general user population. The system must activate preview mode for authorized users, route their traffic to preview configurations, maintain session coherence across requests, log every preview interaction for audit, and automatically tear down or revert preview configurations after a defined period.

This is not simply a feature flag toggle. A feature flag flips a boolean in code. A canary deployment shifts a percentage of traffic to a new version. A feature preview environment is fundamentally different: it creates a user-scoped, time-bounded, isolated view of the application where a specific subset of users sees and interacts with pre-release features while the rest of the population remains unaffected.

Why this problem is distinctive

Standard canary analysis answers "is the new version stable at 5% traffic?" Feature flags answer "should this code path execute for this user?" A preview environment answers a harder question: "Can we give a product manager, a beta tester, or a customer success rep a full interactive experience of an unreleased feature, with realistic data, in a production-fidelity setting, for exactly 72 hours, and then cleanly revert everything?"

The attached brief specifies four functional requirements that standard approaches skip: dynamic routing via session cookies for preview mode, potentially separate cluster or config per preview, auditing logs to track who tested what, and automatic tear-down after a set time. These combine into a system that sits at the intersection of traffic management, configuration orchestration, identity and access control, and lifecycle automation.

The five architectural planes

  1. Routing plane: Intercepts requests, inspects preview credentials, and directs traffic to the correct feature variant without disrupting normal flow.
  2. Session plane: Maintains preview state across requests using signed cookies, ensuring a user in preview mode consistently sees the preview experience.
  3. Configuration plane: Stores, versions, and distributes preview-specific feature configurations independently of the production baseline.
  4. Lifecycle plane: Provisions preview environments on demand, enforces time-to-live, and executes automated tear-down or reversion.
  5. Observability plane: Captures who accessed which preview, what actions they took, what feedback they provided, and what errors occurred.

A strong interview answer separates these planes. The routing plane must never block production traffic. The session plane must not leak preview state to unauthorized users. The lifecycle plane must guarantee tear-down even if the provisioning service crashes. The observability plane must capture interactions without adding latency to the preview experience.

Public operating baseline

LaunchDarkly reports serving over 30 trillion feature flag evaluations per day across thousands of customers, demonstrating that targeted feature delivery operates at extreme scale. Vercel's Preview Deployments generate a unique URL for every pull request, processing millions of deployments monthly for over one million developers. Netflix uses Spinnaker for canary analysis across its 247 million subscriber base. Microsoft's Windows Insider Program uses ring-based "flights" to progressively expose features to opted-in users across multiple tiers.

For capacity planning, this answer explicitly assumes a mid-size SaaS platform with 5 million monthly active users, 200 concurrent preview environments, 10,000 authorized preview users, 50 features in active preview, and a 5x event peak during product launch weeks. Unless a number is tied to a citation, it is a stated design assumption.

Key Highlights

  • •A preview environment creates a user-scoped, time-bounded, isolated application view—not a simple flag toggle.
  • •The system has five planes: routing, session, configuration, lifecycle, and observability.
  • •LaunchDarkly processes 30+ trillion flag evaluations per day, proving targeted delivery operates at massive scale.
  • •Every uncited scale number in this answer is an explicit design assumption for a mid-size SaaS platform.
  • •The routing plane must never block or degrade production traffic for non-preview users.
Lead With the Distinction
In the first two minutes, explicitly state how a preview environment differs from feature flags and canary deployments. Feature flags toggle code paths. Canaries shift traffic percentages. Preview environments create user-scoped, time-bounded, isolated application views. This instantly shows depth.
Do Not Conflate With Feature Flags
A candidate who says 'just use LaunchDarkly with targeting rules' misses the session coherence, isolated configuration, automatic tear-down, and audit requirements that make this a distinct system. Feature flags are one input to the preview platform, not the platform itself.

Section Rescue Kit

Buzzwords to use:

Preview Isolation BoundaryTime-Bounded Preview

Safe statements:

  • "I will separate preview routing from production routing to ensure zero impact on general users."
  • "Before choosing technologies, let me define which decisions belong to the routing plane, session plane, configuration plane, lifecycle plane, and observability plane."
Design a Feature Preview Environment - System Design | WinJob | WinJob