add Q4
هذا الالتزام موجود في:
76
Q4-Scalability/README.md
Normal file
76
Q4-Scalability/README.md
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
# Q4 - Scalability & Load Balancing
|
||||||
|
|
||||||
|
## Objective
|
||||||
|
|
||||||
|
Design a scalable architecture capable of handling **15,000 requests per second** on the Ghaymah Container Platform.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Proposed Architecture
|
||||||
|
|
||||||
|
The solution uses:
|
||||||
|
|
||||||
|
- Ghaymah Load Balancer
|
||||||
|
- 39 Application Containers
|
||||||
|
- PostgreSQL Database
|
||||||
|
- Redis Cache
|
||||||
|
- Ghaymah Block Storage
|
||||||
|
- Monitoring and Health Checks
|
||||||
|
|
||||||
|
The Load Balancer distributes incoming traffic evenly across all application containers while health checks ensure traffic is only routed to healthy instances.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Container Calculation
|
||||||
|
|
||||||
|
Expected Traffic
|
||||||
|
|
||||||
|
- 15,000 requests/second
|
||||||
|
|
||||||
|
Container Capacity
|
||||||
|
|
||||||
|
- 500 requests/second
|
||||||
|
|
||||||
|
Required Containers
|
||||||
|
|
||||||
|
15000 / 500 = 30
|
||||||
|
|
||||||
|
Including 30% reserve capacity
|
||||||
|
|
||||||
|
30 × 1.3 = 39 containers
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Cold Start Strategy
|
||||||
|
|
||||||
|
The platform keeps additional warm containers available to reduce startup latency during sudden traffic spikes.
|
||||||
|
|
||||||
|
New containers are automatically created when resource utilization reaches the defined thresholds and are added to the Load Balancer only after passing health checks.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Ghaymah Block Storage
|
||||||
|
|
||||||
|
Persistent storage is attached to the database layer to ensure application data survives container restarts and deployments.
|
||||||
|
|
||||||
|
Suitable workloads include:
|
||||||
|
|
||||||
|
- Databases
|
||||||
|
- Logs
|
||||||
|
- Uploaded files
|
||||||
|
- Stateful applications
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Monitoring
|
||||||
|
|
||||||
|
The deployment should continuously monitor:
|
||||||
|
|
||||||
|
- CPU Utilization
|
||||||
|
- Memory Usage
|
||||||
|
- Response Time
|
||||||
|
- Error Rate
|
||||||
|
- Container Health
|
||||||
|
- Restart Count
|
||||||
|
|
||||||
|
Alerts should be triggered before resources reach critical levels to prevent service interruption.
|
||||||
29
Q4-Scalability/calculations.md
Normal file
29
Q4-Scalability/calculations.md
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# Container Capacity Calculation
|
||||||
|
|
||||||
|
## Given
|
||||||
|
|
||||||
|
- Expected Traffic = 15,000 requests/second
|
||||||
|
- One container capacity = 500 requests/second
|
||||||
|
- Required headroom = 30%
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Step 1
|
||||||
|
|
||||||
|
Number of containers without headroom
|
||||||
|
|
||||||
|
15000 / 500 = 30 Containers
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Step 2
|
||||||
|
|
||||||
|
Adding 30% reserve capacity
|
||||||
|
|
||||||
|
30 × 1.30 = 39 Containers
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Final Result
|
||||||
|
|
||||||
|
The application should run **39 containers** to safely handle the expected traffic while maintaining additional capacity for sudden traffic spikes and infrastructure failures.
|
||||||
ثنائية
Q4-Scalability/ghaymah_full_production_architecture.png
Normal file
ثنائية
Q4-Scalability/ghaymah_full_production_architecture.png
Normal file
ملف ثنائي غير معروض.
|
بعد العرض: | الارتفاع: | الحجم: 1.2 MiB |
المرجع في مشكلة جديدة
حظر مستخدم