Hacker News new | ask | show | jobs
by DiogenesKynikos 721 days ago
The system can just keep track of whether the ticket has already been used before. You don't have to store the information on the ticket itself. You can store the information on a central server, connected to all the gates.

The ticket itself just has to encode an ID, and then the central database contains an entry for that ID that is checked by the gate in real time. When the ticket is scanned at a gate, the database gets updated.

1 comments

That server would have to process thousands of requests per second during a rush hour with very little delay. In addition to QR codes just being much more finicky than tapping a card or sticking something into a slot.
It only has to process requests inside a single station, and then periodically sync up with a central server. This doesn't sound difficult at all.
This is indeed how systems around the world do it for NFC tickets. The problem with QR codes is that they're very easy to copy, so the potential for abuse with this approach is much higher. What's to stop people from using the same ticket on two different stations within the sync period?
The QR code can encode (or the system can track, or both) any combination of origin, destination, expiration (or purchase time + validity period), ticket number, etc. Check with the local server that the ID exists with the given information and that the ticket isn't expired, then allow the user through, and the server marks that ticket number as used. If the origin doesn't match the current station, the ticket is expired, or the ticket is used, don't let the user in.
So you would have to buy a ticket every time you go somewhere. That would work for tourists, sure, assuming there are vending machines that can print those QR codes. But it would not work for locals (imagine everyone buying tickets during a rush hour), and even for some tourists, it would be a nuisance. If you're visiting a city and you know you're going to take the subway N times, you would just buy N tickets, but with this system no such thing is possible.

And what about all those transfer discounts some cities have? Like if you're taking the subway and a bus within some timeframe, you still only pay once.