Complete Q4: Scalability

هذا الالتزام موجود في:
2026-07-27 19:32:26 -04:00
الأصل f4c35476ff
التزام 176915001e
2 ملفات معدلة مع 55 إضافات و0 حذوفات

عرض الملف

@@ -0,0 +1,55 @@
# Scalability and Load Balancing
## 1. Required Number of Containers
### Given
- Incoming traffic = **15,000 requests/second**
- One container can handle = **500 requests/second**
- Safety margin = **30%**
### Calculation
Required containers without margin:
15000 ÷ 500 = **30 containers**
Adding a 30% safety margin:
30 × 1.30 = **39 containers**
Rounded up:
**40 containers**
---
## 2. Cold Start Strategy
To reduce startup delays during traffic spikes, the following strategy is recommended:
- Keep at least 2 containers always running.
- Enable Horizontal Pod Autoscaler (HPA).
- Cache container images on cluster nodes.
- Use lightweight Docker images.
- Configure Readiness Probes before sending traffic to new containers.
- Scale gradually to avoid resource spikes.
---
## 3. Using Ghaymah Block Storage
Ghaymah Block Storage should be used for stateful workloads that require persistent storage.
Examples include:
- PostgreSQL
- MySQL
- MongoDB
Benefits:
- Data persists even if a container restarts.
- High reliability.
- Easy storage expansion.
- Suitable for production databases.