We definitely have not big amount of movies and cinemas. And users make not so many purchases. So the amount of data will not be a big problem.
Method – GET /search
Input:
Output:
Method – GET /seats
Input:
Output:
Method – PUT /reserve
Input:
Output:
Table that shows movies of a specific movie in a specific cinema on a date.
API service will have 2 separated physical services. One will handle users requests. And the second one will process message broker messages.
Nginx has a big active community, so it is common choice for the LB.
There are few reasons for choosing relational database for the cinema service
We need guaranteed ascyncronous communication between microservices. Kakfa is quite popular choice for this goal
We need to have full-text search for our films. ElasticSearch database is very efficient for this goal
The main bottleneck here is Cinema database. It will handle main write and read load.
But the main parts of the architecture is asynchronous and all the services are stateless. So the system will be highly available.
For more guarantee in asynchronous interactions between services we may use outbox pattern in future.
If the cinema database if the main point of failure, it can be made more available in future. But the CAP theorem trade-off will come in to place here.