List functional requirements for the system (Ask the chat bot for hints if stuck.)...
1) Adding new parking garage.
2) Modifying existing parking garage.
3) Vehicle Registration.
4) Finding the empty slot as per the vehicle.
5) Booking the slot.
6) Issuing the parking ticket.
7) On exit estimating the final payment.
8) Adding system alerts.
9) Once final exit empty the slot for next booking.
List non-functional requirements for the system...
1) Concurrency.
2) Consistency.
3) Availability.
4) Scalability.
5) Performance
Estimate the scale of the system you are going to design...
1) every request vehicle
every second :- 100 request/sec
payload :- VEHICLE NUMBER, USER_ID
10 character -> 10 bytest
10 bytest userid->
total bytes -> 30 bytes
existing size:- garage registration:-
name of place
garage number - 123
20 bytes
30bytes
50bytes
100 bytes for one garage
100*1000=> 100kb-> 10 mb
one entry :-
parking garage id, parking spot, spot type, status
1000*1000*70-> 7000000bytes->7000kb-> .7mb
garage owner he can update the entry and spot also in future.
reservation:-
new vehicle->
userId->
vehicle type->four wheeler/two wheeler
vehicle number ->
parking spot id:-
garageId
pic of the vehicle number
100 req/sec
50 req slots not available
30 req slots for entry
20 req slots for exit
vehiclenumer - 15 bytes
parking spot id -> 4 bytes
garage id -> 6 bytes
pic of the vehicle -> 1 kb
20 bytes + 1000-> 1020* 30 -> 30.6 kb/sec
30 * 1 mb-> 60 mb/sec
.1 tb in a day
2.6 gb in 1 day
1 tb in a year for database
5
1861 tb in a year blob storage(taking picture of vehicle in exit and entry)
Define what APIs are expected from the system...
User JWT Token on every request for authentication
1) Adding new parking garage.
/garage
reqeust type POST
2) Modifying existing parking garage.
/garage
reqeust type PUT
3) Finding the empty slot as per the vehicle.
/garage/:garageId/:vehicle/:typeId
GEt
6) Booking the slot.
/garage/vehicle/slot
POST
garageId:
vehicleNumber:
spotNumber
floorNumber:
response:- parking ticket
5) Exit the slot.
/garage/vehicle/slot
POST
garageId:
vehicleNumber:
spotNumber
floorNumber
7) On exit estimating the final payment.
/payment/:bookingId
GET
7) On exit Redirect to final payment.
/payment
bookingId
amount
orderId
typeOfPayment
PaymentProvider
POST
Role based
Defining the system data model early on will clarify how data will flow among different components of the system. Also you could draw an ER diagram using the diagramming tool to enhance your design...
All table are in mysql as all data we require maintain constant structure and we need consistency and acid property.
1) USER
userId
Name
Mobile
2) VEHICLE
UserId
VehcileId
VehcileNumber
VehicleType
vehicleImage
3) RESERVATION
reservationId
userId
vehicleId
entryTime
garageId
parkingLotId
exitTime
4) GARAGE
garageId
garageName
address
5) PARKING_SLOT
garageId
slotId
floorNumber
status:ENUM(AVAILABLE/RESERVE/MAINTENANCE)
6) PAYMENT
paymentId
uniqueOrderId
transactionId
amount
paymentProvider
createdAt
7) ReservationPaymentMarking
reservationId
uniqueOrderId
after final exit dump data to archival data storage with all required field
You should identify enough components that are needed to solve the actual problem from end to end. Also remember to draw a block diagram using the diagramming tool to augment your design. If you are unfamiliar with the tool, you can simply describe your design to the chat bot and ask it to generate a starter diagram for you to modify...
Explain how the request flows from end to end in your high level design. Also you could draw a sequence diagram using the diagramming tool to enhance your explanation...
Dig deeper into 2-3 components and explain in detail how they work. For example, how well does each component scale? Any relevant algorithm or data structure you like to use for a component? Also you could draw a diagram using the diagramming tool to enhance your design...
Explain any trade offs you have made and why you made certain tech choices...
Try to discuss as many failure scenarios/bottlenecks as possible.
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?