List functional requirements for the system (Ask the chat bot for hints if stuck.)...
List non-functional requirements for the system...
Estimate the scale of the system you are going to design...
For size we are going to move with a medium parking lot with 300 spots available.
The parking spots will be 200 Sq ft to keep simple. there will be 300 spots
200sqft x 300 = 60000 sq ft total area
Summary
API usage
Transaction history should have a retention of 3 - 5 years for tax purposes.
Define what APIs are expected from the system...
API will need to at minimal handle these requests
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...
For Database Design I would pick two PostgreSQL databases
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...
Two L7 Active/active Load balancers
Redundant Gateway API
two general purpose Servers cloud servers EC2 AWS
Two PostgreSQL Databases
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...
Flow:
Client sends request to public DNS address
This lands at Load balancer layer
Load balancer sends to Gateway API
Gateway API sends to backend servers that handle all the different types of requests
Backend servers will query the databases for information
Databases return information to the backend servers
backend servers return traffic Gateway API
Gateway API returns traffic to Load Balancers
Load Balancer returns to client
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...
Frontend
I would use React and react native for mobile to handle the UI, user interactions and communication with the backend API calls.
Next Load Balancer will be AWS Load Balancer ELB
API Gateway will also be in the load balancer layer Amazon API Gateway
Backend servers will be AWS cloud ECS servers.
Databases will be Amazon RDS for PostgreSQL
Explain any trade offs you have made and why you made certain tech choices...
ELB with API Gateway - adds minor additional latency however it would add more latency if you separate these add an additional routing hop. also combining this to the ELB adds resource use. This may add cost eventually as we scale.
ELB with API Gateway - complexity in configuration, more development time.
AWS ECS with Python Flask - cold start delay for scaling containers.
AWS ECS with Python Flask -Flask’s synchronous nature may limit concurrency
Amazon RDS (PostgreSQL) - Scalability limited for high-write workloads.
Amazon RDS (PostgreSQL) - Performance overhead with ACID
Amazon RDS (PostgreSQL) -Costs rise with data size and replicas
Try to discuss as many failure scenarios/bottlenecks as possible.
API Gateway latency or throttling
Load Balancer failure - outage in an AWS region - could prevent traffic from reaching ECS instances.
AWS ECS failures - Container crash, out of memory errors.
ECS Service Scaling delay - ECS autoscaling may take time to spin up additional containers, leading to overhead on existing containers.
No caching layer - This causes heavier load on the databases - increased need to resources that we could offload to a cache.
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?
API Gateway latency or throttling
Load Balancer failure - Use multi region LB or GLB for autofailovers to another region.
AWS ECS failures - use ECS auto-restart policies, monitor ECS task health. Use AWS
Cloudwatch alarms to replace failed tasks.
ECS Service Scaling delay - proactive scaling based on PEAK hours or use EC2 instances
Add caching layer - Redis cache