Open In App

Designing Parking Lot (Garage) System | System Design

Last Updated : 14 Feb, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

Parking garage plays an important role in today’s world, as the number of vehicles is increasing every day, so it has become a major concern to manage them. The parking garage provides the solution to this problem of limited space. It offers to book a Parking garage using any method whether online or offline.

design-parking-system

In this article, we will explore all the various components involved in designing a Parking Garage.

1. Requirements for designing Parking Lot(Garage)

1.1 Functional Requirement for Parking Lot(Garage)

  • Signup & Login: The System needs to allow customers to sign up, log in, and authenticate their identity securely.
  • Parking Space: It should provide functionality to manage available parking spaces, such as actual-time updates on occupancy and vacancy.
  • Reservation for Parking System: Users should be capable of reserving parking areas in advance via an online platform.
  • Payment Service: Implement a stable payment system for customers to pay for parking services.
  • Navigation Assistance 3D: Provide customers with navigation assistance in the parking garage to locate their reserved or parking spaces.

1.2 Non-Functional Requirements for Parking Lot(Garage)

  • Latency: The system must respond right away to user requests, with low latency all through peak hours.
  • Data Integrity: Ensure excessive availability, minimal downtime, and data integrity.
  • Traffic: The system must take care of increasingly more users and transactions without compromising performance.
  • Safety Features: Implement strong safety features to protect user data, transactions, and the general system from unauthorized access.
  • User Interface: The user interface must be intuitive, presenting a wonderful and seamless experience for all users.

2. Capacity Estimation for Parking Lot(Garage)

You can estimate the system capacity by analyzing certain data are:

  • Number of traffic according to daily user.
  • Number of user reserves parking space.
  • Number of user pay for the space without reservation.

By analyzing whole data we can further calculate the required storage capacity for whole year. Here is the simplified calculation given:

Traffic is 50,000 vehicles per month
Traffic per second = 50000/30*24*60*60
= 0.019
Assumption: 30% of users reserve parking spaces in advance
10% of users pay for parking without a reservation

TPS: 30+10 = 40
Storage required (approx 200kb/reservation): 40*200 = 8000 KB/S = 8 MB/S
Storage required per year = 8*60*60*24*365:= 250 TB

3. Usecase Diagram for Parking Lot(Garage)

A use case diagram illustrates the interactions between user and the system, showcasing diverse use cases and actors concerned within the parking garage system.

Use-case-diagram-of-parking

Use Case Diagram of Parking Lot Garage

Below is the explaination of above diagram:

  • Registered User: A Registered User are those who have already created thier account in the parking garage system. They can log in to the system, Reserve Parking Space, and View Reservation History etc.
  • Unregistered User: A Unregistered User are those who have accesses to parking garage system without creating an account. They can Check Parking Space Availability, Access General Information and View Rates etc.
  • System: The System represents the parking garage system itself, it act as the central component which processes all user request. It contain have following responsibilities like in Authenticating User, Process Payments, Manage Parking Space Reservations etc.

4. Architecture of Parking Lot(Garage)

Parking-Management-Architecture-(1)

Architecture of Parking Lot Garage

In the above diagram,

The system is capable of allocating free parking spaces to drivers on request through their smartphones. The following are the proccess:

  • The process involves an initial registration of a user account by the driver via the mobile application.
  • Subsequently, to book an optimally available parking space, the driver searches for a free parking spot closest to his desired destination by simply inputting his/her destination and entry gate into the mobile application.
  • The request is sent to a back-end web service that searches for a free parking spot based on received sensor information and sends the required instruction message to the driver, stating the parking space as well as the recommended route.

The system design is divided into two (2) aspects, namely:

  • Hardware circuit design and sensing technique considerations
  • Software design and development : Web Application (API) and Mobile Application

5. Low-Level Design (LLD) for Parking Lot(Garage)

In Low-Level Design (LLD), the focus is on special making plans and specifications of user components in the system.

Low-Level-Design-for-Parking

Low Level Design of Parking Lot Garage

  • Data Schema:
    • In the LLD phase, the primary crucial thing is the definition of the statistics schema. This includes structuring the databases and specifying relationships among exclusive data entities. The aim is to create a strong basis for efficient data storage, retrieval, and control.
  • Database Design:
    • Following the statistics schema, database design will become crucial. This includes the introduction of particular database schemas, encompassing tables, columns, and constraints.
    • The LLD phase delves into the specifics of the way data must be stored, retrieved, and update, ensuring top-rated performance and data integrity.
  • Algorithms:
    • To deal with the center functionalities of the system, distinct algorithms are developed. These algorithms covers a number process, together with handling HTTP requests, parsing user inputs, routing records, and responding to various system activities.
    • Special emphasis is given to algorithms governing essential capabilities like payment processing, authentication, and statistics retrieval.
  • Data Flow Diagrams:
    • To visualize the flow of information inside the system, data flow diagrams are created.
    • These diagrams illustrate how data moves among different components and modules. Key tactics, transformation, and storage factors are identified, imparting a complete know-how of the system internal workings.

6. High-Level Design (HLD) for Parking Lot(Garage)

High-Level Design (HLD) offers an architectural evaluation of the entire system, outlining principal components and their interactions.

High-Level-Design-for-Parking

High Level Design of Parking Lot Garage

  • System Architecture:
    • The HLD phase begins with the definition of the overall system architecture.
    • This consists of the presentation layer for the user interface, the business logic layer for processing consumer requests, and the data layer for storage and retrieval.
    • The relationship and interactions among those layers are precise to make certain a coherent and effiecient system.
  • Module Interaction:
    • A crucial element of the HLD is the illustration of how distinct modules and components interact with every other.
    • This includes outlining the go with the flow of manage between foremost functionalities, making sure a unbroken and orchestrated operation.
    • The user interface’s communication with the server, data processing, and system responses are carefully observe.
  • User Interface Design:
    • HLD encompasses the design of the user interface, that specialize in layout, interaction, and user experience. It identifies key functions and functionalities visible to end-users, making sure a user-friendly design that aligns with the system goal and requirements.
  • External Interfaces:
    • To make certain the system interoperability with external entities, the layout specifies how the system interfaces with external systems, services, or APIs. This includes defining protocols, data formats, and authentication mechanisms for easy communication.

7. Database Design for Parking Lot(Garage)

Database-Design-of-Parking-Garage-2-(1)

7.1 User Table

The User table stores information about registered user who engage with the parking garage system. This table include fields:

User_id: Unique identifier for every user.
Username: User’s username for identity.
Email_address: User’s e-mail for communication.
Password: Securely hashed user password.
License_plate: User’s automobile registration data.
Created_date: Registration date of the user.

7.2 Reservation Table

The Reservation table includes data about parking area reservations made by user.

Reservation_id: Unique identifier for each reservation.
User_id: Id of the user making the reservation.
Parking_space_id: Id of the reserved parking space.
Reservation_time: Date and time of the reservation.
Duration: Duration of the reservation (start and end time).

7.3 Parking Space Table

The Parking Space table stores information of each parking area in the garage. This table include fields like :

Parking_space_id: Unique identifier for every parking space.
Availability_status: Indicates whether the parking space is available or occupied.
Location: Physical location of the parking area in the garage.
Type: Type of parking space (e.g., regular, reserved).
Rate: Cost related to parking in this area.

7.4 Payment Table

The Payment table stores data of payments made by customers for parking services. This table include fields like :

Payment_id: Unique identifier for every charge transaction.
User_id: Id of the user payment detail.
Reservation_id: Id of the associated reservation (if applicable).
Amount: Amount paid by the user.
Payment_date: Date and time of the payment.

7.5 Feedback Table

The Feedback table stores feedback detail which provided by end users. This table include fields like :

Feedback_id: Unique identifier for each feedback.
User_id: Id of the user offering feedback.
Reservation_id: Id of the associated reservation.
Rating: Numeric score given by customers.
Comments: Additional comments or feedback from the consumer.

8. API Used for Parking Lot(Garage)

8.1 Flowchart of Slot Allocation Algorithm

Flowchart-of-slot-allocation-Algorithm-

The smart Parking System is design to guide users to a desirable parking slot based on their destination of interest.

Pseudocode of Navigation of Parking




Open the Andriod Application
Input preferred destination
DO
Query database to identify a suitable parking lot
Suggest the closest available parking lot to driver
While (Until user accepts the parking a lot assigned)
Display the route to the selected parking lot
Mark the parking lot as assigned
If (A vehicle occupies parking lot)
 Mark the parking lost as occupied
Else
After 5mins , mark the parking lot as vacant
End If


9. API Code Implementation for Parking Lot(Garage)

9.1 User Registration API (POST):

  • Endpoint: /api/user/register
  • Description: Allows users to create accounts securely.

Requests




{
  "username": "example_user",
  "email": "user@example.com",
  "password": "securepassword123",
  "license_plate": "ABC123"
}


Response




{
  "status": "success",
  "message": "User registration successful",
  "user_id": "98765"
}


9.2 Retrieve User Details API (GET):

  • Endpoint: /api/user/details?user_id=98765
  • Description: Retrieves all user data.

Requests




GET /api/user/details?user_id=98765
Host: your-parking-garage-api.com
Accept: application/json


Response




{
  "user_id": "98765",
  "username": "example_user",
  "email": "user@example.com",
  "registration_date": "2023-01-15",
  "profile": {
    "license_plate": "ABC123",
    "created_at": "2023-01-15T12:00:00Z"
  }
}


9.3 Update Reservation API (PUT):

  • Endpoint: /api/reservation/update
  • Description: Allows users to update an existing parking reservation.

Request




{
  "reservation_id": "56789",
  "updated_duration": 3
}


Response




{
  "status": "success",
  "message": "Reservation updated successfully",
  "reservation_id": "56789",
  "updated_at": "2023-02-22T10:45:00Z"
}


10. Microservices Used for Parking Lot(Garage)

Microservices-used-for-Parking-Garage-(1)

Microservices used for Parking Lot Garage

10.1 User Management Microservice:

  • User Registration: Manages the system of consumer registration, storing critical info which includes username, e mail, password, and registration number data securely.
  • Authentication: Validates consumer credentials for the duration of the login procedure the use of stable strategies.
  • Profile Management: Allows users to update and manage their profiles, and their contact number.

10.2 Reservation Microservice:

  • Reservation Handling: Manages the manner of creating parking area reservations, along with checking availability and assigning areas.
  • Reservation Details: Stores info which includes reservation time, duration, and the associated user.
  • History Retrieval: Provides capability to retrieve a user’s reservation history.

10.3 Payment Microservice:

  • Payment Processing: Initiates and process payment for parking services primarily based on reservations.
  • Transaction Records: Stores information of payment transactions, including of the amount, user, and related reservation.
  • Refund Handling: Provides functionality for processing refunds while applicable.

11. Scalability for Parking Lot(Garage)

Scalability guarantees the system can manage increased workload or user demand effectively. Considerations consist of:

11.1 Horizontal Scaling

Horizontal scaling includes the addition of more servers or instances to distribute the workload efficiently. In the context of a Parking Garage System,

  • Horizontal scaling implies growing the range of servers to address a growing wide variety of concurrent users and transactions.
  • This method ensures that the device maintains responsiveness at some point of top durations without encountering common performance bottlenecks.

11.2 Load Balancing

Implementing load balancing mechanisms is essential for various incoming requests gently during more than one servers. This guarantees that no single server is overload with traffic, optimizing useful resource usage and preventing a single point of failure. Load balancing is a crucial strategy for boosting tool reliability and responsiveness.

11.3 Containerization

Containerization technologies, together with Docker, contribute to scalability with the useful resource of encapsulating utility components into packing containers. Containers offer consistency throughout exclusive environments, simplifying deployment and permitting efficient scaling. With containerization, the parking garage income agility and the ability to scale specific additives independently.

11.4 Database Sharding

Database sharding involves horizontally partitioning information across a couple of database servers. This technique is in particular applicable for managing large datasets in a parking garage. By dispensing the data across more than one servers, the system can effectively control and retrieve statistics, contributing to stepped forward usual performance and scalability.

12. Conclusion

In conclusion, the design of a Parking Garage System is a multifaceted process that entails cautious consideration of user interactions, system functionalities, and scalability. The incorporation of microservices, APIs, and a strong database structure guarantees a modular and efficient architecture. By adopting verified technologies and architectural patterns, the Parking Garage System is poised to supply a continuing and responsive experience for users at the same time as addressing the challenges associated with with parking reservations, payments, and consumer feedback.

Other Reference: How to design a parking lot using object-oriented principles?



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads