1.2 KiB
1.2 KiB
Q4 - Scalability and Load Balancing
1. Architecture Overview
The application is deployed behind a Load Balancer that distributes incoming traffic across multiple application containers.
Components:
- Users
- Load Balancer
- Container Cluster
- Ghaymah Block Storage
- Database
2. Required Number of Containers
Application Load = 15,000 requests/second
One Container Capacity = 500 requests/second
Required Containers:
15000 / 500 = 30 Containers
Safety Margin (30%):
30 × 1.30 = 39 Containers
Final Answer:
39 Containers
3. Cold Start Strategy
To reduce cold start latency:
- Keep a small number of warm containers running.
- Enable Auto Scaling based on CPU and request rate.
- Perform health checks before routing traffic.
- Register new containers with the Load Balancer only after becoming healthy.
- Use lightweight container images for faster startup.
4. Ghaymah Block Storage
Block Storage is used for stateful workloads such as databases.
Benefits:
- Data persists even if containers restart.
- Supports high availability.
- Can be attached to replacement containers.
- Suitable for MySQL, PostgreSQL, MongoDB and other databases.