Based on the performance requirement, 1000 transactions per minute. We can assume that 80% of the transaction is read. Since the write transaction only happens when user book the parking spot and give ratings. So we can say the read qps is 1000/60*80% = 15 qps. Write is 5 qps. And we can assume the peak time is 3 times which is 50 qps. That means in the beginning, 1 web server and 1 db server is sufficient. However, if we would like to support 10000 user simultaneously in the future, multiple servers or even cluster is required.
For storage, let's assume there are 10 character in the license plate, along with user name and other info, we can tell that the size of each record is about 300 bytes. Based on the assumption above, write qps is 5. So 300 * 5 * 60 * 60 *24 * 365 = 130MB per year.
User Authentication
Vehicle Entry and Exit Management:
Reservation system
Feedback Mechanism
Maintenance and Management:
User table
Payment method table
Vehicle Table
Reservation Table
Parking spot table
Feedback Table
flowchart TD
B["User"];
A["Admin"]
C{"Load Balancer"};
D{"API Gateway"}
E["User service"]
F["Vehicle Entry and Exit Management Service"]
G["Reservation service"]
H["Feedback service"]
I["Maintenance Service"]
J["Database"]
K["monitoring service"]
L["Payment service"]
M["Cache"]
B--> C
C --> D
D --> E
D --> F
D --> G
D --> H
E --> J
F --> J
G --> J
H --> J
I --> J
A --> I
A --> K
K --> J
G --> L
K --> B
sequenceDiagram
participant A as User
participant B as Vehicle Entry and Exit Management Service
participant D as User service
participant E as Reservation service
participant F as Payment service
participant G as Feedback service
A->> +B: Try to enter
B->> +D: check user info
D->>-B: return user info
B ->>-A: return if the user can enter/Exit
A->> +E: make reservation
E->> +F: Payment
F->>-E: success
E->>A: reservation made
A->> G: create review