My Solution for Design an Efficient Parking Lot System with Score: 5/10
by ripple2649
System requirements
Functional:
List functional requirements for the system (Ask the chat bot for hints if stuck.)...
1> type of vehicle
2> check availability of space before allowing vehicle
3> different parking space for different vehicle
4> entry and exit gate with available space
5> online reservation
6> transaction online
7> gate payment
Non-Functional:
List non-functional requirements for the system...
1> scalable
2> low latency
Capacity estimation
Estimate the scale of the system you are going to design...
suppose there are 1000 vehicle in that particular area and space in parking lot is of 100 vehicle only at a time.
Therefore write to read ratio will be 100/1000 = 1 : 10
so our system should be enough scalable to handle 10 times the write input.
So let one vehicle take 50 bytes to store information therefore 1000*50 = 50kB memory needed at max therefore Relational Database would be best.
API design
Define what APIs are expected from the system...
so we will use 5 API one at the time of entry of a vehicle and another at the time of exit.
API 1 : for entry
{ -entry time;
-vehicle number;
-colour;
-space occupied;
-vehicle type;}
API 2 : for exit
{exit time;
vehicle number;
vehicle type;
space unoccupied;
}
API 3:check_availability(vehicle_type)
API 4: reserve_spot(vehicle_ID, spot_number, entry_time)
API 5: cancel_reservation(reservation_ID)
Database design
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...
we will use four SQL database like MySQL to store details of vehicle.
DATABASE 1 : Vehicle with { ID, Vehicle type}
if vehicle is a Car then
DATABASE 2 : Car with { ID, color, car type, entry time}
for two wheelers
DATABASE 3: Two wheeler with {ID, color, Type, entry time}
DATABASE 4: Big Vehicles with {ID, color, type, entry time}
High-level design
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...
Client first sent it request to a Gateway which send it to a load balancer which distributes the incoming load equally to the servers which than get to the databases and store or update the data we also uses caching memory for fast recovery of frequent vehicles, and for database security we will have data backup.
Request flows
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...
Detailed component design
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...
Trade offs/Tech choices
Explain any trade offs you have made and why you made certain tech choices...
Failure scenarios/bottlenecks
Try to discuss as many failure scenarios/bottlenecks as possible.
Future improvements
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?