A ticket drop, seen from the frontend
When thousands of people hit 'buy' at the same second, the browser can't fix the problem, but it can decide whether the experience is fair or frightening.
On this page
Zoniq is built around a specific, slightly painful moment: a popular event's tickets go on sale, and a huge number of people try to buy at the same instant. Anyone who's tried to book a big concert knows how that usually goes. The page freezes, you refresh, you lose your place, and then the tickets are gone and some of them reappear on resale sites at triple the price.
I lead the frontend and the web and mobile apps at Zoniq. I want to write down how I think about the frontend's part in this, because it's smaller than people assume, and more important than it looks.
The browser can't stop a crowd
Let me be clear about what the frontend does not do. It doesn't decide who gets a ticket. It can't stop bots, because anything that runs in the browser can be copied or skipped by someone determined enough. The queue, the fairness rules, the checks against scalpers, all of that has to live on the server, where the user can't change it.
I've seen people try to put "protection" into client-side code, like hiding a button or checking a flag. It feels like security. It isn't. The client is a polite request, and the server is the one that decides.
So what is the frontend for?
Its job is to make a stressful situation understandable. The user is anxious. They think the whole thing might crash and they might lose their chance. A calm, honest interface changes how that feels, and it also changes how people behave.
If the screen tells you "you're in the queue, here's roughly what's happening", people wait. If it shows a spinner with no explanation, people refresh. And refreshing, from thousands of browsers at once, is exactly what makes the load worse. So a clear waiting screen is a load-control tool, not just a nicety.
Honest states, always
Every state needs a truthful message: waiting, being let in, ticket held for you, hold expired, sold out, something went wrong. The worst thing you can do is show a state that isn't true, like a button that looks clickable but fails, or a "success" before the server has actually confirmed.
When a hold on a ticket is about to expire, show the time. When the server's slow, say it's slow. It sounds trivial, and in this setting it's most of the experience.
Don't make the browser the bottleneck
On the day, we don't want the frontend adding to the problem. That means small bundles and fast first load, so people aren't waiting on our JavaScript. It means being careful with how often the app polls the server, because thousands of clients polling every second adds up fast. And it means handling retries politely, backing off instead of hammering.
Mobile matters just as much, honestly more. A lot of buyers are on a phone, on whatever connection they happen to have, in a crowd. The React Native app has to behave sensibly when the network is bad, which brings me back to being honest about what's happening.
Fair is a feeling as well as a rule
The server can be perfectly fair and the experience can still feel unfair if people can't see it. Part of my job is making the fairness visible, so that someone who didn't get a ticket at least understands why, and trusts that nobody cut in line. That trust is what the product is selling, really.
I'm sure I'll look back on some of my current thinking and cringe. But the core point has stuck so far: the frontend can't win the fight against load or bots, but it decides whether people feel treated well while it's being fought.
Enjoyed this? Pass it on
Written by Vishwajit Bhosle
I build and lead web and mobile products from Pune, and write about what I run into along the way. If something here helped, or you have a project in mind, say hello.
Follow along
New posts show up in any feed reader the moment they are published: no account, no email, no tracking.
Comments
Anyone can comment, no sign-up. Upvote what helped, reply to anyone. I read all of them and reply where I can.
Loading comments…