Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What database solution will you suggest for competitive online tickets sale

Can you please give me an database design suggestion?

I want to sell tickets for events but the problem is that the database can become bootleneck when many user what to buy simultaneously tickets for the same event.

  • if I have an counter for tickets left for each event there will be more updates on this field (locking) but I will easy found how much tickets are left
  • if I generate tickets for each event in advance it will be hard to know how much tickets are left

May be it will be better if each event can use separate database (if the requests for this event are expected to be high)?

May be reservation also have to asynchronous operation?

Do I have to use relation database (MySQL, Postgres) or no relation database (MongoDB)?

I'm planing to use AWS EC2 servers so I can run more servers if I need them.

I heard that "relation databases don't scale" but I think that I need them because they have transactions and data consistency that I will need when working with definite number of tickets, Am I right or not?

Do you know some resources in internet for this kind of topics?

like image 971
Julian Popov Avatar asked Dec 09 '22 10:12

Julian Popov


1 Answers

If you sell 100.000 tickets in 5 minutes, you need a database that can handle at least 333 transactions per second. Almost any RDBMS on recent hardware, can handle this amount of traffic.

Unless you have a not so optimal database schema and/of SQL, but that's another problem.

like image 129
Frank Heikens Avatar answered Feb 08 '23 23:02

Frank Heikens