open up both the entry & exit for vehicles to leave
Non-Functional requirements
Database - SQL
short term/long term parking -
to track daily transactions
payment involved hence meet the ACID compliance
monthly subscription parking
using the key card to separate the monthly subscription transactions
Loadbalancer
Nginx to distribute the traffic across multiple servers
cache
redis to store all the vehicle make and model information to determine if they fit into the parking lot or not
Payments
use the third party provider - ayden for processing the transactions
short term parking fee - $10/hour
long term parking fee - $100/day
Monthly subscription - $2000/month
minimum charge - $10
concurrency
transaction isolation level in sql database will prevent the concurrency issue when two vehicles trying to pull a ticket from the machine
Horizontal sharding
hash based sharding
we can use the key-value store to retrieve the payment details with reference to key
use consistent hashing to store the details across the servers
easy to replace the server in case of failure
fault tolerance
set up leader/follower servers
when one of them fails fail over to the follower server automatically
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
SQL
given the traffic and through along with the payment information SQL will meet the requirements
Redis
out of the box redis which can be added to the DB can hold data that will meet the requirements
Trade offs/Tech choices
horizontal sharding
range based sharding
range might not work because the data will be stored inconsistently across the servers
hash based sharding
will store the information evenly across the servers