User to be able to reserve parking spot, extend time, cancel reservation
Parking spots will have rate depending on size (small, medium, large)
Available -> Users could be parking at any time
Consistent -> Cannot have any double bookings
1,500,000 per day -> 20 transactions per second
User Table:
10,000,000 users -> 400 000 000bytes -> 400 000 KB -> 400MB
Reservation Table:
20,000,000 parking spots -> 100,000,000bytes -> 100,000 KB -> 100MB
Spot to License Plate:
20,000,000 parking spots -> 220,000,000bytes ->220,000KB -> 220MB
Looking at estimations, scaling for writes and scaling to increase transactions per second wont be necessary
Public Endpoints:
/GET/Price:SpotID
/POST/Reservation
Body contains spotID,licensePlate
/POST/Cancel
Body contains spotID
/GET/Parking/SpotID
/GET/Lot:LotID
Use SQL, MySQL
User Table:
First Name VARCHAR (20)
Last Name VARCHAR (20)
Reservation Table:
Parking SpotID INT (4)
LotID INT(4)
Size CHAR(1)
Reference Table for Size to Pay rate:
Size CHAR(1)
Pay Rate Float(4)
Reference Table for Spot to License Plate:
Parking SpotID INT (4)
License Plate VARCHAR(7)
User can reserve spot, cancel reservation or extend
Extending reservation will use same endpoint as paying, if license plate matches the car that is currently parked, extend time
User can cancel reservation 24 hours in advance
Client loads page: get spots for lot from /GET/Lot:LotID
Client gets rate for specific spot from /GET/Price:SpotID
Client reserves a spot with /POST/Reservation
Client can cancel reservation 24hours in advance with /POST/Cancel
Client can extend spot with /GET/Parking/SpotID
Request -> Gateway -> Loadbalancer -> Server -> DB -> Server -> Client
Extending reservation will use same endpoint as paying, if license plate matches the car that is currently parked, extend time
Client loads page: get spots for lot from /GET/Lot:LotID
Client gets rate for specific spot from /GET/Price:SpotID
Client reserves a spot with /POST/Reservation
Client can cancel reservation 24hours in advance with /POST/Cancel
Client can extend spot with /GET/Parking/SpotID
Request -> Gateway -> Loadbalancer -> Server -> DB -> Server -> Clien
Implement Stripe/Visa for payment, note that retries should be handled on their side
If transaction fails, send response back to user
Note that failed payment will create failure response
Use SQL (MySQL), strong relationships between rows
Spike in requests during peak hours, for example people need to park and pay in the morning to get to work
Create new features depending on what customers want