First of all: when it comes to selling goods (e-commerce), you really need transaction support. This basically excludes any NoSQL solutions such as MongoDB or Cassandra.
Therefore, you must use a database that supports transactions. MySQL does, but not in every storage engine. Be sure to use InnoDB, not MyISAM.
Because many popular databases support transactions, so it's up to you to choose which one.
Why transactions? Because you need to fill out a bunch of database updates, and you have to be sure that they all work as a single atomic operation. For example: 1) make sure the ticket is available. 2) Reduce the number of tickets available in one 3) process a credit card, get approval 4) write information about the purchase in the database
If any operation fails, you must undo previous updates. For example, if a credit card is declined, you should refuse to reduce the available ticket.
And the database will block these tables for you, so there are no changes that someone is trying to buy a ticket between steps 1 and 2, but the number of tickets available has not yet been reduced. Thus, without locking the table, it would be possible to get a situation where only 1 ticket is left, but it is sold to two people, because the second purchase began between steps 1 and 2 of the first transaction.
It is important that you understand this before you start programming an e-commerce project.
source share