Building for scale from day one

Most apps aren’t slow because of one big mistake — they’re slow because of a hundred small ones that only show up under load. Here’s how we think about scale before it becomes a problem.
Start with the user journey
You can’t optimize what you can’t see. Instrument the whole journey first: first touch, activation, and every step in between. Accurate data up front beats clever guesses later.
Push work to the edge of the request
Resolve as much as possible during server rendering:
- Read identity and feature flags once, on the server.
- Render the correct variant immediately — no client-side flicker.
- Hydrate with the exact same state the server used.
Measure, then decide
const flags = await evaluateFlags(distinctId);
if (flags.isEnabled('new-checkout')) {
// ship the fast path
} Scale isn’t a feature you add at the end. It’s a series of small, boring decisions you make early — and then never have to revisit.