total parking spaces 500 in total and average 350 unique cars per day
POST: /parking_spot/{car_type}
GET:/parking_fee/{ticket_number}
GET:/pay_parking/{ticket_number}
POST:/reserve_parking
GET: /availability/
GET: /usage/{date_range}/{car_type}
Table:
the database should be relational database because the data is structured and it would be less costly to query from relational database
B[client] --> C{server}
C --> D[Database]
C --> E[Payment System]
F[Security] --> C
User drives through parking lot and requests a ticket from the machine, this is the Client. Client would get data from the server regarding where the car should be parked. Server would contain algorithm about where the best parking spot would be and return a good parking range for the car and create a parking id. Server would also store necessary information into the database.
Once user is ready to leave, user uses the parking machine to leave the parking lot, this would get from server to get the amount to be paid. Then client can post to server with information and server would forward that information to the payment service. Once payment service confirms payment, we store that in the system and lets the car out.
Client should then communicate directly with payment system to pay and once payment system says ok, we store that information back to server and database
Algorithms for calculating the best place to park.
In case where the payment system fails, we should have a mechanism to let the cars leave and pay later.
Servers can be hosted in multiple locations to prevent single point of failure.
Database can be distributed with one main database. Since the requests level are low and likely from the same region we don't have to think about distributing database into multiple regions.
in cases where payment system fails for long time, we should have a free day and let the cars leave with no problem
we should always try a few times before resorting to let the customers leave