//List the key non-functional requirements (eg low latency, scalability, reliability, etc.)...
Estimate the scale of the system. Consider daily active users, read/write ratio, storage requirements, bandwidth, and any relevant QPS calculations...
Define the APIs expected from the system. This is your chance to analyze and define the read and write paths so that you can come up with the high-level design...
CreateReservationCart(startTime, durationInHours) ReservationCart // contains info about reservation, price and userID
CreateCheckoutCart(userId) -> CheckoutCart // contains info about stay, startTime and hours spent, price and userID
MakeOrder(cartId)
GetAvailablePaymentMethods() -> PaymentMethods[]
SelectPaymentMethod(method) -> PaymentInstructions
The server will have basically 3 components:
The availability could be achieved with redundancy, every write will be replicated to another server that will be consistent with the main DB. This will ensure that if the first one goes down, the second one could assume its position. And given that the parking slot only contains up to 500 spots, that dual write shouldn't add significant latency as the number of write should be low.
Scalability issue will be divided in 2 sections:
Define the data model. Identify the main entities, their attributes, and relationships. Consider the choice of database type (SQL vs NoSQL) and justify your decision based on access patterns...
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.
The server will have basically 3 components: