I have concert tickets to sell, 1.000.000 of them. They are very popular, and as soon as the order button goes live, I will have a very high load of people trying to get them. Lets say 10.000 requests in parallel as worst case.
I want to sell at most 1.000.000 tickets, not 1.000.001. The actual order processing can be asynchronous using a queue, but the customer should have instant feedback if he got the ticket or not.
The system should survive the failure of a single server instance, so I want a fully distributed solution or at least master-slave.
My first thought: a CountDownLatch built using Zookeeper + Curator. Are there better approaches?