7. Large Scale Systems-এর Architectural Building Blocks
আমরা আলোচনা করবো Large Scale Systems-এর Architectural Building Blocks — যেমন DNS, Load Balancing, GSLB, Message Broker, API Gateway, এবং CDN। আমি এগুলোকে বাস্তব উদাহরণসহ বিস্তারিতভাবে ব্যাখ্যা করবো।
১. DNS (Domain Name System)
🔹 সংজ্ঞা:
DNS হলো ইন্টারনেটের “Phonebook”।
- 
এটি domain name (যেমন www.example.com) কে IP address-এ translate করে।
 - 
ব্যবহারকারী সহজে URL লিখতে পারে, আর সার্ভার ঠিকমতো locate হয়।
 
🔹 উদাহরণ:
- 
আপনি browser-এ লিখলেন:
www.amazon.com - 
DNS lookup → Amazon server এর IP address → request সেই সার্ভারে পৌঁছায়
 
🔹 Large Scale Usage:
- 
High availability নিশ্চিত করতে Multiple DNS records, TTL (Time-to-Live) ব্যবহার।
 - 
Example:
www.example.com→ 3 different IP addresses → Load balanced servers 
২. Load Balancing & GSLB (Global Server Load Balancing)
🔹 Load Balancing
Load Balancer হলো এমন একটি সিস্টেম যা incoming traffic কে multiple backend servers-এর মধ্যে distribute করে।
🔹 উদাহরণ:
- 
একটি ওয়েবসাইট 3টি সার্ভারে চলছে
 - 
1000 user request আসছে
 - 
Load Balancer → 1000 requests সমানভাবে 3 সার্ভারে বিতরণ করে (~333 per server)
 
Load Balancer Techniques:
- 
Round Robin
 - 
Least Connections
 - 
IP Hashing
 
🔹 GSLB (Global Server Load Balancing)
- 
GSLB হলো Multiple Data Centers-এর মধ্যে traffic distribute করার পদ্ধতি
 - 
ব্যবহারকারীর geographical location, server health, latency অনুযায়ী traffic route করে
 
উদাহরণ:
- 
User from Europe → Europe data center
 - 
User from US → US data center
 - 
Server down → Traffic redirect automatically to healthy server
 
Math Example:
- 
EU DC capacity = 5000 req/sec
 - 
US DC capacity = 7000 req/sec
 - 
Total global capacity = 5000 + 7000 = 12,000 req/sec
 
৩. Message Broker
🔹 সংজ্ঞা:
Message Broker হলো এমন একটি system যা different services-এর মধ্যে asynchronous communication নিশ্চিত করে।
- 
Producer → Broker → Consumer
 - 
Decouples services, improves reliability
 
🔹 উদাহরণ:
- 
E-commerce:
- 
Order Service → Broker → Inventory Service
 - 
Payment Service → Broker → Notification Service
 
 - 
 
Popular Message Brokers: Kafka, RabbitMQ, AWS SQS
Math Example:
- 
1 million messages/day
 - 
Broker throughput = 10,000 messages/sec
 - 
Required concurrent processing = 10,000/sec → Broker scale according to load
 
৪. API Gateway
🔹 সংজ্ঞা:
API Gateway হলো একটি entry point যা all client requests handle করে।
- 
Authentication, Authorization, Rate Limiting, Load Balancing, Logging
 
🔹 উদাহরণ:
- 
Client → API Gateway → Microservices (User, Order, Payment)
 - 
Gateway handles: JWT validation, throttling, logging
 
Benefits:
- 
Centralized security
 - 
Single entry point for clients
 - 
Easier versioning & monitoring
 
৫. Content Delivery Network (CDN)
🔹 সংজ্ঞা:
CDN হলো geographically distributed servers যেগুলো static content (images, CSS, JS) cache করে রাখে।
- 
Users nearest server থেকে content fetch করে → latency কমে
 
🔹 উদাহরণ:
- 
A user in Bangladesh → CDN server Singapore
 - 
B user in US → CDN server US
 - 
Image load time < 100ms (instead of origin server 500ms)
 
Popular CDN Providers: Cloudflare, Akamai, AWS CloudFront
Math Example:
- 
Origin server latency = 500ms
 - 
CDN edge server latency = 50ms
 - 
Speedup = 500 ÷ 50 = 10x faster
 
৬. Architectural Diagram Concept
৭. Summary Table
| Building Block | Function | Example / Benefit | 
|---|---|---|
| DNS | Domain → IP | www.amazon.com → 205.251.242.103 | 
| Load Balancer | Distribute requests among servers | 1000 requests → 3 servers | 
| GSLB | Traffic distribution across global DCs | EU user → EU DC, US user → US DC | 
| Message Broker | Async communication between services | Kafka, RabbitMQ | 
| API Gateway | Central entry point & request management | JWT auth, rate limiting | 
| CDN | Cache & deliver static content fast | Images, JS, CSS from nearest edge server |