Leo organized shows in a club with 200 seats. He sold his tickets through a ticket service, and he was not happy with it. The service took a fee from every ticket. It also could not hold seats for his regular guests.
One evening he called Maya. They had been friends since school, and she was the only developer he knew.
“Can you build me a ticket page of my own?” he asked. “The next show is in six weeks.”
Maya wrote code every day at work. She fixed bugs and added small features to a large product. She had never built a whole app alone, from the first file to the last.
“Yes,” she said. “I can do that.”
That night she made an empty folder and named it tinytickets. Then she looked at it for a long time. A ticket page needed a server, a database, a login and a way to take money. She did not know which part came first.
It took her all six weeks. She built the app from that empty folder, one part at a time, and put it online. First came a single page, then a database, then a login and the payment. Last came a rented server, an address that people could type, and a backup.
Leo sat beside her and tested every page. He found more problems than she liked, and she fixed them all. Two days before the show, he sent the link to his guests. They bought their tickets on the new page, and the show sold out.
So did the next show, and the one after it. For a year, TinyTickets ran on one small server and gave Maya very little trouble.
Then Leo booked a small festival with 3,000 tickets. The sale opened at 10:00. By the evening, 2,000 tickets were sold. At about 21:00, Leo called.
“People say they paid, but the page shows an error,” he said. “And they have no ticket.”
Maya opened the logs. She wrote down what she saw before she guessed at a cause. Every failed order stopped at the same step, the confirmation email. The email service that TinyTickets used was failing that night.
The Buy page sent the email while the buyer waited. When the email service was slow, the buyer waited too. When it failed, the whole order looked failed, although the payment had succeeded. One small task at the end of the order was able to break the sale.
Maya sent the missing tickets by hand until two in the morning. In the weeks after the festival, she moved the email and every other slow task into a queue. A worker ran each task in the background and tried again when a task failed. A buyer’s order no longer waited for an email.
The festival came back the next year, and other organizers heard about it. By the third year, several of them sold tickets for their own shows on TinyTickets. Maya could not do all the work alone, so two developers joined her, Nina and Omar.
In their first week, Leo asked for a small change. He wanted to hold ten seats longer for his regular guests.
Omar searched the code for the word “hold”. He found nothing. He found “reservation”, “lock” and “pending order”.
“Which one of these is a hold?” he asked.
Maya started to answer, and then she stopped. In one file, a reservation was a seat kept for a guest. In another file, it was a ticket that a buyer had not paid for yet. She had written both files, a year apart.
Nina had the same trouble with refunds. Leo talked about shows, holds and refunds. The code talked about rows, flags and status numbers. After three years, the code and the business used different words, and only Maya could translate.
The three of them spent most of that year reorganizing the code around the words and rules of the business. When Leo said “hold”, the code now said “hold”. Nina and Omar could change a rule without asking Maya what it meant.
The code was in good order. The server was the same one as before, with two CPU cores and 4 GB of RAM. That had always been enough.
Then Leo booked an arena with 15,000 seats.
On Friday at 10:00, tickets for the arena show went on sale. Every buyer arrived in the same minute. By 10:01, the Buy page took 20 seconds to load. Maya opened the server dashboard. The CPU was at 100%.
“Is it broken?” Leo wrote.
“It is answering,” Maya wrote back. “Only very slowly.”
Buyers gave up and tried again, and each new try added more load. Nina and Omar looked for slow code and found none. One small server could not keep up with that many buyers at once. And Leo had already planned a stadium show with 60,000 seats for the end of the year.
The team had eight months. In that time they grew one server into a system of many parts. They added each part only when a real problem made it necessary, and each new part brought a new weak point with it. They also studied two large changes, decided “not yet” for both, and wrote down why.
The stadium sale opened on a Friday at 10:00. All 60,000 tickets were sold, and TinyTickets kept working through the whole morning. Leo sent a photo of an empty error log. Nobody on the team had seen him do that before.
Then came a quiet month. No big show went on sale, and few buyers visited the site.
At the end of that month, Maya opened the hosting bill. She read it twice. Then she called Leo.
“We paid more for servers this month than we earned,” she said.
“But almost nobody bought a ticket this month,” Leo said. “What were the servers doing?”
Maya did not know. Every part had been added for a sale day. Every part was still running at full size, on days with almost no buyers.
She started where she always started, by writing down what she saw. Then the team began to measure what each part cost and what it did, and to cut the largest costs first.
The story goes on from here. New parts are added when new courses are published.