Bird
0
0
LLDsystem_design~12 mins

Enum usage (VehicleType, SpotType) in LLD - Architecture Diagram

Choose your learning style9 modes available
System Overview - Enum usage (VehicleType, SpotType)

This system manages a parking lot using enums to classify vehicle types and parking spot types. It ensures vehicles are parked in appropriate spots based on their type, improving organization and efficiency.

Architecture Diagram
User
  |
  v
Parking Lot System
  |
  +--> VehicleType Enum
  |
  +--> SpotType Enum
  |
  +--> Parking Manager Service
          |
          +--> Parking Spot Database
          |
          +--> Notification Service
Components
User
actor
Person who wants to park a vehicle
Parking Lot System
system
Main system managing parking operations
VehicleType Enum
enum
Defines types of vehicles (e.g., Car, Bike, Truck)
SpotType Enum
enum
Defines types of parking spots (e.g., Compact, Large, Motorcycle)
Parking Manager Service
service
Handles parking logic, matches vehicles to spots
Parking Spot Database
database
Stores parking spot availability and assignments
Notification Service
service
Sends parking confirmation or alerts to users
Request Flow - 7 Hops
UserParking Lot System
Parking Lot SystemParking Manager Service
Parking Manager ServiceSpotType Enum
Parking Manager ServiceParking Spot Database
Parking Spot DatabaseParking Manager Service
Parking Manager ServiceNotification Service
Notification ServiceUser
Failure Scenario
Component Fails:Parking Spot Database
Impact:System cannot check or assign parking spots, so parking requests fail or are delayed
Mitigation:Use database replication and caching to provide availability data during failures
Architecture Quiz - 3 Questions
Test your understanding
Which component determines the suitable parking spot type for a vehicle?
ANotification Service
BVehicleType Enum
CParking Manager Service
DUser
Design Principle
Using enums for VehicleType and SpotType simplifies the logic for matching vehicles to appropriate parking spots. It enforces clear categories, reduces errors, and makes the system easier to maintain and extend.