Back to all posts
Engineering

Server-Driven UI Done Right

Nov 3, 20256 min read

The Promise of Server-Driven UI

Server-Driven UI (SDUI) is often sold as a silver bullet: faster iteration, remote configuration, and the ability to change UI without shipping a new app version.

All of that is true.

It is also why so many SDUI systems fail.

Most failures do not come from performance issues or missing features. They come from a fundamental misunderstanding of what SDUI actually is. The hard part is not rendering JSON. The hard part is designing stable UI contracts that can evolve over time.

If you get the contract wrong, SDUI quickly turns into an untyped, untestable, and brittle system.


Why Naïve SDUI Breaks Down

The most common SDUI implementations start with a dangerous assumption:

“If we can describe the UI in JSON, we can render anything.”

This usually leads to systems that resemble HTML-over-the-wire, except without the decades of tooling and standards that HTML benefits from.

Common Failure Modes

Naïve SDUI systems tend to:

At first, this feels powerful. Over time, it becomes impossible to reason about, change safely, or refactor.

Flexibility without constraints is not power-it is technical debt.


SDUI Is a Contract, Not a Renderer

The key mental shift is simple but non-negotiable:

SDUI is a contract between server and client.

The renderer is the easy part. The contract defines:

Once you frame SDUI as a contract, most design decisions become clearer.


Think in Primitives, Not Screens

The fastest way to break SDUI is to model “screens” or “pages”.

Screens are:

Instead, SDUI should be built on primitives.

Typical primitives include:

These primitives form a shared vocabulary. Meaning emerges from composition, not from specialized components.

If a primitive needs to change, you update it in one place. If a screen changes, you recombine primitives instead of inventing new ones.


Schema First, UI Second

A good SDUI system is schema-driven.

Schemas should answer very explicit questions:

Type safety is not an enhancement in SDUI. It is survival.

Without schemas:

With schemas:

The schema is the product of SDUI, not the JSON payload.


Where SDUI Actually Shines

SDUI is not a universal solution. It excels in specific areas:

These are places where structure is stable but composition changes frequently. SDUI allows iteration without redeploying clients while keeping rendering predictable.

Trying to drive every pixel of your app through SDUI is usually a mistake.


Designing for Evolution

The best SDUI systems assume change.

A good contract supports this gracefully.

Backward compatibility, defaults, and validation are not afterthoughts-they are core design requirements.


Key Takeaways

Aadarsh Srivastava

Written by Aadarsh Srivastava

Sr. Software Engineer at MakeMyTrip. Building high-performance web applications and sharing learnings along the way.