Assumptions:
Estimations
Storage Estimations: Here are some simple storage calculations
User Data: Considering we have 1,00,000 users, we grow by 40% per year, each user record is 100KB. So, at the end of 5 years, we will have 1.1M users
Storage Required = 1.1M * 100KB = 1100000 * 100 KB = 110 GB
Media Storage: let’s assume, we have 500 unique events per month that have media video file and each file is 25MB file.
Storage Required = 500 * 12 months * 5 years * 25 MB = 750 GB
For the tables required in this design, refer to the class diagram, the list of classes is not exhaustive but this is a good number of tables to start with.
Data Partitioning Strategy:
Regional or Geographical Partitioning:
Partitioning Adjustments:
Sharding Strategy:
Scaling Strategy
Here is a simple sequence diagram that shows the sequence flow of a user booking a movie ticket.
For the detailed component diagram, we will discuss the following things,
How do we handle the conflict when multiple users select the same seat while booking a ticket?
What are the Background services required and how will they work?
We will need multiple background services for this system, all these services will be scheduled using a Scheduling Service and a Queue (Apache Kafka). Multiple other services can also put messages in this queue to trigger a particular workflow inside these background service. Below are 2 such services.
What happens when a payment fails for a user?