Programming is fun. Often I have problem to find a issue I want to solve. With that in mind I start to publish my programming assignments I’m making for myself.
Today we will have simple microservice to manage concurrent ticket bookings for “events”. Let’s say Iron Maiden announces small concert for 100 people on all their social media channels with specific time of booking. Our problem is to handle big spike of traffic at the time booking become available.
- Application creates event with poll of tickets of specific size
- Application allows to reserve a ticket(s) for 1 hour
- Application allows to transform reservation into real ticket
- After Reservation times out and spot is available for other user
- It’s impossible to reserve more tickets than available in the pool
- After last reservation is transformed into ticket event is closed
I’m leaving proper communication of error out of scope but it’s always good to have framework which allows to communicate about state of the system to external clients.
I’m leaving rest up to you how you want to implement solution for this problem.
As always in software there is no one good answer as it’s “possible” to handle this kind of problem basically in any language with out without external libraries or services.
If you have any questions don’t hesitate to ask. I’ll do my best to answer as soon as possible.
Enjoy and good luck coding!