Posts

Showing posts from May, 2026

📘 Load Balancer – Complete Concept

              📘 Load Balancer – Complete Concept  🔹 1. What is a Load Balancer? A Load Balancer distributes incoming network traffic across multiple servers to ensure: High availability Better performance No single server overload 👉 Example: Instead of 1 server handling 10,000 users, LB splits traffic across 5 servers. 🔹 2. Why Do We Need It? Without LB: Server crash = whole app down  Slow response under heavy traffic  With LB: Fault tolerance  Scalability  High performance  🧠 First: What is IP & Port? IP address = identifies a machine 👉 like house address ( 192.168.1.1 ) Port = identifies a service inside that machine 👉 like room number 80 → HTTP 443 → HTTPS 3306 → MySQL 🔹 3. Types of Load Balancer (A) Based on Layer (OSI Model) 1. Layer 4 (Transport Level) Works on IP + Port Faster, less intelligent Example: TCP routing 2. Layer 7 (Application Level) Wo...

What is IP & Port?

  🌐 First: What is IP & Port? IP address = identifies a machine 👉 like house address ( 192.168.1.1 ) Port = identifies a service inside that machine 👉 like room number 80 → HTTP 443 → HTTPS 3306 → MySQL

🌐 When You Hit a URL (Full Flow)

  🔹 1. You Enter URL in Browser Example: https://example.com Browser parses: Protocol → HTTPS Domain → example.com 🔹 2. DNS Resolution (Domain → IP) Browser checks cache → OS cache → ISP DNS If not found, DNS lookup happens Domain resolves to IP (usually Load Balancer) 👉 Now browser knows where to send request 🔹 3. TCP Connection (3-Way Handshake) Browser connects to server IP: SYN SYN-ACK ACK 👉 Connection established 🔹 4. HTTPS / SSL Handshake (Security 🔐) Server sends SSL certificate Browser verifies it Encryption keys are exchanged 👉 Secure connection ready 🔹 5. Request Reaches Load Balancer Domain usually points to LB (public IP) Example tools: NGINX AWS Elastic Load Balancing 👉 LB decides which server should handle request 🔹 5. Request Reaches Load Balancer Domain usually points to LB (public IP) Example tools: NGINX AWS Elastic Load Balancing 👉 LB decides which server should handle request 🔹 7. Ap...

Which Database to Use, How to Decide?

  1. First ask these key questions Before choosing any database, be clear on: Data type → structured (tables) or unstructured (JSON, files) Scale → small app or millions of users Read vs Write → more reading or more writing Consistency vs Speed Relationships → complex joins needed or not 🧱 What is Structured Data? 👉 Structured data = data with a fixed format (schema) Stored in tables (rows & columns) Each field has a defined type Same structure for every record id name age salary 1 Ram 25 30000 2 Shyam 30 40000 👉 Here: Every row follows the same format Columns are fixed → id, name, age, salary Stored in: MySQL PostgreSQL 🧩 What is Unstructured Data? 👉 Unstructured data = no fixed format (“Unstructured means random data”) Data can vary for each record No strict schema Can be text, JSON, images, videos 📌 Example (JSON) {   "name": "Ram",   "age": 25 } {   "name": "Shyam",   "address...