
Building a High Load Event Ticketing System and Preventing Scalping Using Dynamic QR Code
NETWORK CONCLUSION OF OPENING HOURS AND RAGE OF BLACK MARKET TICKETS
DUDI Software's client is a unit specializing in organizing international music festivals and large-scale sports tournaments in Vietnam. Each of their events usually gathers from 15,000 to 30,000 audiences, with the participation of top artists.
However, the partner's old online ticketing platform continuously turns each sale into a media crisis: First, the system crashes due to sudden traffic congestion. Right at 12:00 noon, more than 40,000 people reloaded the page and pressed the ticket booking button at the same time. The relational database was locked due to thousands of simultaneous reservation requests, resulting in money being deducted from customers' bank accounts but tickets not being issued, causing extreme frustration for fans. Second, the problem of speculation and fake tickets is widespread. "Ticket scalping" groups use automated tools (Bot scripts) to sweep out rows of beautiful seats in less than 2 minutes, then resell them on social networks at 3 to 5 times the price. More seriously, because the old system only sent tickets via email with a static QR code image (Static QR), many thieves took a screenshot of a ticket code and sold it to dozens of different people. When arriving at the ticket gate at the stadium, only the first person to scan the code can enter, the following buyers are refused, causing chaos and seriously damaging the reputation of the organizers.
VIRTUAL WAITING TOKEN BUCKET AND DYNAMIC QR CODE CANNOT SCREENSHOT
To completely solve the above two complex technical problems, DUDI Software has redesigned the entire platform architecture distributing electronic tickets according to the distributed computing model:
- Virtual Waiting Room: Instead of letting all users rush straight into the ticket sales database, we build an intermediate shield layer using the In-Memory Redis cache architecture. The Token Bucket algorithm is applied to queue buyers in a completely fair way in real time. The system only regulates batches of 500 users with queue tickets to the seat selection and payment page. The remaining people are kept in the waiting room with a progress bar that clearly displays the order number and estimated time remaining, 100% eliminating the risk of server crash.
- Time-based Rolling QR Code: We completely eliminate the need to send static ticket image files via email. Tickets after successful payment exist exclusively inside the customer's web application account. The ticket QR code is encrypted using the TOTP (Time-based One-Time Password) algorithm combined with a secret key from the server, automatically changing the code structure every 15 seconds. If a customer intentionally takes a screenshot of the QR code and sends it to someone else, that code will be immediately disabled after the next 15 seconds. The web interface also integrates a screen recording protection mechanism and blurs ticket codes when detecting tampering tools.
- Ticket identification based on personal information and flexible ticket locking: Each account is only allowed to buy a maximum of 2 tickets and is required to fill in the attendee's Citizen Identification Number or Passport number. The system integrates an automatic payment gateway, if within 8 minutes the customer does not complete the transaction, the seat position will automatically be released to the empty state for the next person in line.
SOLD OUT 30,000 SAFE TICKETS AND SUPER-SPEED TICKETS
The new system was put to the test during the opening sale of the summer concert and has achieved spectacular results item:
- Durable operation in the face of huge traffic: Can handle more than 52,000 visits simultaneously during peak opening hours without any interruption. All 30,000 tickets were sold out in 42 minutes in a smooth and transparent manner.
- Completely eliminating fake tickets at the gate: On the day of the event, the organizers' handheld scanner system successfully scanned tickets for the entire audience at record speed: it only took 1.2 seconds for each check. The actual recorded rate of fake tickets or duplicate disputes is 0%.
Elimination of automatic ticket buying bot tools: The combination of virtual waiting rooms and identity authentication has successfully prevented more than 12,000 automatic ticket purchase requests from black market ticket bot software, protecting the legitimate rights of real fans.