← Back to Blog

Feature Flags vs Server-Driven UI: When to Use Each

Both feature flags and server-driven UI help you update mobile apps without releases. But they solve different problems. Here's how to choose the right tool for your needs.

The Quick Comparison

Capability Feature Flags Server-Driven UI
Toggle existing features ✓ Built for this ✓ Possible
Change UI layout ✗ No ✓ Full control
Add new UI components ✗ Requires app update ✓ Server-side
A/B test copy changes ✓ Via remote config ✓ Native support
A/B test layout changes ✗ Needs coded variants ✓ Any layout
Implementation effort ✓ Low Medium-High
Update old app versions Limited (flag values only) ✓ Full UI changes

Feature Flags: The Basics

Feature flags (also called feature toggles) control whether a feature is enabled or disabled. They're typically boolean values, but can also be strings, numbers, or JSON for remote configuration.

Common feature flag use cases:

Popular tools: LaunchDarkly, Statsig, Optimizely, Firebase Remote Config, PostHog

⚠️ The Limitation
Feature flags can only toggle code that's already in the app. If you need to show a completely new screen layout, you need to ship that code first.

Server-Driven UI: The Basics

Server-Driven UI (SDUI) goes beyond flags. The server defines the entire UI structure — layouts, components, styling, and behavior — and the client renders it dynamically.

With SDUI, you can:

Companies using SDUI: Airbnb, Netflix, Lyft, DoorDash, Uber, Shopify

When to Use Each

🚦 Rolling out a new feature gradually

You've built a new checkout flow and want to release it to 5% of users first, then ramp up.

Recommendation
Feature Flags ✓
🎨 Testing a completely different homepage layout

Your PM wants to test a hero banner vs. a grid layout, but neither is coded yet.

Recommendation
Server-Driven UI ✓
💬 Changing button text for an A/B test

You want to test "Buy Now" vs. "Add to Cart" without a release.

Recommendation
Either works — Feature Flags is simpler
🏷️ Adding a promotional banner for a sale

Marketing wants a time-limited banner on the home screen. You don't have a banner component coded.

Recommendation
Server-Driven UI ✓
🐛 Disabling a broken feature immediately

Your new feature has a critical bug. You need to turn it off NOW.

Recommendation
Feature Flags ✓
👥 Showing different onboarding flows per user type

New users see an educational flow, returning users see quick start, enterprise sees admin setup.

Recommendation
Server-Driven UI ✓

The Power of Using Both Together

Feature flags and SDUI aren't mutually exclusive — they're complementary. Here's how mature teams use them together:

Pattern 1: Feature Flag Gates SDUI Screens

Use a feature flag to control whether a user sees the legacy (hardcoded) screen or the new SDUI-powered screen. This lets you gradually roll out SDUI without risk.

Pattern 2: SDUI with Live Values

Your SDUI layout references feature flag values. The server sends a layout that includes {{flags.showPromo}}, and the client resolves it at render time.

Pattern 3: Automatic Exposure Tracking

When SDUI renders a component tied to an experiment, it automatically logs exposure events. This is how companies like Airbnb run experiments without manual instrumentation.

Get both in one SDK

Pyramid combines server-driven UI with Live Values (feature flags) in a single, integrated SDK. Run experiments with automatic exposure tracking built-in.

Learn More →

The Decision Framework

Ask yourself these questions:

  1. Do I need to change UI layout or just values?
    Values → Feature Flags. Layout → SDUI.
  2. Is the code already in the app?
    Yes → Feature Flags can toggle it. No → SDUI can deliver it.
  3. How often do I need to change this?
    Occasionally → Feature Flags are simpler. Frequently → SDUI scales better.
  4. Do I need to update users on old app versions?
    If the feature isn't coded → Only SDUI can help.

Conclusion

Feature flags are the scalpel — precise, simple, and perfect for toggles and gradual rollouts. Server-Driven UI is the Swiss Army knife — powerful, flexible, and capable of transforming your entire mobile experience without app updates.

Most mature mobile teams use both. Start with feature flags for quick wins, then adopt SDUI for screens where you need maximum flexibility.