Tech, ExplainedGaming, streaming and media
Part

Seat selection and reservation

Which seats are free, held for minutes.

INSIDE: ONLINE TICKETING PLATFORM7:02:15 pm: twobuyers tap seat G12in the same secondThe first requestarrives a fewmillisecondsearlier: G12 changesfrom free to held,until 7:10:15The second requestfinds G12 held and isrefused; that buyerpicks G13The first buyer pays₹650 by UPI throughthe payment gateway7:04:40 pm: paymentconfirmed; G12changes from held tosold, and the ticketis issuedPaid in timeSeat sold, ticket issuedNot paid by 7:10:15Seat becomes free again↓ If payment is confirmedafter the hold has expired,the buyer is offeredanother seat or refunded.ALSO TALKS TOPayment gateway↗ ONLINE PAYMENTSINSIDE: ONLINE TICKETING PLATFORM7:02:15 pm: twobuyers tap seat G12in the same secondThe first requestarrives a fewmillisecondsearlier: G12 changesfrom free to held,until 7:10:15The second requestfinds G12 held and isrefused; that buyerpicks G13The first buyer pays₹650 by UPI throughthe payment gateway7:04:40 pm: paymentconfirmed; G12changes from held tosold, and the ticketis issuedPaid in timeSeat sold, ticket issuedNot paid by 7:10:15Seat becomes free again↓ If payment is confirmedafter the hold has expired,the buyer is offeredanother seat or refunded.ALSO TALKS TOPayment gateway↗ ONLINE PAYMENTSINSIDE: ONLINE TICKETING PLATFORM7:02:15 pm: two buyers tap seat G12 inthe same second↓The first request arrives a fewmilliseconds earlier: G12 changes fromfree to held, until 7:10:15↓The second request finds G12 held and isrefused; that buyer picks G13↓The first buyer pays ₹650 by UPI throughthe payment gateway↓7:04:40 pm: payment confirmed; G12changes from held to sold, and the ticketis issued↓Paid in timeSeat sold, ticket issuedNot paid by 7:10:15Seat becomes free again↓ If payment is confirmed after the hold has expired, thebuyer is offered another seat or refunded.ALSO TALKS TOPayment gateway↗ ONLINE PAYMENTS
Two buyers tap the same seat at once; the first gets an 8-minute hold, the second is refused, and the hold turns into a sale when the payment is confirmed.
opens a page inside this one a page in the same scene a page in another scene a concept page a label only, with no page

Seat selection and reservation is the part of a ticketing system that shows which seats are free at this moment and locks the seats a buyer chooses for a few minutes, while the buyer pays. During those minutes, no one else can buy those seats. If the payment succeeds, the seats are sold. If it fails, or the time runs out, the seats become free again. The lock is often called a seat hold or a temporary reservation.

Why is this hard? On a busy day, two buyers may choose the same seat within the same second. If both were allowed to pay, the venue would have sold one seat twice. So every seat has a status in a database: free, held or sold. Changing a seat from free to held must be done in one indivisible step. The database checks that the seat is still free and marks it held in the same operation. If two requests arrive together, only one can succeed. The other buyer sees a message that the seat has just been taken.

Say two people in Pune both want seat G12 for a Marathi play, at ₹650. The theatre has 480 seats. At 7:02:15 in the evening, both of them tap G12 on the seat map. The first request reaches the system a few milliseconds earlier. The system marks G12 as held for that buyer, with an expiry time of 8 minutes, which is 7:10:15. The second request finds G12 already held and is refused, and the second buyer chooses G13 instead. The first buyer goes to the payment gateway and pays by UPI. At 7:04:40, the payment gateway confirms the payment. The system changes G12 from held to sold, and the ticket is issued. If the buyer had closed the app instead, G12 would have become free again at 7:10:15.

There is one awkward case. Sometimes a payment succeeds, but the confirmation reaches the ticketing system only after the hold has expired, and someone else has already bought the seat. The system must then either offer another seat or refund the money automatically. Good systems keep a record of every hold and every payment, so that no buyer pays without getting a ticket.

How long should a hold last? If it is too short, buyers who pay slowly lose their seats. If it is too long, seats sit locked by people who never pay, while others are told the show is full. Most platforms choose a few minutes. During a big sale, when demand is an example of high concurrency, the virtual waiting room lets in only as many buyers as the seat system can handle. The online ticketing platform shows the result of all this to the buyer as grey, green and selected seats.

Tech, Explained is a part of ingrid.fyi. Every page explains one piece of technology in plain words.