Complete Task 5: Mithal monitoring dashboard
هذا الالتزام موجود في:
ثنائية
q4-scalability/architecture-diagram.png
Executable file
ثنائية
q4-scalability/architecture-diagram.png
Executable file
ملف ثنائي غير معروض.
|
بعد العرض: | الارتفاع: | الحجم: 1.2 MiB |
49
q4-scalability/architecture.md
Normal file
49
q4-scalability/architecture.md
Normal file
@@ -0,0 +1,49 @@
|
||||
# Scalable Architecture Design
|
||||
|
||||
## Overview
|
||||
|
||||
The application is designed to handle up to **15,000 requests per second (req/s)** on Ghaymah using multiple application containers behind a Load Balancer.
|
||||
|
||||
The architecture distributes incoming traffic evenly across multiple container instances to ensure high availability, scalability, and fault tolerance.
|
||||
|
||||
---
|
||||
|
||||
## Architecture Components
|
||||
|
||||
- Internet Users
|
||||
- Ghaymah Load Balancer
|
||||
- Multiple Application Containers
|
||||
- Ghaymah Block Storage
|
||||
- Database
|
||||
|
||||
---
|
||||
|
||||
## Traffic Flow
|
||||
|
||||
1. Users send requests to the application.
|
||||
2. The Load Balancer receives all incoming traffic.
|
||||
3. Requests are distributed evenly across the application containers.
|
||||
4. Each container processes the request.
|
||||
5. Stateful data is stored in the database using Ghaymah Block Storage.
|
||||
|
||||
---
|
||||
|
||||
## High Availability
|
||||
|
||||
If one container becomes unavailable, the Load Balancer automatically routes traffic to healthy containers without affecting users.
|
||||
|
||||
Internet Users
|
||||
│
|
||||
▼
|
||||
Ghaymah Load Balancer
|
||||
│
|
||||
┌───────────────┼───────────────┐
|
||||
▼ ▼ ▼
|
||||
App Container App Container App Container
|
||||
│ │ │
|
||||
└───────────────┼───────────────┘
|
||||
│
|
||||
Database
|
||||
│
|
||||
▼
|
||||
Ghaymah Block Storage
|
||||
49
q4-scalability/block-storage.md
Normal file
49
q4-scalability/block-storage.md
Normal file
@@ -0,0 +1,49 @@
|
||||
# Ghaymah Block Storage for Stateful Workloads
|
||||
|
||||
## Overview
|
||||
|
||||
Stateful applications store persistent data that must remain available even if a container is restarted, replaced, or moved to another node.
|
||||
|
||||
Ghaymah Block Storage provides persistent storage that can be attached to stateful workloads such as databases.
|
||||
|
||||
---
|
||||
|
||||
## Common Stateful Workloads
|
||||
|
||||
- MySQL
|
||||
- PostgreSQL
|
||||
- MongoDB
|
||||
- Redis (Persistent Mode)
|
||||
|
||||
---
|
||||
|
||||
## How It Works
|
||||
|
||||
1. The database container stores its data on a Ghaymah Block Storage volume.
|
||||
2. If the container fails, a new container can be started.
|
||||
3. The same Block Storage volume is reattached.
|
||||
4. The application continues using the existing data.
|
||||
|
||||
---
|
||||
|
||||
## Benefits
|
||||
|
||||
- Persistent data storage
|
||||
- High durability
|
||||
- Faster recovery after failures
|
||||
- Data remains available after container restarts
|
||||
- Suitable for production database workloads
|
||||
|
||||
---
|
||||
|
||||
## Example Architecture
|
||||
|
||||
```text
|
||||
Application Containers
|
||||
│
|
||||
▼
|
||||
Database Container
|
||||
│
|
||||
▼
|
||||
Ghaymah Block Storage
|
||||
```
|
||||
38
q4-scalability/cold-start-strategy.md
Normal file
38
q4-scalability/cold-start-strategy.md
Normal file
@@ -0,0 +1,38 @@
|
||||
# Cold Start Strategy
|
||||
|
||||
## Overview
|
||||
|
||||
A cold start occurs when a new application container is created to handle increased traffic. During startup, the container needs time to initialize before it can receive requests.
|
||||
|
||||
---
|
||||
|
||||
## Strategy
|
||||
|
||||
### 1. Keep Warm Containers
|
||||
|
||||
Maintain a small number of standby containers that are already running and ready to receive traffic immediately.
|
||||
|
||||
### 2. Auto Scaling
|
||||
|
||||
Automatically create additional containers when CPU usage, memory usage, or request rate exceeds predefined thresholds.
|
||||
|
||||
### 3. Lightweight Container Images
|
||||
|
||||
Use small Docker images to reduce image download and startup time.
|
||||
|
||||
### 4. Health Checks
|
||||
|
||||
Only send traffic to containers after they successfully pass health checks.
|
||||
|
||||
### 5. Container Image Caching
|
||||
|
||||
Cache frequently used container images on the compute nodes to avoid downloading them repeatedly.
|
||||
|
||||
---
|
||||
|
||||
## Benefits
|
||||
|
||||
- Faster application startup
|
||||
- Lower request latency
|
||||
- Better user experience during traffic spikes
|
||||
- Improved application availability
|
||||
41
q4-scalability/container-calculation.md
Normal file
41
q4-scalability/container-calculation.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# Container Capacity Calculation
|
||||
|
||||
## Given
|
||||
|
||||
- Expected traffic: **15,000 requests/second**
|
||||
- Capacity per container: **500 requests/second**
|
||||
- Safety margin: **30%**
|
||||
|
||||
---
|
||||
|
||||
## Step 1: Calculate Minimum Containers
|
||||
|
||||
Minimum Containers = Total Requests ÷ Capacity per Container
|
||||
|
||||
```
|
||||
15000 ÷ 500 = 30 Containers
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Step 2: Add Safety Margin
|
||||
|
||||
```
|
||||
30 × 30% = 9 Containers
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Total Required Containers
|
||||
|
||||
```
|
||||
30 + 9 = 39 Containers
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Final Result
|
||||
|
||||
To safely handle **15,000 requests per second**, the application should run **39 application containers**.
|
||||
|
||||
The additional containers provide extra capacity during traffic spikes and improve overall reliability.
|
||||
المرجع في مشكلة جديدة
حظر مستخدم