<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Dailydev.in Newsletter]]></title><description><![CDATA[Save time and level up your engineering skills with DailyDev.in. Get concise, actionable insights into system design, research, and big tech case studies delivered weekly. Subscribe now!]]></description><link>https://blog.dailydev.in</link><image><url>https://substackcdn.com/image/fetch/$s_!606o!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb45c683d-6d98-4a5e-94b6-d82f49679f03_500x500.png</url><title>Dailydev.in Newsletter</title><link>https://blog.dailydev.in</link></image><generator>Substack</generator><lastBuildDate>Wed, 06 May 2026 12:11:04 GMT</lastBuildDate><atom:link href="https://blog.dailydev.in/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Dailydev.in]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[dailydevin@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[dailydevin@substack.com]]></itunes:email><itunes:name><![CDATA[Yashraj Balidani]]></itunes:name></itunes:owner><itunes:author><![CDATA[Yashraj Balidani]]></itunes:author><googleplay:owner><![CDATA[dailydevin@substack.com]]></googleplay:owner><googleplay:email><![CDATA[dailydevin@substack.com]]></googleplay:email><googleplay:author><![CDATA[Yashraj Balidani]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Building AI Agents from Scratch: A Complete Guide (2026) ]]></title><description><![CDATA[Build production-ready AI agents with Python and LangChain. Step-by-step tutorial with code examples, tools, memory systems and deployments.]]></description><link>https://blog.dailydev.in/p/building-ai-agents-from-scratch-a</link><guid isPermaLink="false">https://blog.dailydev.in/p/building-ai-agents-from-scratch-a</guid><dc:creator><![CDATA[Yashraj Balidani]]></dc:creator><pubDate>Fri, 09 Jan 2026 16:14:51 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/fb38c5eb-cca9-47ab-afc3-d21e6150e712_1600x843.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2><strong>Introduction: The Age of AI Agents is Here</strong></h2><p>In 2024, we witnessed a fundamental shift in how we interact with AI. We moved from <strong>asking AI questions</strong> to <strong>letting AI take actions</strong>. ChatGPT&#8217;s o1 model brought advanced reasoning, Claude 3.5 Sonnet showcased unprecedented tool use, and frameworks like LangChain and LangGraph matured into production-ready platforms.</p><p>But here&#8217;s what changed everything: <strong>AI agents can now autonomously plan, execute, and iterate on complex tasks</strong>&#8212;from debugging your entire codebase to orchestrating multi-step workflows across different tools and APIs.</p><p>If you&#8217;ve been wondering how to build these autonomous systems yourself, you&#8217;re in the right place. In this comprehensive guide, we&#8217;ll go from zero to a fully functional AI agent that can reason, use tools, maintain memory, and handle real-world tasks.</p><h3><strong>What You&#8217;ll Learn</strong></h3><ul><li><p><strong>Conceptual Foundation</strong>: What AI agents really are (beyond the hype)</p></li><li><p><strong>Architecture Patterns</strong>: ReAct, Plan-and-Execute, Reflection, and Multi-Agent systems</p></li><li><p><strong>Hands-On Implementation</strong>: Build a working agent from scratch with Python</p></li><li><p><strong>Production Considerations</strong>: Testing, monitoring, security, and scaling</p></li><li><p><strong>Real-World Case Studies</strong>: How companies are deploying agents today</p></li></ul><h3><strong>Prerequisites</strong></h3><ul><li><p><strong>Python 3.9+</strong> and basic programming knowledge</p></li><li><p><strong>LLM API access</strong> (OpenAI, Anthropic, or Google)</p></li><li><p><strong>Basic understanding</strong> of REST APIs and async programming</p></li><li><p><strong>Optional</strong>: Docker knowledge for deployment</p></li></ul><blockquote><p>Let&#8217;s dive in.</p></blockquote><div><hr></div><h2><strong>Part 1: Understanding AI Agents</strong></h2><h3><strong>What is an AI Agent?</strong></h3><p>An <strong>AI agent</strong> is an autonomous system that uses a Large Language Model (LLM) as its &#8220;brain&#8221; to perceive its environment, make decisions, take actions, and learn from feedback&#8212;all without continuous human intervention.</p><p>Think of it this way:</p><pre><code>Traditional Chatbot:
User &#8594; Prompt &#8594; LLM &#8594; Response &#8594; Done

AI Agent:
User &#8594; Goal &#8594; Agent (loops):
  1. Analyze current state
  2. Plan next action
  3. Execute with tools
  4. Observe results
  5. Decide: continue or finish
&#8594; Final outcome</code></pre><h3><strong>The Four Core Components</strong></h3><blockquote><p><strong>&#129504; Brain (LLM)</strong></p></blockquote><ul><li><p>The reasoning engine (GPT-4, Claude, Gemini)</p></li><li><p>Interprets goals, plans actions, processes results</p></li><li><p>Handles decision-making and natural language</p></li></ul><blockquote><p><strong>&#128736;&#65039; Tools (Functions)</strong></p></blockquote><ul><li><p>External capabilities the agent can invoke</p></li><li><p>Examples: web search, code execution, API calls, database queries</p></li><li><p>Defined with clear descriptions for the LLM</p></li></ul><blockquote><p><strong>&#128190; Memory (Context)</strong></p></blockquote><ul><li><p>Short-term: Conversation history, immediate context</p></li><li><p>Long-term: Vector stores, knowledge bases, past experiences</p></li><li><p>Enables learning and personalization</p></li></ul><blockquote><p><strong>&#128260; Control Loop (Orchestration)</strong></p></blockquote><ul><li><p>The execution framework</p></li><li><p>Manages reasoning &#8594; action &#8594; observation cycles</p></li><li><p>Handles errors, retries, and termination conditions</p></li></ul><h3><strong>AI Agent vs Traditional Chatbot</strong></h3><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\n\\begin{array}{|l|l|l|}\n\\hline\n\\textbf{Aspect} &amp; \\textbf{Chatbot} &amp; \\textbf{AI Agent} \\\\\n\\hline\n\\textbf{Interaction} &amp; \\text{Single-turn Q\\&amp;A} &amp; \\text{Multi-step task execution} \\\\\n\\hline\n\\textbf{Autonomy} &amp; \\text{Reactive only} &amp; \\text{Proactive goal-seeking} \\\\\n\\hline\n\\textbf{Tool Use} &amp; \\text{None or limited} &amp; \\text{Dynamic tool selection} \\\\\n\\hline\n\\textbf{Memory} &amp; \\text{Session-only} &amp; \\text{Persistent across sessions} \\\\\n\\hline\n\\textbf{Planning} &amp; \\text{No planning} &amp; \\text{Strategic decomposition} \\\\\n\\hline\n\\textbf{Error Handling} &amp; \\text{Give up} &amp; \\text{Retry with different approach} \\\\\n\\hline\n\\end{array}&quot;,&quot;id&quot;:&quot;CEQSLWHEUD&quot;}" data-component-name="LatexBlockToDOM"></div><h3><strong>Real-World Use Cases</strong></h3><p>Here&#8217;s where AI agents are making an impact right now:</p><blockquote><p><strong>&#128295; Software Development</strong></p></blockquote><ul><li><p>Autonomous code generation and debugging</p></li><li><p>Test case creation and execution</p></li><li><p>Code review and refactoring suggestions</p></li><li><p><strong>Example</strong>: Devin AI, GitHub Copilot Workspace</p></li></ul><blockquote><p><strong>&#128202; Data Analysis</strong></p></blockquote><ul><li><p>Automated data exploration and visualization</p></li><li><p>Generating insights from complex datasets</p></li><li><p>Building and executing SQL queries</p></li><li><p><strong>Example</strong>: Julius AI, Continual</p></li></ul><blockquote><p><strong>&#127911; Customer Support</strong></p></blockquote><ul><li><p>Multi-step problem resolution</p></li><li><p>Ticket routing and escalation</p></li><li><p>Knowledge base search and updates</p></li><li><p><strong>Example</strong>: Sierra, Ada</p></li></ul><blockquote><p><strong>&#9881;&#65039; DevOps Automation</strong></p></blockquote><ul><li><p>Infrastructure monitoring and remediation</p></li><li><p>Deployment orchestration</p></li><li><p>Log analysis and root cause detection</p></li><li><p><strong>Example</strong>: Kubiya, Relay.app</p></li></ul><blockquote><p><strong>&#128300; Research &amp; Synthesis</strong></p></blockquote><ul><li><p>Literature review and summarization</p></li><li><p>Multi-source information gathering</p></li><li><p>Report generation with citations</p></li><li><p><strong>Example</strong>: Elicit, Consensus</p></li></ul><div><hr></div><h2><strong>Part 2: Agent Architecture Patterns</strong></h2><p>Let&#8217;s explore the four foundational patterns that power modern AI agents.</p><h3><strong>Pattern 1: ReAct (Reasoning + Acting)</strong></h3><p><strong>The most popular agent pattern</strong>, combining reasoning traces with action execution.</p><blockquote><p><strong>How it works:</strong></p></blockquote><ol><li><p><strong>Thought</strong>: Agent reasons about what to do</p></li><li><p><strong>Action</strong>: Selects and executes a tool</p></li><li><p><strong>Observation</strong>: Receives tool output</p></li><li><p><strong>Repeat</strong>: Until task is complete</p></li></ol><blockquote><p><strong>When to use:</strong></p></blockquote><ul><li><p>Interactive tasks requiring iterative refinement</p></li><li><p>When you need visibility into agent&#8217;s reasoning</p></li><li><p>Tasks with multiple possible approaches</p></li></ul><blockquote><p><strong>Example flow:</strong></p></blockquote><pre><code><code>User: "What's the weather in the location where the Eiffel Tower is?"

Thought: I need to first find where the Eiffel Tower is located
Action: search("Eiffel Tower location")
Observation: The Eiffel Tower is in Paris, France

Thought: Now I can get the weather for Paris
Action: get_weather("Paris, France")
Observation: 15&#176;C, Partly Cloudy

Thought: I have the answer
Final Answer: It's 15&#176;C and partly cloudy in Paris, where the Eiffel Tower is located.</code></code></pre><h3><strong>Pattern 2: Plan-and-Execute</strong></h3><p><strong>Strategic decomposition</strong> of complex tasks into sub-tasks before execution.</p><blockquote><p><strong>How it works:</strong></p></blockquote><ol><li><p><strong>Plan</strong>: Break down goal into sequential steps</p></li><li><p><strong>Execute</strong>: Run each step with tools</p></li><li><p><strong>Replanning</strong>: Adjust plan based on results</p></li><li><p><strong>Completion</strong>: Aggregate outcomes</p></li></ol><blockquote><p><strong>When to use:</strong></p></blockquote><ul><li><p>Complex multi-step workflows</p></li><li><p>When task dependencies are clear</p></li><li><p>Need for parallelization</p></li></ul><blockquote><p><strong>Example flow:</strong></p></blockquote><pre><code><code>User: "Analyze our competitor's latest product launch"

Plan:
1. Search for competitor's recent announcements
2. Gather product details and features
3. Analyze pricing and positioning
4. Compare with our offerings
5. Generate SWOT analysis

Execute each step with appropriate tools &#8594;
Synthesize final report</code></code></pre><h3><strong>Pattern 3: Reflection</strong></h3><p><strong>Self-critique and improvement</strong> through iterative refinement.</p><blockquote><p><strong>How it works:</strong></p></blockquote><ol><li><p><strong>Generate</strong>: Produce initial output</p></li><li><p><strong>Reflect</strong>: Critique own work</p></li><li><p><strong>Improve</strong>: Generate refined version</p></li><li><p><strong>Repeat</strong>: Until quality threshold met</p></li></ol><blockquote><p><strong>When to use:</strong></p></blockquote><ul><li><p>Creative tasks (writing, design)</p></li><li><p>Quality-critical outputs</p></li><li><p>When &#8220;good enough&#8221; isn&#8217;t acceptable</p></li></ul><blockquote><p><strong>Example flow:</strong></p></blockquote><pre><code><code>Task: Write a product description

Draft 1: [Generated text]
Reflection: Too technical, lacks emotional appeal
Draft 2: [Improved version]
Reflection: Better, but missing key benefit
Draft 3: [Final polished version]
Quality Score: 9/10 &#8594; Accept</code></code></pre><h3><strong>Pattern 4: Multi-Agent</strong></h3><p><strong>Specialized agents</strong> collaborating on complex problems.</p><blockquote><p><strong>How it works:</strong></p></blockquote><ol><li><p><strong>Delegation</strong>: Manager agent assigns sub-tasks</p></li><li><p><strong>Specialization</strong>: Each agent has specific expertise</p></li><li><p><strong>Communication</strong>: Agents share findings</p></li><li><p><strong>Synthesis</strong>: Coordinator combines results</p></li></ol><blockquote><p><strong>When to use:</strong></p></blockquote><ul><li><p>Highly complex problems</p></li><li><p>Need for domain expertise</p></li><li><p>Parallel execution benefits</p></li><li><p>Different reasoning approaches needed</p></li></ul><blockquote><p><strong>Example structure:</strong></p></blockquote><pre><code><code>Manager Agent
&#9500;&#9472;&#9472; Research Agent (web search, synthesis)
&#9500;&#9472;&#9472; Code Agent (implementation, testing)
&#9500;&#9472;&#9472; QA Agent (validation, edge cases)
&#9492;&#9472;&#9472; Documentation Agent (writing, examples)</code></code></pre><div><hr></div><h2><strong>Part 3: Building Your First Agent (Hands-On)</strong></h2><p>Now let&#8217;s build a practical AI agent from scratch. We&#8217;ll create a <strong>Research Assistant</strong> that can search the web, analyze content, and generate reports.</p><h3><strong>Step 1: Environment Setup</strong></h3><p>First, install required packages:</p><pre><code><code># Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install langchain langchain-openai langchain-community
pip install duckduckgo-search python-dotenv
pip install faiss-cpu  # For vector storage
</code></code></pre><p>Create <code>.env</code> file:</p><pre><code><code>OPENAI_API_KEY=your_api_key_here</code></code></pre><h3><strong>Step 2: Create Custom Tools</strong></h3><p>Tools are functions your agent can call. Let&#8217;s create three essential tools:</p><pre><code><code># tools.py
from langchain.tools import tool
from duckduckgo_search import DDGS
import requests
from bs4 import BeautifulSoup
from typing import Optional

@tool
def search_web(query: str) -&gt; str:
    """
    Search the web for information using DuckDuckGo.
    
    Args:
        query: The search query string
        
    Returns:
        Formatted search results with titles and snippets
    """
    try:
        with DDGS() as ddgs:
            results = list(ddgs.text(query, max_results=5))
            
        if not results:
            return "No results found."
            
        formatted_results = []
        for i, result in enumerate(results, 1):
            formatted_results.append(
                f"{i}. {result['title']}\n"
                f"   {result['body']}\n"
                f"   URL: {result['href']}\n"
            )
            
        return "\n".join(formatted_results)
    except Exception as e:
        return f"Search error: {str(e)}"


@tool
def fetch_webpage_content(url: str) -&gt; str:
    """
    Fetch and extract main text content from a webpage.
    
    Args:
        url: The webpage URL to fetch
        
    Returns:
        Extracted text content (first 2000 chars)
    """
    try:
        response = requests.get(url, timeout=10)
        response.raise_for_status()
        
        soup = BeautifulSoup(response.content, 'html.parser')
        
        # Remove script and style elements
        for script in soup(["script", "style"]):
            script.decompose()
            
        # Get text
        text = soup.get_text()
        
        # Clean up whitespace
        lines = (line.strip() for line in text.splitlines())
        chunks = (phrase.strip() for line in lines for phrase in line.split("  "))
        text = ' '.join(chunk for chunk in chunks if chunk)
        
        # Return first 2000 characters
        return text[:2000] + "..." if len(text) &gt; 2000 else text
        
    except Exception as e:
        return f"Error fetching {url}: {str(e)}"


@tool
def calculate(expression: str) -&gt; str:
    """
    Safely evaluate mathematical expressions.
    
    Args:
        expression: Math expression (e.g., "2 + 2 * 3")
        
    Returns:
        Calculation result
    """
    try:
        # Safe evaluation - only allow basic math
        allowed_chars = set("0123456789+-*/.()")
        if not all(c in allowed_chars or c.isspace() for c in expression):
            return "Invalid expression: only basic math operations allowed"
            
        result = eval(expression, {"__builtins__": {}}, {})
        return f"Result: {result}"
    except Exception as e:
        return f"Calculation error: {str(e)}"</code></code></pre><h3><strong>Step 3: Build the Agent</strong></h3><p>Now let&#8217;s create the agent with ReAct pattern:</p><pre><code><code># agent.py
from langchain.agents import create_react_agent, AgentExecutor
from langchain_openai import ChatOpenAI
from langchain.prompts import PromptTemplate
from langchain.memory import ConversationBufferMemory
from tools import search_web, fetch_webpage_content, calculate
import os
from dotenv import load_dotenv

load_dotenv()

# Initialize LLM
llm = ChatOpenAI(
    model="gpt-4",
    temperature=0,  # Deterministic for consistency
    api_key=os.getenv("OPENAI_API_KEY")
)

# Define tools
tools = [search_web, fetch_webpage_content, calculate]

# Create custom prompt template
template = """You are a helpful research assistant with access to various tools.
Answer the user's question as best you can. You have access to the following tools:

{tools}

Use the following format:

Question: the input question you must answer
Thought: you should always think about what to do
Action: the action to take, should be one of [{tool_names}]
Action Input: the input to the action
Observation: the result of the action
... (this Thought/Action/Action Input/Observation can repeat N times)
Thought: I now know the final answer
Final Answer: the final answer to the original input question

Important guidelines:
- Be thorough and use tools when needed
- Cite sources when providing information
- If you don't know something, search for it
- Break complex questions into steps

Begin!

Question: {input}
Thought: {agent_scratchpad}
"""

prompt = PromptTemplate.from_template(template)

# Create the agent
agent = create_react_agent(
    llm=llm,
    tools=tools,
    prompt=prompt
)

# Create memory
memory = ConversationBufferMemory(
    memory_key="chat_history",
    return_messages=True
)

# Create agent executor
agent_executor = AgentExecutor(
    agent=agent,
    tools=tools,
    memory=memory,
    verbose=True,  # Show reasoning steps
    max_iterations=10,  # Prevent infinite loops
    handle_parsing_errors=True,  # Graceful error handling
    return_intermediate_steps=True
)

def run_agent(question: str):
    """
    Run the agent with a question and return results.
    """
    try:
        result = agent_executor.invoke({"input": question})
        return {
            "answer": result["output"],
            "steps": result.get("intermediate_steps", [])
        }
    except Exception as e:
        return {
            "answer": f"Error: {str(e)}",
            "steps": []
        }


# Example usage
if __name__ == "__main__":
    # Simple test
    question = "What are the latest developments in AI agents? Provide a summary with sources."
    
    print(f"Question: {question}\n")
    print("=" * 80)
    
    result = run_agent(question)
    
    print("\nFinal Answer:")
    print(result["answer"])
    
    print("\n" + "=" * 80)
    print(f"Completed in {len(result['steps'])} steps")
</code></code></pre><h3><strong>Step 4: Add Memory for Context</strong></h3><p>Let&#8217;s enhance our agent with persistent memory:</p><pre><code><code># memory_agent.py
from langchain.memory import ConversationBufferWindowMemory
from langchain_community.vectorstores import FAISS
from langchain_openai import OpenAIEmbeddings
from langchain.text_splitter import RecursiveCharacterTextSplitter
from typing import List, Dict

class MemoryEnhancedAgent:
    """Agent with both short-term and long-term memory."""
    
    def __init__(self, agent_executor):
        self.agent_executor = agent_executor
        
        # Short-term memory: last 5 interactions
        self.short_term = ConversationBufferWindowMemory(
            k=5,
            memory_key="chat_history",
            return_messages=True
        )
        
        # Long-term memory: vector store for facts
        self.embeddings = OpenAIEmbeddings()
        self.long_term = None  # Initialize on first use
        self.knowledge_base = []
        
    def remember(self, text: str, metadata: Dict = None):
        """Store information in long-term memory."""
        self.knowledge_base.append({
            "text": text,
            "metadata": metadata or {}
        })
        
        # Update vector store
        texts = [item["text"] for item in self.knowledge_base]
        metadatas = [item["metadata"] for item in self.knowledge_base]
        
        if self.long_term is None:
            self.long_term = FAISS.from_texts(
                texts, 
                self.embeddings,
                metadatas=metadatas
            )
        else:
            self.long_term.add_texts(texts, metadatas=metadatas)
    
    def recall(self, query: str, k: int = 3) -&gt; List[str]:
        """Retrieve relevant information from long-term memory."""
        if self.long_term is None:
            return []
            
        docs = self.long_term.similarity_search(query, k=k)
        return [doc.page_content for doc in docs]
    
    def run(self, question: str, use_memory: bool = True):
        """Run agent with memory context."""
        # Get relevant context from long-term memory
        context = ""
        if use_memory and self.long_term:
            relevant_info = self.recall(question)
            if relevant_info:
                context = f"\nRelevant context from past interactions:\n" + "\n".join(relevant_info)
        
        # Add context to question
        enhanced_question = question + context
        
        # Run agent
        result = self.agent_executor.invoke({"input": enhanced_question})
        
        # Store interaction in memory
        self.remember(
            f"Q: {question}\nA: {result['output']}",
            metadata={"type": "qa_pair"}
        )
        
        return result


# Example usage
if __name__ == "__main__":
    from agent import agent_executor
    
    memory_agent = MemoryEnhancedAgent(agent_executor)
    
    # First interaction
    result1 = memory_agent.run("What is LangChain?")
    print(result1["output"])
    
    # Second interaction - will remember previous context
    result2 = memory_agent.run("How do I use it for building agents?")
    print(result2["output"])
</code></code></pre><h3><strong>Step 5: Error Handling and Retries</strong></h3><p>Production agents need robust error handling:</p><pre><code><code># robust_agent.py
from typing import Any, Dict
import time
import logging
from functools import wraps

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

def retry_with_backoff(max_retries: int = 3, backoff_factor: float = 2.0):
    """Decorator for retrying functions with exponential backoff."""
    def decorator(func):
        @wraps(func)
        def wrapper(*args, **kwargs):
            retries = 0
            while retries &lt; max_retries:
                try:
                    return func(*args, **kwargs)
                except Exception as e:
                    retries += 1
                    if retries &gt;= max_retries:
                        logger.error(f"Max retries reached for {func.__name__}: {e}")
                        raise
                    
                    wait_time = backoff_factor ** retries
                    logger.warning(
                        f"Attempt {retries} failed for {func.__name__}: {e}. "
                        f"Retrying in {wait_time}s..."
                    )
                    time.sleep(wait_time)
        return wrapper
    return decorator


class RobustAgent:
    """Agent wrapper with error handling and monitoring."""
    
    def __init__(self, agent_executor):
        self.agent_executor = agent_executor
        self.metrics = {
            "total_runs": 0,
            "successful_runs": 0,
            "failed_runs": 0,
            "total_tokens": 0,
            "avg_response_time": 0
        }
    
    @retry_with_backoff(max_retries=3)
    def run(self, question: str, **kwargs) -&gt; Dict[str, Any]:
        """Run agent with monitoring and error handling."""
        start_time = time.time()
        self.metrics["total_runs"] += 1
        
        try:
            # Run agent
            result = self.agent_executor.invoke({"input": question}, **kwargs)
            
            # Update metrics
            self.metrics["successful_runs"] += 1
            response_time = time.time() - start_time
            
            # Update average response time
            n = self.metrics["successful_runs"]
            current_avg = self.metrics["avg_response_time"]
            self.metrics["avg_response_time"] = (
                (current_avg * (n - 1) + response_time) / n
            )
            
            logger.info(f"Agent completed in {response_time:.2f}s")
            
            return {
                "success": True,
                "output": result["output"],
                "steps": result.get("intermediate_steps", []),
                "metrics": {
                    "response_time": response_time,
                    "steps_count": len(result.get("intermediate_steps", []))
                }
            }
            
        except Exception as e:
            self.metrics["failed_runs"] += 1
            logger.error(f"Agent failed: {str(e)}")
            
            return {
                "success": False,
                "error": str(e),
                "output": None,
                "metrics": {
                    "response_time": time.time() - start_time
                }
            }
    
    def get_metrics(self) -&gt; Dict[str, Any]:
        """Return agent performance metrics."""
        success_rate = (
            self.metrics["successful_runs"] / self.metrics["total_runs"] * 100
            if self.metrics["total_runs"] &gt; 0 else 0
        )
        
        return {
            **self.metrics,
            "success_rate": f"{success_rate:.2f}%"
        }


# Example usage
if __name__ == "__main__":
    from agent import agent_executor
    
    robust_agent = RobustAgent(agent_executor)
    
    # Test with various questions
    questions = [
        "What is the capital of France?",
        "Calculate 15 * 23 + 100",
        "Search for latest AI developments and summarize"
    ]
    
    for q in questions:
        print(f"\nQuestion: {q}")
        result = robust_agent.run(q)
        
        if result["success"]:
            print(f"Answer: {result['output']}")
            print(f"Time: {result['metrics']['response_time']:.2f}s")
        else:
            print(f"Error: {result['error']}")
    
    # Print overall metrics
    print("\n" + "=" * 80)
    print("Agent Performance Metrics:")
    for key, value in robust_agent.get_metrics().items():
        print(f"  {key}: {value}")</code></code></pre><div><hr></div><h2><strong>Part 4: Advanced Concepts</strong></h2><h3><strong>Token Usage Optimization</strong></h3><p>LLM calls are expensive. Here&#8217;s how to optimize:</p><pre><code><code># token_optimizer.py
from langchain.callbacks import get_openai_callback
from typing import List

class TokenOptimizer:
    """Monitor and optimize token usage."""
    
    def __init__(self, agent_executor):
        self.agent_executor = agent_executor
        self.total_tokens = 0
        self.total_cost = 0.0
    
    def run_with_tracking(self, question: str):
        """Run agent and track token usage."""
        with get_openai_callback() as cb:
            result = self.agent_executor.invoke({"input": question})
            
            self.total_tokens += cb.total_tokens
            self.total_cost += cb.total_cost
            
            return {
                "output": result["output"],
                "tokens_used": cb.total_tokens,
                "cost": cb.total_cost,
                "prompt_tokens": cb.prompt_tokens,
                "completion_tokens": cb.completion_tokens
            }
    
    def get_stats(self):
        """Get cumulative usage statistics."""
        return {
            "total_tokens": self.total_tokens,
            "total_cost": f"${self.total_cost:.4f}",
            "avg_tokens_per_run": self.total_tokens / max(1, self.runs)
        }


# Tips for reducing token usage:
# 1. Use shorter prompts
# 2. Implement caching for repeated queries
# 3. Use smaller models for simple tasks
# 4. Trim conversation history aggressively
# 5. Compress context before sending to LLM</code></code></pre><h3><strong>Caching Strategies</strong></h3><blockquote><p>Avoid redundant API calls:</p></blockquote><pre><code><code># caching.py
from functools import lru_cache
import hashlib
import json
from typing import Any

class AgentCache:
    """Cache agent responses for common queries."""
    
    def __init__(self, max_size: int = 100):
        self.cache = {}
        self.max_size = max_size
        self.hits = 0
        self.misses = 0
    
    def _hash_query(self, question: str) -&gt; str:
        """Create hash of question for cache key."""
        return hashlib.md5(question.encode()).hexdigest()
    
    def get(self, question: str) -&gt; Any:
        """Get cached response if exists."""
        key = self._hash_query(question)
        if key in self.cache:
            self.hits += 1
            return self.cache[key]
        self.misses += 1
        return None
    
    def set(self, question: str, response: Any):
        """Cache a response."""
        if len(self.cache) &gt;= self.max_size:
            # Remove oldest entry (FIFO)
            self.cache.pop(next(iter(self.cache)))
        
        key = self._hash_query(question)
        self.cache[key] = response
    
    def get_hit_rate(self) -&gt; float:
        """Calculate cache hit rate."""
        total = self.hits + self.misses
        return (self.hits / total * 100) if total &gt; 0 else 0


# Usage example
cache = AgentCache()

def cached_agent_run(question: str, agent_executor):
    # Check cache first
    cached = cache.get(question)
    if cached:
        print("&#10003; Cache hit!")
        return cached
    
    # Run agent
    result = agent_executor.invoke({"input": question})
    
    # Store in cache
    cache.set(question, result)
    
    return result</code></code></pre><div><hr></div><h2><strong>Part 5: Production Deployment</strong></h2><h3><strong>Containerization with Docker</strong></h3><pre><code><code># Dockerfile
FROM python:3.11-slim

WORKDIR /app

# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy application
COPY . .

# Environment variables
ENV PYTHONUNBUFFERED=1
ENV OPENAI_API_KEY=${OPENAI_API_KEY}

# Run application
CMD ["python", "api_server.py"]
</code></code></pre><pre><code><code># api_server.py
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
from agent import agent_executor
from robust_agent import RobustAgent
import uvicorn

app = FastAPI(title="AI Agent API")
robust_agent = RobustAgent(agent_executor)

class Query(BaseModel):
    question: str
    use_memory: bool = True

class Response(BaseModel):
    success: bool
    output: str
    steps_count: int
    response_time: float

@app.post("/query", response_model=Response)
async def query_agent(query: Query):
    """Run agent with user question."""
    try:
        result = robust_agent.run(query.question)
        
        if not result["success"]:
            raise HTTPException(status_code=500, detail=result["error"])
        
        return Response(
            success=True,
            output=result["output"],
            steps_count=result["metrics"]["steps_count"],
            response_time=result["metrics"]["response_time"]
        )
    except Exception as e:
        raise HTTPException(status_code=500, detail=str(e))

@app.get("/health")
async def health_check():
    """Health check endpoint."""
    return {"status": "healthy", "metrics": robust_agent.get_metrics()}

@app.get("/metrics")
async def get_metrics():
    """Get agent performance metrics."""
    return robust_agent.get_metrics()

if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=8000)
</code></code></pre><h3><strong>Monitoring with LangSmith</strong></h3><pre><code><code># monitoring.py
import os
os.environ["LANGCHAIN_TRACING_V2"] = "true"
os.environ["LANGCHAIN_API_KEY"] = "your_langsmith_key"
os.environ["LANGCHAIN_PROJECT"] = "ai-agent-production"

# Now all agent runs will be tracked in LangSmith
from agent import agent_executor

result = agent_executor.invoke({"input": "test question"})
# View traces at https://smith.langchain.com
</code></code></pre><h3><strong>Security Best Practices</strong></h3><pre><code><code># security.py
import os
import re
from typing import List

class SecurityValidator:
    """Validate inputs and outputs for security."""
    
    # Dangerous patterns to block
    DANGEROUS_PATTERNS = [
        r"(?i)drop\s+table",
        r"(?i)delete\s+from",
        r"(?i)truncate\s+table",
        r"(?i)&lt;script",
        r"(?i)javascript:",
        r"(?i)eval\s*\(",
        r"(?i)exec\s*\(",
    ]
    
    @classmethod
    def validate_input(cls, user_input: str) -&gt; tuple[bool, str]:
        """Check if input contains dangerous patterns."""
        for pattern in cls.DANGEROUS_PATTERNS:
            if re.search(pattern, user_input):
                return False, f"Input contains prohibited pattern: {pattern}"
        
        # Check input length
        if len(user_input) &gt; 5000:
            return False, "Input too long (max 5000 characters)"
        
        return True, "OK"
    
    @classmethod
    def sanitize_output(cls, output: str) -&gt; str:
        """Remove sensitive information from output."""
        # Remove API keys (simple pattern)
        output = re.sub(r'[A-Za-z0-9]{32,}', '[REDACTED]', output)
        
        # Remove potential file paths
        output = re.sub(r'/[a-zA-Z0-9/_\-\.]+', '[PATH]', output)
        
        return output


# Usage in agent
def secure_agent_run(question: str, agent_executor):
    # Validate input
    is_valid, message = SecurityValidator.validate_input(question)
    if not is_valid:
        return {"error": message}
    
    # Run agent
    result = agent_executor.invoke({"input": question})
    
    # Sanitize output
    result["output"] = SecurityValidator.sanitize_output(result["output"])
    
    return result</code></code></pre><div><hr></div><h2><strong>Part 6: Real-World Case Studies</strong></h2><h3><strong>Case Study 1: Customer Support Automation</strong></h3><p><strong>Company</strong>: Mid-size SaaS company <strong>Problem</strong>: 500+ support tickets daily, 2-hour average response time <strong>Solution</strong>: AI agent with access to documentation, ticketing system, and user database</p><blockquote><p><strong>Results</strong>:</p></blockquote><ul><li><p>&#9889; 80% reduction in response time (2h &#8594; 24min)</p></li><li><p>&#127919; 60% of tier-1 tickets fully automated</p></li><li><p>&#128176; $200K annual savings in support costs</p></li><li><p>&#128522; Customer satisfaction increased from 3.2 to 4.6/5</p></li></ul><blockquote><p><strong>Technical Implementation</strong>:</p></blockquote><pre><code><code># Support agent tools
@tool
def search_docs(query: str) -&gt; str:
    """Search internal documentation."""
    # Vector search in knowledge base
    ...

@tool
def get_user_info(email: str) -&gt; str:
    """Get user account details."""
    # Query user database
    ...

@tool
def create_ticket(title: str, description: str) -&gt; str:
    """Create ticket for human agent."""
    # Escalation for complex issues
    ...
</code></code></pre><h3><strong>Case Study 2: Code Review Assistant</strong></h3><p><strong>Company</strong>: Tech startup with distributed team <strong>Problem</strong>: Inconsistent code review quality, bottleneck for senior devs <strong>Solution</strong>: AI agent analyzing PRs for bugs, style, security issues</p><blockquote><p><strong>Results</strong>:</p></blockquote><ul><li><p>&#128027; 30% increase in bug detection pre-merge</p></li><li><p>&#9201;&#65039; 45% reduction in review time</p></li><li><p>&#128218; Consistent enforcement of coding standards</p></li><li><p>&#127891; Junior developers learning faster from feedback</p></li></ul><blockquote><p><strong>Key Features</strong>:</p></blockquote><ul><li><p>Static analysis integration</p></li><li><p>Security vulnerability scanning</p></li><li><p>Performance impact estimation</p></li><li><p>Automated suggestions with explanations</p></li></ul><h3><strong>Case Study 3: Data Analysis Pipeline</strong></h3><p><strong>Company</strong>: E-commerce analytics team <strong>Problem</strong>: 10+ hours weekly on repetitive data analysis tasks <strong>Solution</strong>: Agent that queries databases, generates visualizations, and creates reports</p><blockquote><p><strong>Results</strong>:</p></blockquote><ul><li><p>&#9200; 10 hours/week saved per analyst</p></li><li><p>&#128202; Daily automated reports instead of weekly</p></li><li><p>&#128269; Proactive anomaly detection</p></li><li><p>&#128161; Insights delivered 5x faster</p></li></ul><blockquote><p><strong>Implementation Highlight</strong>:</p></blockquote><pre><code><code>@tool
def query_database(sql: str) -&gt; str:
    """Execute SQL query safely."""
    # Validate SQL, run in read-only mode
    ...

@tool
def create_visualization(data: str, chart_type: str) -&gt; str:
    """Generate chart from data."""
    # Use plotly/matplotlib
    ...

@tool
def generate_insights(data: str) -&gt; str:
    """Analyze data and find patterns."""
    # Statistical analysis + LLM interpretation
    ...</code></code></pre><div><hr></div><h2><strong>Part 7: Framework Comparison</strong></h2><h3><strong>LangChain vs LangGraph vs CrewAI vs AutoGen</strong></h3><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\begin{array}{|l|l|l|l|l|}\n\\hline\n\\textbf{Feature} &amp; \\textbf{LangChain} &amp; \\textbf{LangGraph} &amp; \\textbf{CrewAI} &amp; \\textbf{AutoGen} \\\\\n\\hline\n\\textbf{Best For} &amp; \\text{General agents} &amp; \\text{Complex workflows} &amp; \\text{Team collab} &amp; \\text{Code gen} \\\\\n\\hline\n\\textbf{Curve} &amp; \\text{Moderate} &amp; \\text{Steep} &amp; \\text{Easy} &amp; \\text{Moderate} \\\\\n\\hline\n\\textbf{Flexibility} &amp; \\text{High} &amp; \\text{Very High} &amp; \\text{Medium} &amp; \\text{High} \\\\\n\\hline\n\\textbf{Graph-Based} &amp; \\text{No} &amp; \\text{Yes} &amp; \\text{No} &amp; \\text{No} \\\\\n\\hline\n\\textbf{Multi-Agent} &amp; \\text{Basic} &amp; \\text{Advanced} &amp; \\text{Excellent} &amp; \\text{Excellent} \\\\\n\\hline\n\\textbf{Prod Ready} &amp; \\text{Yes} &amp; \\text{Yes} &amp; \\text{Growing} &amp; \\text{Yes} \\\\\n\\hline\n\\textbf{Community} &amp; \\text{Largest} &amp; \\text{Growing} &amp; \\text{Active} &amp; \\text{MS-backed} \\\\\n\\hline\n\\end{array}&quot;,&quot;id&quot;:&quot;JPEHLNKBTG&quot;}" data-component-name="LatexBlockToDOM"></div><blockquote><p><strong>Recommendation</strong>:</p></blockquote><ul><li><p>Start with <strong>LangChain</strong> for learning and simple agents</p></li><li><p>Use <strong>LangGraph</strong> for complex, stateful workflows</p></li><li><p>Try <strong>CrewAI</strong> for role-based multi-agent systems</p></li><li><p>Consider <strong>AutoGen</strong> for code-heavy tasks</p></li></ul><div><hr></div><h2><strong>Part 8: Testing Your Agent</strong></h2><pre><code><code># test_agent.py
import pytest
from agent import run_agent

class TestAgent:
    """Test suite for AI agent."""
    
    def test_basic_query(self):
        """Test simple question answering."""
        result = run_agent("What is 2+2?")
        assert "4" in result["answer"]
    
    def test_web_search(self):
        """Test tool usage - web search."""
        result = run_agent("What is the capital of Japan?")
        assert "Tokyo" in result["answer"]
        assert len(result["steps"]) &gt; 0  # Agent used tools
    
    def test_error_handling(self):
        """Test agent handles errors gracefully."""
        result = run_agent("Search for @@@invalid###")
        assert result["answer"] is not None  # Should not crash
    
    def test_multi_step_reasoning(self):
        """Test complex multi-step task."""
        question = "Find the population of the country where Mount Fuji is located"
        result = run_agent(question)
        
        # Should involve multiple steps
        assert len(result["steps"]) &gt;= 2
        assert "Japan" in result["answer"]
    
    @pytest.mark.slow
    def test_token_limit(self):
        """Ensure agent respects token limits."""
        # Very long question
        long_question = "Explain " + "AI " * 1000
        result = run_agent(long_question)
        
        # Should handle gracefully without hitting limits
        assert "error" not in result["answer"].lower()


# Run with: pytest test_agent.py -v</code></code></pre><div><hr></div><h2><strong>Part 9: Common Pitfalls and Solutions</strong></h2><h3><strong>Pitfall 1: Infinite Loops</strong></h3><p><strong>Problem</strong>: Agent keeps repeating the same action <strong>Solution</strong>: Set <code>max_iterations</code> and add loop detection</p><pre><code><code>agent_executor = AgentExecutor(
    agent=agent,
    tools=tools,
    max_iterations=10,  # Stop after 10 steps
    early_stopping_method="generate"  # Force answer if stuck
)
</code></code></pre><h3><strong>Pitfall 2: Tool Hallucination</strong></h3><p><strong>Problem</strong>: Agent claims to use tools that don&#8217;t exist <strong>Solution</strong>: Clear tool descriptions and few-shot examples</p><pre><code><code>@tool
def my_tool(param: str) -&gt; str:
    """
    VERY CLEAR DESCRIPTION of what this tool does.
    
    Args:
        param: Exact description of this parameter
    
    Returns:
        What this tool returns
    
    Example:
        Input: "example input"
        Output: "example output"
    """
    ...
</code></code></pre><h3><strong>Pitfall 3: Cost Explosion</strong></h3><p><strong>Problem</strong>: Agent makes too many LLM calls <strong>Solution</strong>: Caching + smaller models for simple tasks</p><pre><code><code># Use GPT-3.5 for simple tasks, GPT-4 for complex
if is_simple_query(question):
    llm = ChatOpenAI(model="gpt-3.5-turbo", temperature=0)
else:
    llm = ChatOpenAI(model="gpt-4", temperature=0)
</code></code></pre><h3><strong>Pitfall 4: Context Window Overflow</strong></h3><p><strong>Problem</strong>: Conversation history too long <strong>Solution</strong>: Sliding window memory + summarization</p><pre><code><code>from langchain.memory import ConversationSummaryBufferMemory

memory = ConversationSummaryBufferMemory(
    llm=llm,
    max_token_limit=2000,  # Keep last 2000 tokens
    return_messages=True
)
</code></code></pre><div><hr></div><h2><strong>Conclusion: From POC to Production</strong></h2><blockquote><p>You&#8217;ve now learned how to: &#9989; Understand agent architectures and patterns &#9989; Build a working agent from scratch &#9989; Add memory, error handling, and monitoring &#9989; Deploy agents securely in production &#9989; Optimize for cost and performance</p></blockquote><h3><strong>Next Steps</strong></h3><ol><li><p><strong>Experiment</strong>: Modify the code, add new tools, try different LLMs</p></li><li><p><strong>Specialize</strong>: Build an agent for YOUR specific use case</p></li><li><p><strong>Scale</strong>: Deploy with Docker, add monitoring, handle errors</p></li><li><p><strong>Share</strong>: Open-source your agent, write about learnings</p></li><li><p><strong>Learn More</strong>: Join communities, read papers, follow developments</p></li></ol><h3><strong>Resources</strong></h3><blockquote><p><strong>&#128218; Documentation</strong>:</p></blockquote><ul><li><p><a href="https://python.langchain.com/docs/get_started/introduction">LangChain Docs</a></p></li><li><p><a href="https://langchain-ai.github.io/langgraph/">LangGraph Guide</a></p></li><li><p><a href="https://platform.openai.com/docs/guides/function-calling">OpenAI Function Calling</a></p></li></ul><blockquote><p><strong>&#128736;&#65039; Tools &amp; Frameworks</strong>:</p></blockquote><ul><li><p><a href="https://smith.langchain.com/">LangSmith</a> - Monitoring</p></li><li><p><a href="https://github.com/langchain-ai/langserve">LangServe</a> - Deployment</p></li><li><p><a href="https://github.com/microsoft/semantic-kernel">Semantic Kernel</a> - Alternative framework</p></li></ul><blockquote><p><strong>&#128101; Communities</strong>:</p></blockquote><ul><li><p><a href="https://discord.gg/langchain">LangChain Discord</a></p></li><li><p><a href="https://reddit.com/r/LangChain">r/LangChain</a></p></li><li><p><a href="https://community.langchain.com/">AI Agent Builders Forum</a></p></li></ul><blockquote><p><strong>&#128214; Further Reading</strong>:</p></blockquote><ul><li><p>&#8220;ReAct: Synergizing Reasoning and Acting in Language Models&#8221; (Paper)</p></li><li><p>&#8220;Reflexion: Language Agents with Verbal Reinforcement Learning&#8221; (Paper)</p></li><li><p>Andrew Ng&#8217;s AI Agents Course</p></li></ul><h3><strong>Get the Code</strong></h3><blockquote><p>All code from this tutorial is available on GitHub:</p><p><strong><a href="https://github.com/dailydevdotin/ai-agent-tutorial">github.com/dailydevdotin/ai-agent-tutorial</a></strong></p><p>&#11088; Star the repo | &#127860; Fork it | &#128172; Open issues</p></blockquote><h2><strong>Join the Discussion</strong></h2><p>What will you build with AI agents? Have questions about the implementation? Share in the comments below!</p><blockquote><p>&#128073; If you found this helpful, please <strong>share it</strong> with your network. &#128038; Tweet at me <a href="https://x.com/dailydevdotin">@dailydevdotin</a> &#128188; Connect on <a href="https://www.linkedin.com/company/dailydev-in/">LinkedIn</a></p></blockquote>]]></content:encoded></item><item><title><![CDATA[SD 10: What are ACID Transactions in Databases?]]></title><description><![CDATA[ACID Database Transactions: A Developer's Guide]]></description><link>https://blog.dailydev.in/p/what-are-acid-transactions</link><guid isPermaLink="false">https://blog.dailydev.in/p/what-are-acid-transactions</guid><dc:creator><![CDATA[Yashraj Balidani]]></dc:creator><pubDate>Wed, 26 Feb 2025 14:02:41 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!g4Oa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54d882b3-207b-4220-a673-39b52bc534a3_778x629.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Introduction</h2><p>Imagine you're building the next big e-commerce platform. A customer places an order, and your system needs to:</p><ol><li><p>Deduct items from inventory</p></li><li><p>Process the payment</p></li><li><p>Generate an order confirmation</p></li><li><p>Send a notification to the warehouse</p></li></ol><p>What happens if the payment succeeds but the inventory update fails? Or if your system crashes halfway through? These scenarios could leave your database in an inconsistent state, potentially causing lost sales or angry customers.</p><p>This is where ACID transactions come to the rescue. Let's dive deep into understanding what they are and why they're crucial for maintaining data integrity.</p><h2>What are ACID Transactions?</h2><p>ACID is an acronym that represents four critical properties that guarantee reliable database transactions:</p><ul><li><p>Atomicity</p></li><li><p>Consistency</p></li><li><p>Isolation</p></li><li><p>Durability</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!g4Oa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54d882b3-207b-4220-a673-39b52bc534a3_778x629.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!g4Oa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54d882b3-207b-4220-a673-39b52bc534a3_778x629.png 424w, https://substackcdn.com/image/fetch/$s_!g4Oa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54d882b3-207b-4220-a673-39b52bc534a3_778x629.png 848w, https://substackcdn.com/image/fetch/$s_!g4Oa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54d882b3-207b-4220-a673-39b52bc534a3_778x629.png 1272w, https://substackcdn.com/image/fetch/$s_!g4Oa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54d882b3-207b-4220-a673-39b52bc534a3_778x629.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!g4Oa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54d882b3-207b-4220-a673-39b52bc534a3_778x629.png" width="778" height="629" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/54d882b3-207b-4220-a673-39b52bc534a3_778x629.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/729a7eb8-bfe0-4fcd-850c-134cb362b590_778x629.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:629,&quot;width&quot;:778,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:62322,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://blog.dailydev.in/i/157729551?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F729a7eb8-bfe0-4fcd-850c-134cb362b590_778x629.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!g4Oa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54d882b3-207b-4220-a673-39b52bc534a3_778x629.png 424w, https://substackcdn.com/image/fetch/$s_!g4Oa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54d882b3-207b-4220-a673-39b52bc534a3_778x629.png 848w, https://substackcdn.com/image/fetch/$s_!g4Oa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54d882b3-207b-4220-a673-39b52bc534a3_778x629.png 1272w, https://substackcdn.com/image/fetch/$s_!g4Oa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54d882b3-207b-4220-a673-39b52bc534a3_778x629.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>Think of an ACID transaction like a space shuttle launch - it either succeeds completely or aborts safely. There's no "partial launch" scenario.</p><p>Let's explore each property in detail.</p><h2>1. Atomicity: All or Nothing</h2><h3>What is Atomicity?</h3><p>Atomicity ensures that a transaction is treated as a single, indivisible unit. Either all operations within the transaction succeed, or none of them do. There's no middle ground.</p><h3>Real-world Example</h3><p>Consider a bank transfer:</p><pre><code><code>BEGIN TRANSACTION;
    UPDATE accounts SET balance = balance - 1000 WHERE account_id = 'sender';
    UPDATE accounts SET balance = balance + 1000 WHERE account_id = 'receiver';
COMMIT;</code></code></pre><p>If either update fails:</p><ul><li><p>The entire transaction is rolled back</p></li><li><p>Both accounts return to their original state</p></li><li><p>No money is lost in limbo</p></li></ul><h3>Implementation Details</h3><p>Databases typically implement atomicity through:</p><ol><li><p>Write-Ahead Logging (WAL)</p><ul><li><p>Records intended changes before making them</p></li><li><p>Enables recovery if system fails mid-transaction</p></li></ul></li><li><p>Two-Phase Commit Protocol</p><ul><li><p>Prepare Phase: Ensure all parts can complete</p></li><li><p>Commit Phase: Actually perform the changes</p></li></ul></li></ol><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/p/what-are-acid-transactions?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.dailydev.in/p/what-are-acid-transactions?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><div><hr></div><h2>2. Consistency: Maintaining Valid States</h2><h3>What is Consistency?</h3><p>Consistency ensures that a transaction brings the database from one valid state to another valid state, maintaining all predefined rules and constraints.</p><h3>Example Scenario</h3><p>Consider an inventory system with a rule: "Stock quantity cannot be negative"</p><pre><code><code>BEGIN TRANSACTION;
    -- Current stock: 5 units
    UPDATE products 
    SET stock_quantity = stock_quantity - 10 
    WHERE product_id = 123;6COMMIT;</code></code></pre><p>This transaction would fail because:</p><ul><li><p>It would result in -5 units</p></li><li><p>Violates the non-negative constraint</p></li><li><p>Database remains in previous valid state</p></li></ul><h3>Key Consistency Rules</h3><ol><li><p>Referential Integrity</p></li><li><p>Unique Constraints</p></li><li><p>Check Constraints</p></li><li><p>Custom Business Rules</p></li></ol><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.dailydev.in/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><h2>3. Isolation: Concurrent Transaction Handling</h2><h3>What is Isolation?</h3><p>Isolation ensures that concurrent transactions execute as if they were running sequentially, preventing interference between them.</p><h3>Isolation Levels</h3><ol><li><p>Read Uncommitted (Lowest)</p><ul><li><p>Can read uncommitted changes</p></li><li><p>Prone to dirty reads</p></li></ul></li><li><p>Read Committed</p><ul><li><p>Only reads committed data</p></li><li><p>Prevents dirty reads</p></li></ul></li><li><p>Repeatable Read</p><ul><li><p>Ensures consistent reads</p></li><li><p>Prevents non-repeatable reads</p></li></ul></li><li><p>Serializable (Highest)</p><ul><li><p>Complete isolation</p></li><li><p>Highest consistency, lowest concurrency</p></li></ul></li></ol><h3>Common Isolation Problems</h3><ol><li><p>Dirty Reads</p></li></ol><pre><code><code>-- Transaction 1
BEGIN;
UPDATE accounts SET balance = 1000;
-- Not yet committed
-- Transaction 2
SELECT balance FROM accounts;
-- Reads uncommitted value (dirty read)</code></code></pre><ol start="2"><li><p>Non-repeatable Reads</p></li></ol><pre><code><code>-- Transaction 1
BEGIN;
SELECT balance FROM accounts; -- Returns 1000

-- Transaction 2
UPDATE accounts SET balance = 2000;
COMMIT;

-- Transaction 1
SELECT balance FROM accounts; -- Returns 2000 (different result)</code></code></pre><div><hr></div><h2>4. Durability: Permanent Changes</h2><h3>What is Durability?</h3><p>Durability guarantees that once a transaction is committed, it remains permanent even in the event of:</p><ul><li><p>System crashes</p></li><li><p>Power failures</p></li><li><p>Hardware failures</p></li></ul><h3>Implementation Techniques</h3><ol><li><p>Write-Ahead Logging</p></li></ol><pre><code><code>1. Record changes in log
2. Flush log to persistent storage
3. Apply changes to database
4. Mark transaction as committed</code></code></pre><ol start="2"><li><p>Replication</p></li></ol><ul><li><p>Maintain copies across multiple servers</p></li><li><p>Ensure data survives single-point failures</p></li></ul><h2>Best Practices for Working with ACID Transactions</h2><ol><li><p>Keep Transactions Short</p></li></ol><pre><code><code>-- Good
BEGIN;
    UPDATE users SET status = 'active';
    UPDATE audit_log SET last_login = CURRENT_TIMESTAMP;
COMMIT;

-- Bad (too many operations)
BEGIN;
    -- Multiple updates
    -- Complex calculations
    -- External API calls
    -- File operations
COMMIT;</code></code></pre><ol start="2"><li><p>Handle Errors Properly</p></li></ol><pre><code><code>try:
    begin_transaction()
    # ... perform operations
    commit_transaction()
except DatabaseError:
    rollback_transaction()
    handle_error()</code></code></pre><ol start="3"><li><p>Choose Appropriate Isolation Levels</p></li></ol><pre><code><code>-- For reading reference data
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;

-- For financial transactions
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;</code></code></pre><h2>Performance Considerations</h2><ol><li><p>Transaction Overhead</p></li></ol><ul><li><p>Each transaction requires additional processing</p></li><li><p>Logging mechanisms add I/O overhead</p></li><li><p>Higher isolation levels may reduce concurrency</p></li></ul><ol start="2"><li><p>Optimization Strategies</p></li></ol><pre><code><code>-- Group related operations
BEGIN;
    INSERT INTO orders (...)
    INSERT INTO order_items (...)
    UPDATE inventory (...)
COMMIT;

-- Instead of separate transactions for each</code></code></pre><h2>Common Pitfalls to Avoid</h2><ol><li><p>Transaction Scope Too Large</p></li><li><p>Not Handling Deadlocks</p></li><li><p>Inappropriate Isolation Levels</p></li><li><p>Missing Error Handling</p></li></ol><h2>Conclusion</h2><p>ACID transactions are fundamental to maintaining data integrity in database systems. Understanding and properly implementing them is crucial for building reliable applications.</p><h3>Key Takeaways:</h3><ul><li><p>Atomicity ensures all-or-nothing execution</p></li><li><p>Consistency maintains database rules</p></li><li><p>Isolation handles concurrent access</p></li><li><p>Durability guarantees persistence</p></li></ul><h2>Call to Action</h2><p>How do you handle transactions in your applications? Share your experiences and best practices in the comments below.</p><p>Want to learn more about database design and optimization? Subscribe to our newsletter for weekly in-depth technical articles.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Dailydev.in Newsletter! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[SD 9: What is Hashing: From Basics to Advanced]]></title><description><![CDATA[Learn everything about hashing - from basic concepts to advanced implementations. Discover practical examples, best practices, and real-world applications in this comprehensive guide.]]></description><link>https://blog.dailydev.in/p/sd-9-what-is-hashing</link><guid isPermaLink="false">https://blog.dailydev.in/p/sd-9-what-is-hashing</guid><dc:creator><![CDATA[Yashraj Balidani]]></dc:creator><pubDate>Wed, 19 Feb 2025 14:45:49 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac205671-870c-4d20-a6de-8796ff527a12_681x873.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Introduction</h2><p>In today's digital age, data security and efficient data management are paramount concerns for developers and organizations alike. At the heart of many security and performance solutions lies a fundamental concept: hashing. Whether you're storing passwords, verifying file integrity, or optimizing database operations, understanding hashing is crucial for any software engineer.</p><h2>What is Hashing?</h2><p>Hashing is a process that transforms input data of arbitrary size into a fixed-size output value, typically a string of characters. Think of it as a one-way function that takes your data and creates a unique "fingerprint" or digest. This transformation is performed using specialized algorithms called hash functions.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Dailydev.in Newsletter! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h3>Key Characteristics of Hashing:</h3><ol><li><p>Deterministic: The same input will always produce the same hash value</p></li><li><p>Fixed Output Size: Regardless of input size, the hash length remains constant</p></li><li><p>One-way Function: It's computationally infeasible to reverse the process</p></li><li><p>Avalanche Effect: Small changes in input create significantly different outputs</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9VJk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac205671-870c-4d20-a6de-8796ff527a12_681x873.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9VJk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac205671-870c-4d20-a6de-8796ff527a12_681x873.png 424w, https://substackcdn.com/image/fetch/$s_!9VJk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac205671-870c-4d20-a6de-8796ff527a12_681x873.png 848w, https://substackcdn.com/image/fetch/$s_!9VJk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac205671-870c-4d20-a6de-8796ff527a12_681x873.png 1272w, https://substackcdn.com/image/fetch/$s_!9VJk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac205671-870c-4d20-a6de-8796ff527a12_681x873.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9VJk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac205671-870c-4d20-a6de-8796ff527a12_681x873.png" width="681" height="873" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ac205671-870c-4d20-a6de-8796ff527a12_681x873.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/67c83d13-e067-43b5-8288-ae104581cbaa_681x873.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:873,&quot;width&quot;:681,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:88568,&quot;alt&quot;:&quot;Understanding Hashing&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Understanding Hashing" title="Understanding Hashing" srcset="https://substackcdn.com/image/fetch/$s_!9VJk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac205671-870c-4d20-a6de-8796ff527a12_681x873.png 424w, https://substackcdn.com/image/fetch/$s_!9VJk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac205671-870c-4d20-a6de-8796ff527a12_681x873.png 848w, https://substackcdn.com/image/fetch/$s_!9VJk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac205671-870c-4d20-a6de-8796ff527a12_681x873.png 1272w, https://substackcdn.com/image/fetch/$s_!9VJk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac205671-870c-4d20-a6de-8796ff527a12_681x873.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Why is Hashing Important?</h2><h3>1. Data Security</h3><ul><li><p>Password Storage: Instead of storing plain-text passwords, systems store their hash values</p></li><li><p>Digital Signatures: Ensuring message integrity and authenticity</p></li><li><p>Blockchain Technology: Maintaining chain integrity and mining operations</p></li></ul><h3>2. Performance Optimization</h3><ul><li><p>Fast Data Retrieval: O(1) time complexity for lookups</p></li><li><p>Efficient Data Deduplication: Identifying duplicate content</p></li><li><p>Caching Systems: Quick verification of cached content</p></li></ul><h2>Common Hashing Algorithms</h2><h3>1. MD5 (Message Digest Algorithm 5)</h3><ul><li><p>128-bit hash value</p></li><li><p>Fast computation</p></li><li><p><strong>Note</strong>: No longer considered cryptographically secure</p></li><li><p>Use cases: File checksums, non-security critical applications</p></li></ul><h3>2. SHA Family (Secure Hash Algorithm)</h3><ul><li><p>SHA-1: 160-bit hash (deprecated for security applications)</p></li><li><p>SHA-256: Part of SHA-2 family, widely used in security applications</p></li><li><p>SHA-3: Latest standard, offering improved security</p></li></ul><h3>3. bcrypt</h3><ul><li><p>Specifically designed for password hashing</p></li><li><p>Includes salt automatically</p></li><li><p>Adjustable work factor for future-proofing</p></li><li><p>Industry standard for password storage</p></li></ul><blockquote><p>Try hashing your content with different algorithms. You try online <a href="https://app.dailydev.in/utility/hash-generator">hashing tool</a> and visualize how your output changes.</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CUMN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91497e03-7f5d-435f-9b4c-6513a0000271_694x682.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CUMN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91497e03-7f5d-435f-9b4c-6513a0000271_694x682.png 424w, https://substackcdn.com/image/fetch/$s_!CUMN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91497e03-7f5d-435f-9b4c-6513a0000271_694x682.png 848w, https://substackcdn.com/image/fetch/$s_!CUMN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91497e03-7f5d-435f-9b4c-6513a0000271_694x682.png 1272w, https://substackcdn.com/image/fetch/$s_!CUMN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91497e03-7f5d-435f-9b4c-6513a0000271_694x682.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CUMN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91497e03-7f5d-435f-9b4c-6513a0000271_694x682.png" width="694" height="682" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/91497e03-7f5d-435f-9b4c-6513a0000271_694x682.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1f002dcc-3b1a-469a-bf8a-8a17d0b65b2a_694x682.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:682,&quot;width&quot;:694,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:71336,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!CUMN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91497e03-7f5d-435f-9b4c-6513a0000271_694x682.png 424w, https://substackcdn.com/image/fetch/$s_!CUMN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91497e03-7f5d-435f-9b4c-6513a0000271_694x682.png 848w, https://substackcdn.com/image/fetch/$s_!CUMN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91497e03-7f5d-435f-9b4c-6513a0000271_694x682.png 1272w, https://substackcdn.com/image/fetch/$s_!CUMN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91497e03-7f5d-435f-9b4c-6513a0000271_694x682.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.dailydev.in/subscribe?"><span>Subscribe now</span></a></p><h2>Handling Hash Collisions</h2><p>Hash collisions occur when different inputs produce the same hash value. While unavoidable in theory, proper collision resolution is crucial for maintaining data structure efficiency.</p><h3>Common Collision Resolution Techniques:</h3><ol><li><p>Separate Chaining</p></li></ol><pre><code><code>class HashTable:
    def __init__(self, size):
        self.size = size
        self.table = [[] for _ in range(size)]
    
    def insert(self, key, value):
        hash_key = hash(key) % self.size
        chain = self.table[hash_key]
        for i, kv in enumerate(chain):
            if kv[0] == key:
                chain[i] = (key, value)
                return
        chain.append((key, value))</code></code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hRHH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7d645c-b70a-46fc-9789-69e08b74bdb8_1011x351.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hRHH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7d645c-b70a-46fc-9789-69e08b74bdb8_1011x351.png 424w, https://substackcdn.com/image/fetch/$s_!hRHH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7d645c-b70a-46fc-9789-69e08b74bdb8_1011x351.png 848w, https://substackcdn.com/image/fetch/$s_!hRHH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7d645c-b70a-46fc-9789-69e08b74bdb8_1011x351.png 1272w, https://substackcdn.com/image/fetch/$s_!hRHH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7d645c-b70a-46fc-9789-69e08b74bdb8_1011x351.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hRHH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7d645c-b70a-46fc-9789-69e08b74bdb8_1011x351.png" width="1011" height="351" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7f7d645c-b70a-46fc-9789-69e08b74bdb8_1011x351.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:351,&quot;width&quot;:1011,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:29713,&quot;alt&quot;:&quot;Hash table Insertion&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Hash table Insertion" title="Hash table Insertion" srcset="https://substackcdn.com/image/fetch/$s_!hRHH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7d645c-b70a-46fc-9789-69e08b74bdb8_1011x351.png 424w, https://substackcdn.com/image/fetch/$s_!hRHH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7d645c-b70a-46fc-9789-69e08b74bdb8_1011x351.png 848w, https://substackcdn.com/image/fetch/$s_!hRHH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7d645c-b70a-46fc-9789-69e08b74bdb8_1011x351.png 1272w, https://substackcdn.com/image/fetch/$s_!hRHH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7d645c-b70a-46fc-9789-69e08b74bdb8_1011x351.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><ol start="2"><li><p>Open Addressing</p></li></ol><pre><code><code>def linear_probe(hash_table, key, value):
    size = len(hash_table)
    index = hash(key) % size
    
    while hash_table[index] is not None:
        index = (index + 1) % size
    
    hash_table[index] = (key, value)</code></code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WZgp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F371d3b72-31f3-4c88-b41c-37a23f13da9e_1024x441.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WZgp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F371d3b72-31f3-4c88-b41c-37a23f13da9e_1024x441.png 424w, https://substackcdn.com/image/fetch/$s_!WZgp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F371d3b72-31f3-4c88-b41c-37a23f13da9e_1024x441.png 848w, https://substackcdn.com/image/fetch/$s_!WZgp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F371d3b72-31f3-4c88-b41c-37a23f13da9e_1024x441.png 1272w, https://substackcdn.com/image/fetch/$s_!WZgp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F371d3b72-31f3-4c88-b41c-37a23f13da9e_1024x441.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WZgp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F371d3b72-31f3-4c88-b41c-37a23f13da9e_1024x441.png" width="1024" height="441" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/371d3b72-31f3-4c88-b41c-37a23f13da9e_1024x441.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:441,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:42219,&quot;alt&quot;:&quot;Linear probing&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Linear probing" title="Linear probing" srcset="https://substackcdn.com/image/fetch/$s_!WZgp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F371d3b72-31f3-4c88-b41c-37a23f13da9e_1024x441.png 424w, https://substackcdn.com/image/fetch/$s_!WZgp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F371d3b72-31f3-4c88-b41c-37a23f13da9e_1024x441.png 848w, https://substackcdn.com/image/fetch/$s_!WZgp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F371d3b72-31f3-4c88-b41c-37a23f13da9e_1024x441.png 1272w, https://substackcdn.com/image/fetch/$s_!WZgp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F371d3b72-31f3-4c88-b41c-37a23f13da9e_1024x441.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h2>Real-world Applications</h2><h3>1. Git Version Control</h3><p>Git uses SHA-1 hashes to identify commits and ensure data integrity. Each commit has a unique hash based on its contents and history.</p><h3>2. Cryptocurrency</h3><p>Bitcoin and other cryptocurrencies use hashing for:</p><ul><li><p>Mining new blocks</p></li><li><p>Creating wallet addresses</p></li><li><p>Securing transactions</p></li></ul><h3>3. Content Delivery Networks (CDNs)</h3><p>CDNs use content hashing to:</p><ul><li><p>Cache management</p></li><li><p>Content verification</p></li><li><p>Deduplication</p></li></ul><h2>Best Practices for Implementing Hashing</h2><ol><li><p>Choose the Right Algorithm</p></li></ol><pre><code><code># For passwords
import bcrypt

def hash_password(password):
    salt = bcrypt.gensalt()
    return bcrypt.hashpw(password.encode(), salt)

# For general data integrity
import hashlib

def hash_file(filename):
    sha256_hash = hashlib.sha256()
    with open(filename, "rb") as f:
        for byte_block in iter(lambda: f.read(4096), b""):
            sha256_hash.update(byte_block)
    return sha256_hash.hexdigest()</code></code></pre><ol start="2"><li><p>Implement Proper Salt Usage</p></li></ol><pre><code><code>import os
import hashlib

def create_salted_hash(data):
    salt = os.urandom(32)
    key = hashlib.pbkdf2_hmac(
        'sha256',
        data.encode('utf-8'),
        salt,
        100000
    )
    return salt + key</code></code></pre><ol start="3"><li><p>Consider Performance Requirements</p></li></ol><pre><code><code>from time import time

def benchmark_hash_function(hash_func, data, iterations=1000):
    start_time = time()
    for _ in range(iterations):
        hash_func(data)
    end_time = time()
    return (end_time - start_time) / iterations</code></code></pre><h2>Common Pitfalls to Avoid</h2><ol><li><p>Using Cryptographic Hashes for Passwords</p></li><li><p>Ignoring Collision Handling</p></li><li><p>Not Salting Sensitive Data</p></li><li><p>Using Deprecated Algorithms</p></li></ol><h2>Future of Hashing</h2><p>The field of hashing continues to evolve with:</p><ul><li><p>Quantum-resistant hashing algorithms</p></li><li><p>Improved performance optimizations</p></li><li><p>Enhanced security features</p></li></ul><h2>Conclusion</h2><p>Hashing remains a fundamental concept in computer science, with applications spanning security, performance, and data integrity. As a software engineer, understanding and properly implementing hashing is crucial for building robust and secure applications.</p><h2>Call to Action</h2><ul><li><p>Try online <a href="https://app.dailydev.in/utility/hash-generator">hashing tool</a> with your content.</p></li><li><p>Audit your current hashing implementations</p></li><li><p>Update deprecated hashing algorithms</p></li><li><p>Implement proper security measures</p></li><li><p>Stay informed about new hashing developments</p></li></ul><h2>Additional Resources</h2><ol><li><p><a href="https://www.nist.gov/cryptography">NIST Cryptographic Standards</a></p></li><li><p><a href="https://csrc.nist.gov/publications/detail/sp/800-107/rev-1/final">Hash Function Security Guidelines</a></p></li><li><p><a href="https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet">Modern Password Security</a></p></li></ol><p>Remember: The field of cryptography and hashing is constantly evolving. Stay updated with the latest security recommendations and best practices to ensure your implementations remain secure and efficient.</p><div><hr></div><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/p/sd-9-what-is-hashing?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption">Thanks for reading Dailydev.in Newsletter! This post is public so feel free to share it.</p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/p/sd-9-what-is-hashing?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.dailydev.in/p/sd-9-what-is-hashing?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Dailydev.in Newsletter! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[SD 8: Serverless Computing: Beyond the Buzzword]]></title><description><![CDATA[Discover everything about serverless computing: benefits, real-world applications, and implementation guide. Learn how Netflix & others use this technology to scale efficiently.]]></description><link>https://blog.dailydev.in/p/serverless-computing</link><guid isPermaLink="false">https://blog.dailydev.in/p/serverless-computing</guid><dc:creator><![CDATA[Yashraj Balidani]]></dc:creator><pubDate>Wed, 12 Feb 2025 14:45:49 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!606o!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb45c683d-6d98-4a5e-94b6-d82f49679f03_500x500.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1>Introduction</h1><p>Ever wondered how companies like Netflix, Coca-Cola, and Airbnb handle millions of requests without managing complex server infrastructure? The answer lies in serverless computing, a revolutionary approach that's reshaping how we build and deploy applications.</p><p>Despite its name, serverless doesn't mean "no servers" - it's about abstracting server management away from developers. Let's dive deep into this game-changing technology that's transforming the software development landscape.</p><h2>What is Serverless Computing?</h2><p>Serverless computing is a cloud computing execution model where cloud providers automatically manage the infrastructure, allowing developers to focus solely on writing code. Think of it as having a personal assistant who handles all the administrative tasks while you focus on your core work.</p><h3>The Traditional vs. Serverless Approach</h3><p>To understand serverless better, let's compare it with traditional server management:</p><p><strong>Traditional Approach:</strong></p><ul><li><p>You rent or buy servers</p></li><li><p>Configure operating systems</p></li><li><p>Manage scaling</p></li><li><p>Handle maintenance</p></li><li><p>Pay for 24/7 server operation </p></li></ul><p><strong>Serverless Approach:</strong></p><ul><li><p>Write and deploy code</p></li><li><p>Provider manages infrastructure</p></li><li><p>Automatic scaling</p></li><li><p>Zero maintenance overhead</p></li><li><p>Pay only for actual usage</p></li></ul><h2>How Does Serverless Work?</h2><h3>The Event-Driven Model</h3><p>Serverless functions operate on an event-driven model. Here's a simple flow:</p><ol><li><p>Event triggers (HTTP request, database change, file upload)</p></li><li><p>Cloud provider activates function</p></li><li><p>Code executes</p></li><li><p>Function terminates</p></li><li><p>You pay only for execution time</p></li></ol><pre><code><code>// Example AWS Lambda function
exports.handler = async (event) =&gt; {
   const response = {
       statusCode: 200,
       body: JSON.stringify('Hello from Serverless!')
   };
   return response;
};</code></code></pre><h2>Key Benefits of Serverless</h2><h3>1. Cost Efficiency</h3><ul><li><p>Pay-per-execution model</p></li><li><p>No idle server costs</p></li><li><p>Automatic scaling</p></li></ul><h3>2. Developer Productivity</h3><ul><li><p>Focus on code, not infrastructure</p></li><li><p>Faster time to market</p></li><li><p>Reduced operational overhead</p></li></ul><h3>3. Scalability</h3><ul><li><p>Automatic scaling</p></li><li><p>Handles traffic spikes effortlessly</p></li><li><p>Global deployment options</p></li></ul><h3>4. Maintenance-Free</h3><ul><li><p>Provider handles updates</p></li><li><p>Security patches</p></li><li><p>System maintenance</p></li></ul><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Dailydev.in Newsletter! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h2>Real-World Applications</h2><h3>Case Study: Netflix</h3><p>Netflix uses AWS Lambda for:</p><ul><li><p>Video file processing</p></li><li><p>Backup automation</p></li><li><p>Security monitoring</p></li></ul><p>Results:</p><ul><li><p>90% cost reduction</p></li><li><p>Improved processing speed</p></li><li><p>Better resource utilization</p></li></ul><h2>Common Misconceptions</h2><h4>1. "Serverless Means No Servers"</h4><p>Reality: Servers exist but are managed by providers</p><h4>2. "Serverless is Always Cheaper"</h4><p>Reality: Depends on workload and usage patterns</p><h4>3. "Serverless is Only for Small Applications"</h4><p>Reality: Suitable for both small and large-scale applications</p><h2>Challenges and Considerations</h2><h4>1. Cold Starts</h4><ul><li><p>Initial request delays</p></li><li><p>Mitigation strategies available</p></li></ul><h4>2. Vendor Lock-in</h4><ul><li><p>Provider-specific services</p></li><li><p>Migration challenges</p></li></ul><h4>3. Debugging Complexity</h4><ul><li><p>Limited visibility</p></li><li><p>Distributed nature of functions</p></li></ul><h2>Best Practices</h2><ol><li><p><strong>Function Design</strong></p></li></ol><pre><code><code>// Good: Single responsibility
async function processOrder(orderId) {
    // Process single order
}

// Bad: Multiple responsibilities
async function processOrderAndNotifyAndUpdate(orderId) {
    // Too many operations
}</code></code></pre><ol><li><p><strong>Error Handling</strong></p><ul><li><p>Implement proper error handling</p></li><li><p>Use monitoring tools</p></li><li><p>Set up alerts</p></li></ul></li><li><p><strong>Performance Optimization</strong></p><ul><li><p>Minimize function size</p></li><li><p>Optimize dependencies</p></li><li><p>Cache when possible</p></li></ul></li></ol><h2>Getting Started with Serverless</h2><h4>Step 1: Choose a Provider</h4><ul><li><p><a href="https://aws.amazon.com/lambda/?utm_source=blog.dailydev.in&amp;utm_medium=referral&amp;utm_campaign=sd-8-serverless-computing">AWS Lambda</a></p></li><li><p><a href="https://azure.microsoft.com/en-us/products/functions?utm_source=blog.dailydev.in&amp;utm_medium=referral&amp;utm_campaign=sd-8-serverless-computing">Azure Functions</a></p></li><li><p><a href="https://cloud.google.com/functions?utm_source=blog.dailydev.in&amp;utm_medium=referral&amp;utm_campaign=sd-8-serverless-computing">Google Cloud Functions</a></p></li><li><p><a href="https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-functions&amp;utm_source=blog.dailydev.in&amp;utm_medium=referral&amp;utm_campaign=sd-8-serverless-computing">IBM Cloud Functions</a></p></li></ul><h4>Step 2: Select a Framework</h4><ul><li><p>Serverless Framework</p></li><li><p><a href="https://aws.amazon.com/serverless/sam/?utm_source=blog.dailydev.in&amp;utm_medium=referral&amp;utm_campaign=sd-8-serverless-computing">AWS SAM</a></p></li><li><p><a href="https://www.terraform.io/?utm_source=blog.dailydev.in&amp;utm_medium=referral&amp;utm_campaign=sd-8-serverless-computing">Terraform</a></p></li></ul><h4>Step 3: Deploy Your First Function</h4><pre><code><code>1# Using Serverless Framework
2npm install -g serverless
3serverless create --template aws-nodejs
4serverless deploy</code></code></pre><h2>Future of Serverless</h2><h4>Emerging Trends</h4><ol><li><p>Edge Computing Integration</p></li><li><p>AI/ML Capabilities</p></li><li><p>Enhanced Development Tools</p></li></ol><h4>Predictions</h4><ul><li><p>Increased adoption</p></li><li><p>Better cold start solutions</p></li><li><p>More specialized services</p></li></ul><h2>Conclusion</h2><p>Serverless computing represents a paradigm shift in how we build and deploy applications. While it's not a silver bullet, its benefits make it an attractive option for many use cases.</p><h4>Take Action</h4><ol><li><p>Try building a simple serverless function</p></li><li><p>Experiment with different providers</p></li><li><p>Join serverless communities</p></li></ol><h4>Resources for Further Learning</h4><ol><li><p>Documentation:</p><ul><li><p><a href="https://aws.amazon.com/lambda/">AWS Lambda Documentation</a></p></li><li><p><a href="https://azure.microsoft.com/services/functions/">Azure Functions Documentation</a></p></li></ul></li><li><p>Communities:</p><ul><li><p>Serverless Forum</p></li><li><p>Stack Overflow</p></li><li><p>GitHub Discussions</p></li></ul></li><li><p>Tools:</p><ul><li><p>Serverless Framework</p></li><li><p>CloudWatch</p></li><li><p>X-Ray</p></li></ul></li></ol><div><hr></div><p>Would you like to learn more about specific aspects of serverless computing? Share your thoughts and experiences in the comments below!</p><p>Remember to follow us for more tech insights and tutorials. Happy coding! &#128640;</p><div><hr></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/p/serverless-computing?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.dailydev.in/p/serverless-computing?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><p></p>]]></content:encoded></item><item><title><![CDATA[SD 7: What is Redis?]]></title><description><![CDATA[Redis is a open source service to help you cache and fetch data in rocket speed. Discover how Redis powers modern apps with lightning-fast data storage. Learn key concepts, real-world examples, and best practices for implementing Redis in your projects.]]></description><link>https://blog.dailydev.in/p/sd-7-what-is-redis</link><guid isPermaLink="false">https://blog.dailydev.in/p/sd-7-what-is-redis</guid><dc:creator><![CDATA[Yashraj Balidani]]></dc:creator><pubDate>Wed, 05 Feb 2025 14:30:41 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc50650f-1bcb-4262-9395-ac0221417b12_757x402.avif" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Introduction</h2><p>In today's digital world, speed is everything. Whether you're scrolling through social media, shopping online, or checking your bank balance, you expect instant results. But have you ever wondered how applications deliver such lightning-fast responses? Enter Redis, a powerful technology that's revolutionizing how we handle data in modern applications.</p><h2>What is Redis?</h2><p><a href="https://redis.io/?utm_source=blog.dailydev.in&amp;utm_medium=referral&amp;utm_campaign=sd-7-what-is-redis">Redis </a>(Remote Dictionary Server) is an open-source, in-memory data structure store that can be used as a database, cache, message broker, and queue. Think of it as a super-fast digital assistant that helps applications remember and retrieve information almost instantly.</p><h3>The Speed Secret: In-Memory Storage</h3><p>Unlike traditional databases that store data on disk, Redis keeps data primarily in RAM (Random Access Memory). This is like having all your frequently used items on your desk rather than stored away in filing cabinets &#8211; everything you need is within immediate reach.</p><p>Key features that make Redis special:</p><ul><li><p>Lightning-fast performance (sub-millisecond latency)</p></li><li><p>Versatile data structure support</p></li><li><p>Built-in replication and persistence</p></li><li><p>Atomic operations</p></li><li><p>Simple to use yet powerful</p></li></ul><h2>How Does Redis Work?</h2><p>Let's break down Redis's operation with a real-world analogy:</p><p>Imagine you're a librarian. In a traditional library system (like a regular database):</p><ol><li><p>A visitor requests a book</p></li><li><p>You check the catalog</p></li><li><p>Walk to the shelf</p></li><li><p>Retrieve the book</p></li><li><p>Return to the desk</p></li></ol><p>With Redis, it's like having all the most popular books right at your desk. When someone requests one, you can hand it over immediately &#8211; no walking required!</p><h3>Key-Value Storage</h3><p>Redis operates on a key-value storage principle. Think of it as a giant dictionary where:</p><pre><code><code>1. SET user:123 "John Doe"
2. GET user:123 -&gt; Returns "John Doe"</code></code></pre><h2>Common Use Cases</h2><h3>1. Caching</h3><p>The most common use case for Redis is caching. Consider an e-commerce website:</p><p>Without Redis:</p><pre><code><code>1. User requests product details
2. Application queries database
3. Database processes query (slow)
4. Returns results
5. Total time: 500ms+</code></code></pre><p>With Redis:</p><pre><code><code>1. User requests product details
2. Application checks Redis cache
3. Redis returns cached data
4. Total time: &lt;1ms</code></code></pre><h3>2. Session Management</h3><p>Redis excels at handling user sessions. Instead of storing session information in application memory or a traditional database, Redis provides:</p><ul><li><p>Quick access to session data</p></li><li><p>Automatic expiration of old sessions</p></li><li><p>Distributed session management across multiple servers</p></li></ul><h3>3. Real-time Analytics</h3><p>For applications requiring real-time metrics:</p><ul><li><p>Page view counters</p></li><li><p>Active user tracking</p></li><li><p>Real-time dashboards</p></li><li><p>Leaderboards</p></li></ul><div><hr></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.dailydev.in/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><h2>Redis Data Structures</h2><p>Redis isn't just a simple key-value store. It supports various data structures:</p><ol><li><p>Strings: Basic key-value pairs</p></li></ol><pre><code><code>1. SET username "techie123"
2. GET username</code></code></pre><ol start="2"><li><p>Lists: Ordered collections</p></li></ol><pre><code><code>1. LPUSH notifications "New message"
2. RPOP notifications</code></code></pre><ol start="3"><li><p>Sets: Unique collections</p></li></ol><pre><code><code>1. SADD tags "redis" "database" "cache"</code></code></pre><ol start="4"><li><p>Hashes: Objects with fields</p></li></ol><pre><code><code>1. HSET user:123 name "John" age "30"</code></code></pre><ol start="5"><li><p>Sorted Sets: Scored collections</p></li></ol><pre><code><code>1. ZADD leaderboard 100 "player1"</code></code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Rvjo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc50650f-1bcb-4262-9395-ac0221417b12_757x402.avif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Rvjo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc50650f-1bcb-4262-9395-ac0221417b12_757x402.avif 424w, https://substackcdn.com/image/fetch/$s_!Rvjo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc50650f-1bcb-4262-9395-ac0221417b12_757x402.avif 848w, https://substackcdn.com/image/fetch/$s_!Rvjo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc50650f-1bcb-4262-9395-ac0221417b12_757x402.avif 1272w, https://substackcdn.com/image/fetch/$s_!Rvjo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc50650f-1bcb-4262-9395-ac0221417b12_757x402.avif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Rvjo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc50650f-1bcb-4262-9395-ac0221417b12_757x402.avif" width="757" height="402" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fc50650f-1bcb-4262-9395-ac0221417b12_757x402.avif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:402,&quot;width&quot;:757,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:17210,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/avif&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Rvjo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc50650f-1bcb-4262-9395-ac0221417b12_757x402.avif 424w, https://substackcdn.com/image/fetch/$s_!Rvjo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc50650f-1bcb-4262-9395-ac0221417b12_757x402.avif 848w, https://substackcdn.com/image/fetch/$s_!Rvjo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc50650f-1bcb-4262-9395-ac0221417b12_757x402.avif 1272w, https://substackcdn.com/image/fetch/$s_!Rvjo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc50650f-1bcb-4262-9395-ac0221417b12_757x402.avif 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Best Practices for Using Redis</h2><h3>1. Memory Management</h3><p>Remember, Redis stores data in memory, so:</p><ul><li><p>Set appropriate maxmemory limits</p></li><li><p>Configure eviction policies</p></li><li><p>Monitor memory usage</p></li></ul><h3>2. Data Persistence</h3><p>While Redis is in-memory, it offers persistence options:</p><ul><li><p>RDB (Redis Database): Point-in-time snapshots</p></li><li><p>AOF (Append Only File): Write-ahead logging</p></li><li><p>Hybrid approach for optimal safety and performance</p></li></ul><h3>3. Security Considerations</h3><ul><li><p>Use strong passwords</p></li><li><p>Configure firewall rules</p></li><li><p>Enable SSL/TLS for encrypted connections</p></li><li><p>Implement proper access controls</p></li></ul><h2>Getting Started with Redis</h2><h3>Local Installation</h3><pre><code><code>1. # On Ubuntu
2. sudo apt-get install redis-server
3.
4. # On macOS
5. brew install redis
6.
7. # Start Redis server
8. redis-server</code></code></pre><h3>Basic Commands</h3><pre><code><code>1. # Set a key
2. SET greeting "Hello, Redis!"
3.
4. # Get a value
5. GET greeting
6.
7. # Check if key exists
8. EXISTS greeting
9.
10. # Delete a key
11. DEL greeting
12.
13. # Set expiration
14. EXPIRE session:123 3600</code></code></pre><h2>Real-World Example: Building a Rate Limiter</h2><p>Here's a practical example of using Redis to implement a rate limiter:</p><pre><code><code>1. import redis
2. import time
3.
4. r = redis.Redis()
5. 
6. def is_rate_limited(user_id, limit=10, window=60):
7.    # Create a key for this user
8.    key = f"rate:{user_id}"
9.    
10.    # Get current count
11.    current = r.get(key)
12.    
13.   if not current:
14.        # First request, set to 1 with expiry
15.        r.setex(key, window, 1)
16.        return False
17.    
18.    if int(current) &gt;= limit:
19.        return True
20.        
21.    # Increment counter
22.    r.incr(key)
23.    return False</code></code></pre><h2>Common Challenges and Solutions</h2><h3>1. Cache Invalidation</h3><p>Challenge: Keeping cache in sync with source data Solution: Implement cache-aside pattern with TTL</p><h3>2. Memory Usage</h3><p>Challenge: Running out of memory Solution:</p><ul><li><p>Use maxmemory-policy</p></li><li><p>Monitor usage</p></li><li><p>Implement proper eviction strategies</p></li></ul><h3>3. Scaling</h3><p>Challenge: Handling growing data sets Solution:</p><ul><li><p>Redis Cluster</p></li><li><p>Redis Sentinel for high availability</p></li><li><p>Proper sharding strategies</p></li></ul><h2>Future of Redis</h2><p>Redis continues to evolve with:</p><ul><li><p>Enhanced modules system</p></li><li><p>Improved clustering</p></li><li><p>AI capabilities</p></li><li><p>Time series data support</p></li><li><p>Search capabilities</p></li></ul><h2>Conclusion</h2><p>Redis has become an indispensable tool in modern application architecture. Its versatility, speed, and ease of use make it perfect for various use cases, from simple caching to complex real-time analytics.</p><h3>Next Steps</h3><ol><li><p>Install Redis locally</p></li><li><p>Try basic commands</p></li><li><p>Implement a simple caching solution</p></li><li><p>Explore advanced features</p></li></ol><p>Remember: Redis is powerful but requires understanding its strengths and limitations. Start small, monitor performance, and scale as needed.</p><h2>Additional Resources</h2><ul><li><p>Redis official documentation</p></li><li><p>Redis University free courses</p></li><li><p>Community forums and Discord channels</p></li><li><p>GitHub repositories with example projects</p></li></ul><p>This journey into Redis is just beginning. As you explore its capabilities, you'll discover new ways to make your applications faster and more efficient.</p><p>Happy coding! &#128640;</p><div><hr></div><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/p/sd-7-what-is-redis?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption">Thanks for reading Dailydev.in Newsletter! This post is public so feel free to share it.</p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/p/sd-7-what-is-redis?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.dailydev.in/p/sd-7-what-is-redis?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div>]]></content:encoded></item><item><title><![CDATA[How Discord stores Trillions of Messages]]></title><description><![CDATA[Discover how Discord engineered their database migration from MongoDB to ScyllaDB, scaling from billions to trillions of messages while improving performance and reliability.]]></description><link>https://blog.dailydev.in/p/how-discord-stores-trillions-of-messages</link><guid isPermaLink="false">https://blog.dailydev.in/p/how-discord-stores-trillions-of-messages</guid><dc:creator><![CDATA[Yashraj Balidani]]></dc:creator><pubDate>Wed, 29 Jan 2025 14:30:31 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F373de475-29bd-4d1e-876a-2549b972c558_3576x3033.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Introduction</h2><p>Imagine being responsible for storing trillions of messages that millions of users depend on every day. This isn't just a hypothetical scenario &#8211; it's the reality that Discord's engineering team faced as they scaled their platform from billions to trillions of messages. In this comprehensive case study, we'll explore Discord's fascinating journey of database migration, architectural decisions, and the intricate details of how they tackled one of the most challenging scaling problems in modern tech.</p><h2>The Initial Architecture: MongoDB to Cassandra</h2><h3>Early Days with <a href="https://www.mongodb.com/?utm_source=blog.dailydev.in&amp;utm_medium=referral&amp;utm_campaign=how-discord-stores-billions-of-messages">MongoDB</a></h3><p>When Discord first launched, like many startups, they chose MongoDB as their initial database solution. <a href="https://www.mongodb.com/?utm_source=blog.dailydev.in&amp;utm_medium=referral&amp;utm_campaign=how-discord-stores-billions-of-messages">MongoDB </a>offered:</p><ul><li><p>Flexible document schema</p></li><li><p>Horizontal scalability</p></li><li><p>Familiar JSON-like data structure</p></li><li><p>Strong community support</p></li></ul><p>However, as Discord's user base grew, limitations became apparent:</p><ol><li><p>Scaling challenges with large datasets</p></li><li><p>Complex maintenance requirements</p></li><li><p>Performance inconsistencies at scale</p></li></ol><h3>The First Migration: Cassandra</h3><p>In 2017, Discord's engineering team made their first major database transition from MongoDB to <a href="https://cassandra.apache.org/_/index.html?utm_source=blog.dailydev.in&amp;utm_medium=referral&amp;utm_campaign=how-discord-stores-billions-of-messages">Cassandra</a>. The decision was driven by the need for a scalable, fault-tolerant system that could handle their growing user base. At the time, this seemed like the perfect solution &#8211; Cassandra offered horizontal scalability, high availability, and promised to be relatively low maintenance.</p><h2>The Cassandra Era: Challenges at Scale</h2><h3>Infrastructure Growth</h3><p>By 2022, Discord's growth had pushed their Cassandra cluster to its limits:</p><ul><li><p>177 nodes (from initial 12)</p></li><li><p>Trillions of messages</p></li><li><p>Multiple petabytes of data</p></li><li><p>High operational overhead</p></li><li><p>Frequent on-call incidents</p></li><li><p>Unpredictable latency spikes</p></li></ul><h3>Critical Issues Emerged</h3><ol><li><p><strong>Message Schema Analysis:</strong></p></li></ol><pre><code><code>1CREATE TABLE messages (
2    channel_id bigint,
3    bucket int,
4    message_id bigint,
5    content text,
6    PRIMARY KEY ((channel_id, bucket), message_id)
7);</code></code></pre><p>This schema design revealed several critical insights:</p><ul><li><p>Messages were partitioned by channel_id and time-based buckets</p></li><li><p>Snowflake IDs enabled chronological sorting</p></li><li><p>The partition strategy led to uneven data distribution</p></li></ul><p><strong>The Hidden Complexity:</strong> </p><p>The real challenge wasn't just in the schema &#8211; it was in the access patterns. Discord servers range from small friend groups to communities with hundreds of thousands of members. This diversity created what the team called "<em><strong>hot partitions</strong></em>" &#8211; scenarios where specific channels received disproportionate amounts of traffic.</p><p><strong>Technical Deep Dive:</strong> </p><p>The Hot Partition Problem When a popular channel experienced high traffic:</p><ol><li><p>Reads would overwhelm the nodes containing that partition</p></li><li><p>Latency would increase across the entire cluster</p></li><li><p>Quorum consistency requirements meant slower response times</p></li><li><p>Maintenance operations like compaction became increasingly difficult</p></li></ol><p><strong>The Breaking Point:</strong> </p><p>The engineering team found themselves performing what they dubbed the "gossip dance" &#8211; a complex choreography of:</p><ol><li><p>Taking nodes out of rotation</p></li><li><p>Allowing compaction to catch up</p></li><li><p>Reintegrating nodes</p></li><li><p>Managing hinted handoffs</p></li><li><p>Repeating the process</p></li></ol><p><strong>2. JVM Tuning Nightmare:</strong></p><p> A significant portion of operational overhead came from JVM management:</p><ul><li><p>Garbage collection pauses caused latency spikes</p></li><li><p>Heap size optimization became increasingly complex</p></li><li><p>GC tuning required specialized expertise</p></li></ul><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Dailydev.in Newsletter! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h2>The Solution: Multi-Faceted Approach</h2><h3>1. Database Migration to ScyllaDB</h3><p>Discord chose <a href="https://www.scylladb.com/?utm_source=blog.dailydev.in&amp;utm_medium=referral&amp;utm_campaign=how-discord-stores-billions-of-messages">ScyllaDB </a>for several key reasons:</p><ul><li><p>C++ implementation eliminated GC concerns</p></li><li><p><a href="https://www.scylladb.com/product/technology/shard-per-core-architecture/?utm_source=blog.dailydev.in&amp;utm_medium=referral&amp;utm_campaign=how-discord-stores-billions-of-messages">Shard-per-core architecture</a> improved resource utilization</p></li><li><p>Better workload isolation capabilities</p></li><li><p>Improved reverse query performance</p></li><li><p>Compatible with existing Cassandra tooling</p></li></ul><h3>2. Migration Strategy</h3><h4>Initial Plan:</h4><ol><li><p>Dual-write to both databases</p></li><li><p>Cutover new data to <a href="https://www.scylladb.com/?utm_source=blog.dailydev.in&amp;utm_medium=referral&amp;utm_campaign=how-discord-stores-billions-of-messages">ScyllaDB</a></p></li><li><p>Migrate historical data in the background</p></li></ol><blockquote><p><strong>Reality Check:</strong> The initial migration estimate using ScyllaDB's Spark migrator was three months &#8211; far too long given the operational issues they were facing.</p></blockquote><p><strong>The Rust Revolution:</strong></p><p> In a classic example of engineering ingenuity, the team decided to leverage their expertise in Rust to build a custom migration tool. The results were stunning:</p><ul><li><p>Migration time reduced from 3 months to 9 days</p></li><li><p>Throughput of 3.2 million messages per second</p></li><li><p>Built-in check pointing using SQLite</p></li><li><p>Automated validation through dual-reads</p></li></ul><h3>2. Introduction of Data Services Layer</h3><p>One of the most innovative aspects of Discord's solution was the introduction of data services &#8211; intermediary layers between their API monolith and database clusters.</p><p>Key Features:</p><ol><li><p>Request Coalescing:</p></li></ol><pre><code><code>async fn get_message(channel_id: u64, message_id: u64) -&gt; Result&lt;Message&gt; {
    let task_key = format!("{}:{}", channel_id, message_id);
    
    if let Some(existing_task) = TASK_MAP.get(&amp;task_key) {
        return existing_task.subscribe().await;
    }
    
    let new_task = Task::new(async move {
        // Actual database query
        db.get_message(channel_id, message_id).await
    });
    
    TASK_MAP.insert(task_key.clone(), new_task.clone());
    new_task.execute().await
}</code></code></pre><ol start="2"><li><p>Consistent Hash-based Routing:</p><ol><li><p>Requests for the same channel routed to the same service instance</p></li><li><p>Improved coalescing efficiency</p></li><li><p>Better resource utilization</p></li></ol></li></ol><p><strong>Performance Improvements</strong>: </p><p>The new architecture delivered impressive results:</p><ul><li><p>Historical message fetch latency: 40-125ms &#8594; 15ms (p99)</p></li><li><p>Message insert latency: 5-70ms &#8594; steady 5ms (p99)</p></li><li><p>Node count reduced: 177 &#8594; 72</p></li><li><p>Storage efficiency: 4TB &#8594; 9TB per node</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ehy1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F373de475-29bd-4d1e-876a-2549b972c558_3576x3033.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ehy1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F373de475-29bd-4d1e-876a-2549b972c558_3576x3033.png 424w, https://substackcdn.com/image/fetch/$s_!ehy1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F373de475-29bd-4d1e-876a-2549b972c558_3576x3033.png 848w, https://substackcdn.com/image/fetch/$s_!ehy1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F373de475-29bd-4d1e-876a-2549b972c558_3576x3033.png 1272w, https://substackcdn.com/image/fetch/$s_!ehy1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F373de475-29bd-4d1e-876a-2549b972c558_3576x3033.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ehy1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F373de475-29bd-4d1e-876a-2549b972c558_3576x3033.png" width="1456" height="1235" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/373de475-29bd-4d1e-876a-2549b972c558_3576x3033.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ee234c90-c5cc-4241-9484-d5ef18935ca9_3576x3033.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1235,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1873131,&quot;alt&quot;:&quot;discord db migration&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="discord db migration" title="discord db migration" srcset="https://substackcdn.com/image/fetch/$s_!ehy1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F373de475-29bd-4d1e-876a-2549b972c558_3576x3033.png 424w, https://substackcdn.com/image/fetch/$s_!ehy1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F373de475-29bd-4d1e-876a-2549b972c558_3576x3033.png 848w, https://substackcdn.com/image/fetch/$s_!ehy1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F373de475-29bd-4d1e-876a-2549b972c558_3576x3033.png 1272w, https://substackcdn.com/image/fetch/$s_!ehy1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F373de475-29bd-4d1e-876a-2549b972c558_3576x3033.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Results and Impact</h2><h3>Performance Improvements</h3><ul><li><p>Reduced node count: 177 &#8594; 72</p></li><li><p>Storage efficiency: 9TB per node (up from 4TB)</p></li><li><p>Latency improvements:</p><ul><li><p>Historical message fetching: 40-125ms &#8594; 15ms (p99)</p></li><li><p>Message insertion: 5-70ms &#8594; 5ms (p99)</p></li></ul></li></ul><h3>Real-world Stress Test: World Cup Final</h3><p>The World Cup Final The true test of the new system came during the 2022 World Cup Final. The match between Argentina and France created distinct traffic patterns that demonstrated the system's resilience:</p><p>Traffic Spikes Analysis:</p><ol><li><p>Initial Goal (Messi penalty): <strong>2.1x</strong> normal traffic</p></li><li><p>Double Goal Sequence:<strong> 2.8x</strong> normal traffic</p></li><li><p>Mbappe's Quick Double: <strong>3.5x</strong> normal traffic</p></li><li><p>Penalty Shootout: <strong>4.2x</strong> normal traffic </p></li></ol><p>The system handled these spikes without any degradation in performance, proving the effectiveness of the new architecture.</p><h3>Operational Benefits</h3><ul><li><p>Reduced on-call incidents</p></li><li><p>Simplified maintenance procedures</p></li><li><p>Better resource utilization</p></li><li><p>Enhanced system predictability</p></li></ul><h2>Technical Deep Dive: Architecture Components</h2><h3>1. Storage Layer Design</h3><pre><code><code>Client Request
    &#8595;
Load Balancer
    &#8595;
API Gateway
    &#8595;
Data Service (Rust)
    &#9500;&#9472;&#9472; Request Coalescing
    &#9500;&#9472;&#9472; Consistent Hashing
    &#9492;&#9472;&#9472; Traffic Shaping
    &#8595;
ScyllaDB Cluster
    &#9500;&#9472;&#9472; Shard-per-core
    &#9500;&#9472;&#9472; Local SSDs
    &#9492;&#9472;&#9472; RAID Configuration</code></code></pre><h3>2. Data Service Implementation</h3><p>Key components:</p><pre><code><code>// Simplified routing implementation
struct Router {
    ring: ConsistentHashRing,
    services: Vec&lt;ServiceEndpoint&gt;,
}

impl Router {
    fn route_request(&amp;self, channel_id: u64) -&gt; &amp;ServiceEndpoint {
        let hash = self.ring.get_node(channel_id);
        &amp;self.services[hash]
    }
}</code></code></pre><h3>3. Monitoring and Observability</h3><p>Implemented metrics:</p><ul><li><p>Request coalescing efficiency</p></li><li><p>Per-channel throughput</p></li><li><p>Latency distributions</p></li><li><p>Storage utilization</p></li><li><p>Hot partition detection</p></li></ul><h2>Lessons Learned</h2><ol><li><p><strong>Database Selection:</strong></p></li></ol><ul><li><p>Consider operational complexity, not just features</p></li><li><p>Factor in team expertise and maintenance overhead</p></li><li><p>Test real-world access patterns, not just benchmarks</p></li></ul><ol start="2"><li><p><strong>Architecture Design:</strong></p></li></ol><ul><li><p>Implement request coalescing early</p></li><li><p>Use consistent hashing for better resource utilization</p></li><li><p>Build observability into the system from day one</p></li></ul><ol start="3"><li><p><strong>Migration Strategy:</strong></p></li></ol><ul><li><p>Don't be afraid to build custom tools</p></li><li><p>Validate data continuously during migration</p></li><li><p>Plan for the unexpected (like those pesky tombstones)</p></li></ul><ol start="4"><li><p><strong>Technology Choices:</strong></p></li></ol><ul><li><p>Rust proved invaluable for systems programming</p></li><li><p>ScyllaDB's C++ implementation eliminated GC concerns</p></li><li><p>Local SSDs with RAID mirroring provided optimal performance</p></li></ul><h2>Future Considerations</h2><ol><li><p><strong>Scaling Beyond Trillions</strong></p></li></ol><ul><li><p>Investigating new storage technologies</p></li><li><p>Exploring message archival strategies</p></li><li><p>Evaluating compression improvements</p></li></ul><ol start="2"><li><p><strong>Feature Enhancement</strong></p></li></ol><ul><li><p>Enhanced search capabilities</p></li><li><p>Improved analytics support</p></li><li><p>Better data locality</p></li></ul><ol start="3"><li><p><strong>Operational Improvements</strong></p></li></ol><ul><li><p>Automated scaling</p></li><li><p>Enhanced monitoring</p></li><li><p>Predictive maintenance</p></li></ul><h2>Conclusion</h2><p>Discord's journey from billions to trillions of messages showcases the importance of pragmatic engineering decisions, the value of custom tooling, and the benefits of choosing the right technology stack. Their success demonstrates that with careful planning, innovative solutions, and a willingness to challenge conventional approaches, even the most daunting scaling challenges can be overcome.</p><p>Are you working on similar scaling challenges? Consider:</p><ol><li><p>Evaluating your current architecture</p></li><li><p>Implementing request coalescing</p></li><li><p>Exploring modern database solutions</p></li><li><p>Contributing to open-source tools</p></li></ol><p>Are you facing similar scaling challenges? We'd love to hear about your experiences and solutions. Share your thoughts in the comments below.</p><p>References:<br><a href="http://scylladb.com/product/technology/shard-per-core-architecture/">scylladb.com/product/technology/shard-per-core-architecture/</a><br><a href="http://discord.com/blog/how-discord-stores-trillions-of-messages">discord.com/blog/how-discord-stores-trillions-of-messages</a></p><div><hr></div><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/p/how-discord-stores-trillions-of-messages?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption">Thanks for reading Dailydev.in Newsletter! This post is public so feel free to share it.</p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/p/how-discord-stores-trillions-of-messages?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.dailydev.in/p/how-discord-stores-trillions-of-messages?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><div><hr></div><p><em>Disclaimer: The details in this post have been derived from the Discord Engineering Blog. All credit for the technical details goes to the Discord engineering team. The links to the original articles are present in the references section at the end of the post. We&#8217;ve attempted to analyze the details and provide our input about them. If you find any inaccuracies or omissions, please leave a comment, and we will do our best to fix them.</em></p>]]></content:encoded></item><item><title><![CDATA[SD 6: Encryption - The Unsung Hero of Digital Security]]></title><description><![CDATA[Dive deep into encryption's world: Learn how it protects your data, explore types and real-world applications, and discover best practices for implementation.]]></description><link>https://blog.dailydev.in/p/sd-6-encryption-the-unsung-hero-of-digital</link><guid isPermaLink="false">https://blog.dailydev.in/p/sd-6-encryption-the-unsung-hero-of-digital</guid><dc:creator><![CDATA[Yashraj Balidani]]></dc:creator><pubDate>Wed, 22 Jan 2025 14:45:36 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9827aa7b-a3d2-47e9-a340-8ab49eb4223f_1055x664.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Your All-in-One Utility Platform for Developers and Beyond &#128640;</h2><p>Imagine having access to dozens of essential tools in one place&#8212;no more switching tabs, searching for utilities, or dealing with daily limits. <strong><a href="https://app.dailydev.in?utm_source=blog.dailydev.in&amp;utm_medium=system-design&amp;utm_campaign=sd6-encryption">app.dailydev.in</a></strong> is your ultimate toolbox, offering solutions for developers, analysts, and tech enthusiasts alike.</p><p>Here&#8217;s what you&#8217;ll find:</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Dailydev.in Newsletter! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><ul><li><p><strong>Code Utilities</strong>: Format code, parse JWT, generate UUIDs, and more.</p></li><li><p><strong>System Tools</strong>: Git commands, system utilities, epoch converters.</p></li><li><p><strong>Data Transformers</strong>: YAML &#8596; JSON, CSV &#8596; JSON, Base64 encoders, and URL encoders.</p></li><li><p><strong>Design Helpers</strong>: Color converters, CSS unit converters, image resizers, and HTML previews.</p></li><li><p><strong>Analysis Tools</strong>: Diff checkers, hash generators, and UTM generators.</p></li></ul><p>&#128161; <strong>Why Choose <a href="https://app.dailydev.in?utm_source=blog.dailydev.in&amp;utm_medium=system-design&amp;utm_campaign=sd6-encryption">app.dailydev.in</a>?</strong></p><ul><li><p><strong>Free &amp; Unlimited Access</strong>: No restrictions or daily limits.</p></li><li><p><strong>User-Driven Features</strong>: Share feedback, report bugs, or request new tools&#8212;we&#8217;re here to build what you need.</p></li><li><p><strong>Time-Saving</strong>: Simplify your workflow with everything you need in one platform.</p></li></ul><p>Start exploring today and see how <strong><a href="https://app.dailydev.in?utm_source=blog.dailydev.in&amp;utm_medium=system-design&amp;utm_campaign=sd6-encryption">app.dailydev.in</a></strong> can transform your productivity.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nGwW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F754418c5-f5bc-430c-b5dd-475a95154451_1272x802.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nGwW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F754418c5-f5bc-430c-b5dd-475a95154451_1272x802.webp 424w, https://substackcdn.com/image/fetch/$s_!nGwW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F754418c5-f5bc-430c-b5dd-475a95154451_1272x802.webp 848w, https://substackcdn.com/image/fetch/$s_!nGwW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F754418c5-f5bc-430c-b5dd-475a95154451_1272x802.webp 1272w, https://substackcdn.com/image/fetch/$s_!nGwW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F754418c5-f5bc-430c-b5dd-475a95154451_1272x802.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nGwW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F754418c5-f5bc-430c-b5dd-475a95154451_1272x802.webp" width="1272" height="802" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/754418c5-f5bc-430c-b5dd-475a95154451_1272x802.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:802,&quot;width&quot;:1272,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:40628,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nGwW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F754418c5-f5bc-430c-b5dd-475a95154451_1272x802.webp 424w, https://substackcdn.com/image/fetch/$s_!nGwW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F754418c5-f5bc-430c-b5dd-475a95154451_1272x802.webp 848w, https://substackcdn.com/image/fetch/$s_!nGwW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F754418c5-f5bc-430c-b5dd-475a95154451_1272x802.webp 1272w, https://substackcdn.com/image/fetch/$s_!nGwW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F754418c5-f5bc-430c-b5dd-475a95154451_1272x802.webp 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h2>Introduction:</h2><p>In our hyper-connected world, data is the new gold. But unlike physical treasures locked away in vaults, our digital assets are constantly in transit, bouncing between devices and traversing the globe in milliseconds. So how do we keep this valuable information safe from prying eyes and malicious actors? The answer lies in encryption - the silent guardian of our digital realm.</p><p>As software engineers and tech enthusiasts, understanding encryption is crucial. It's the backbone of secure communication, data protection, and privacy in the digital age. In this deep dive, we'll unravel the mysteries of encryption, explore its inner workings, and discover why it's more relevant than ever in today's technology landscape.</p><h2>What is Encryption?</h2><p>At its core, encryption is a process of encoding information in such a way that only authorized parties can access it. Think of it as a high-tech secret code that scrambles your data into an unreadable format. Without the right key to decode it, encrypted data looks like gibberish to anyone who intercepts it.</p><p>But encryption is far more than just a digital padlock. It's a sophisticated mathematical process that transforms plaintext (your original data) into ciphertext (the encrypted version) using complex algorithms and keys. This process ensures that even if someone manages to intercept your data, they can't make sense of it without the proper decryption key.</p><p><strong>The Encryption Process: A Step-by-Step Breakdown</strong></p><ol><li><p>Plaintext: This is your original, readable data.</p></li><li><p>Encryption Algorithm: A mathematical formula that scrambles the plaintext.</p></li><li><p>Encryption Key: A unique string of bits used by the algorithm to encrypt the data.</p></li><li><p>Ciphertext: The scrambled, unreadable output of the encryption process.</p></li><li><p>Transmission: The ciphertext can now be safely sent over potentially insecure channels.</p></li><li><p>Decryption Key: The recipient uses this to reverse the encryption process.</p></li><li><p>Decryption Algorithm: Applies the key to the ciphertext to recover the original plaintext.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0YDP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd137ad33-e743-4806-af91-896a6b856119_729x223.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0YDP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd137ad33-e743-4806-af91-896a6b856119_729x223.png 424w, https://substackcdn.com/image/fetch/$s_!0YDP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd137ad33-e743-4806-af91-896a6b856119_729x223.png 848w, https://substackcdn.com/image/fetch/$s_!0YDP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd137ad33-e743-4806-af91-896a6b856119_729x223.png 1272w, https://substackcdn.com/image/fetch/$s_!0YDP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd137ad33-e743-4806-af91-896a6b856119_729x223.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0YDP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd137ad33-e743-4806-af91-896a6b856119_729x223.png" width="729" height="223" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d137ad33-e743-4806-af91-896a6b856119_729x223.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ab25975a-487f-46fd-9883-527a8fc6203b_729x223.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:223,&quot;width&quot;:729,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:67682,&quot;alt&quot;:&quot;Encryption decryption of plain text&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Encryption decryption of plain text" title="Encryption decryption of plain text" srcset="https://substackcdn.com/image/fetch/$s_!0YDP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd137ad33-e743-4806-af91-896a6b856119_729x223.png 424w, https://substackcdn.com/image/fetch/$s_!0YDP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd137ad33-e743-4806-af91-896a6b856119_729x223.png 848w, https://substackcdn.com/image/fetch/$s_!0YDP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd137ad33-e743-4806-af91-896a6b856119_729x223.png 1272w, https://substackcdn.com/image/fetch/$s_!0YDP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd137ad33-e743-4806-af91-896a6b856119_729x223.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>It's worth noting that in some encryption systems, the encryption and decryption keys are the same (symmetric encryption), while in others, they're different (asymmetric encryption). We'll dive deeper into these types later.</p><h3><strong>Why Encryption Matters</strong></h3><p>In an era of data breaches, identity theft, and digital espionage, encryption serves as our first line of defense. Here's why it's crucial:</p><ol><li><p><strong>Privacy Protection: </strong>Encryption keeps your personal communications, financial data, and sensitive information away from unauthorized eyes.</p></li><li><p><strong>Data Integrity:</strong> It ensures that data hasn't been tampered with during transmission.</p></li><li><p><strong>Authentication:</strong> Encryption can verify the identity of the sender, preventing impersonation attacks.</p></li><li><p><strong>Regulatory Compliance:</strong> Many industries require encryption to meet data protection standards like <a href="https://gdpr-info.eu/?utm_source=blog.dailydev.in&amp;utm_medium=system-design&amp;utm_campaign=sd6-encryption">GDPR</a>, <a href="https://www.hhs.gov/hipaa/index.html?utm_source=blog.dailydev.in&amp;utm_medium=system-design&amp;utm_campaign=sd6-encryption">HIPAA</a>, or <a href="https://pci.gov.in/?utm_source=blog.dailydev.in&amp;utm_medium=system-design&amp;utm_campaign=sd6-encryption">PCI-DSS</a>.</p></li><li><p><strong>Trust in Digital Transactions:</strong> E-commerce, online banking, and digital signatures all rely on encryption for security.</p></li></ol><p>As software engineers, we're often tasked with building systems that handle sensitive data. Understanding encryption allows us to implement robust security measures and protect our users' information effectively.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.dailydev.in/subscribe?"><span>Subscribe now</span></a></p><h2><strong>Types of Encryption</strong></h2><p>Not all encryption is created equal. Different scenarios call for different approaches. Let's explore the two main types of encryption:</p><h3>Symmetric Encryption</h3><p>Symmetric encryption uses the same key for both encryption and decryption. It's like a secret handshake known only to the sender and recipient.</p><p><strong>Pros</strong>:</p><ul><li><p>Fast and efficient, ideal for encrypting large amounts of data</p></li><li><p>Simpler to implement compared to asymmetric encryption</p></li></ul><p><strong>Cons</strong>:</p><ul><li><p>Key distribution can be challenging, especially over insecure channels</p></li><li><p>Scalability issues in systems with many users, as each pair needs a unique shared key</p></li></ul><p>Popular symmetric algorithms include AES (<a href="https://www.geeksforgeeks.org/advanced-encryption-standard-aes/?utm_source=blog.dailydev.in&amp;utm_medium=system-design&amp;utm_campaign=sd6-encryption">Advanced Encryption Standard</a>), DES (<a href="https://www.geeksforgeeks.org/data-encryption-standard-des-set-1/?utm_source=blog.dailydev.in&amp;utm_medium=system-design&amp;utm_campaign=sd6-encryption">Data Encryption Standard</a>), and <a href="https://www.geeksforgeeks.org/blowfish-algorithm-with-examples/?utm_source=blog.dailydev.in&amp;utm_medium=system-design&amp;utm_campaign=sd6-encryption">Blowfish</a>.</p><p>Example in Python using the <code>cryptography </code><a href="https://pypi.org/project/cryptography/?utm_source=blog.dailydev.in&amp;utm_medium=system-design&amp;utm_campaign=sd6-encryption">library</a>:</p><pre><code>from cryptography.fernet import Fernet

# Generate a random symmetric key
key = Fernet.generate_key()

# Create a Fernet instance with the key
f = Fernet(key)

# Encrypt a message
message = b"Hello, World!"
encrypted = f.encrypt(message)

# Decrypt the message
decrypted = f.decrypt(encrypted)

print(f"Original: {message}")
print(f"Encrypted: {encrypted}")
print(f"Decrypted: {decrypted}")</code></pre><h3>Asymmetric Encryption</h3><p>Also known as public-key cryptography, asymmetric encryption uses a pair of keys: a public key for encryption and a private key for decryption. It's like a mailbox where anyone can drop in a letter (encrypt with the public key), but only the owner with the unique key can open it (decrypt with the private key).</p><p><strong>Pros</strong>:</p><ul><li><p>Solves the key distribution problem of symmetric encryption</p></li><li><p>Enables secure communication without prior key exchange</p></li><li><p>Supports digital signatures for authentication</p></li></ul><p><strong>Cons</strong>:</p><ul><li><p>Slower than symmetric encryption, especially for large data sets</p></li><li><p>More computationally intensive</p></li></ul><p>Popular asymmetric algorithms include <a href="https://www.rsa.com/?utm_source=blog.dailydev.in&amp;utm_medium=system-design&amp;utm_campaign=sd6-encryption&amp;utm_source=blog.dailydev.in&amp;utm_medium=system-design&amp;utm_campaign=sd6-encryption">RSA</a>, ECC (<a href="https://www.geeksforgeeks.org/blockchain-elliptic-curve-cryptography/?utm_source=blog.dailydev.in&amp;utm_medium=system-design&amp;utm_campaign=sd6-encryption">Elliptic Curve Cryptography</a>), and DSA (<a href="https://www.geeksforgeeks.org/digital-signature-algorithm-dsa/?utm_source=blog.dailydev.in&amp;utm_medium=system-design&amp;utm_campaign=sd6-encryption">Digital Signature Algorithm</a>).</p><p>Example in Python using the <code>pycryptodome</code><a href="https://pypi.org/project/pycryptodome/?utm_source=blog.dailydev.in&amp;utm_medium=system-design&amp;utm_campaign=sd6-encryption"> library</a>:</p><pre><code>from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP
import binascii

# Generate an RSA key pair
key = RSA.generate(2048)
private_key = key.export_key()
public_key = key.publickey().export_key()

# Encrypt a message with the public key
message = b"Hello, Asymmetric World!"
rsa_public_key = RSA.import_key(public_key)
rsa_public_key = PKCS1_OAEP.new(rsa_public_key)
encrypted = rsa_public_key.encrypt(message)

# Decrypt the message with the private key
rsa_private_key = RSA.import_key(private_key)
rsa_private_key = PKCS1_OAEP.new(rsa_private_key)
decrypted = rsa_private_key.decrypt(encrypted)

print(f"Original: {message}")
print(f"Encrypted: {binascii.hexlify(encrypted)}")
print(f"Decrypted: {decrypted}")</code></pre><h2>Encryption in Action: Real-World Applications</h2><p>Now that we understand the basics, let's explore how encryption is used in various real-world scenarios:</p><ol><li><p>HTTPS and SSL/TLS When you see that little padlock in your browser's address bar, you're witnessing encryption in action. HTTPS uses SSL/TLS protocols to encrypt data transmitted between your browser and web servers, protecting against eavesdropping and man-in-the-middle attacks.</p></li><li><p>End-to-End Encrypted Messaging Apps like Signal and WhatsApp use end-to-end encryption to ensure that only the intended recipients can read messages. Even the service providers can't access the content of your communications.</p></li><li><p>File and Disk Encryption Tools like <a href="https://www.veracrypt.fr/code/VeraCrypt/?utm_source=blog.dailydev.in&amp;utm_medium=system-design&amp;utm_campaign=sd6-encryption">VeraCrypt </a>or built-in options like <a href="https://learn.microsoft.com/en-us/windows/security/operating-system-security/data-protection/bitlocker/?utm_source=blog.dailydev.in&amp;utm_medium=system-design&amp;utm_campaign=sd6-encryption">BitLocker </a>(Windows) and <a href="https://support.apple.com/en-in/guide/mac-help/mh11785/mac?utm_source=blog.dailydev.in&amp;utm_medium=system-design&amp;utm_campaign=sd6-encryption">FileVault </a>(macOS) use encryption to protect data stored on your devices. If your laptop is stolen, encrypted files remain inaccessible to thieves.</p></li><li><p>Password Hashing While not encryption in the traditional sense, password hashing uses one-way cryptographic functions to securely store user passwords. This ensures that even if a database is compromised, actual passwords remain protected.</p></li><li><p>Cryptocurrency and Blockchain The entire concept of cryptocurrencies like Bitcoin relies on cryptographic principles. Public-key cryptography is used for digital signatures and secure transactions, while hash functions maintain the integrity of the blockchain.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!V5on!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9827aa7b-a3d2-47e9-a340-8ab49eb4223f_1055x664.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!V5on!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9827aa7b-a3d2-47e9-a340-8ab49eb4223f_1055x664.png 424w, https://substackcdn.com/image/fetch/$s_!V5on!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9827aa7b-a3d2-47e9-a340-8ab49eb4223f_1055x664.png 848w, https://substackcdn.com/image/fetch/$s_!V5on!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9827aa7b-a3d2-47e9-a340-8ab49eb4223f_1055x664.png 1272w, https://substackcdn.com/image/fetch/$s_!V5on!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9827aa7b-a3d2-47e9-a340-8ab49eb4223f_1055x664.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!V5on!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9827aa7b-a3d2-47e9-a340-8ab49eb4223f_1055x664.png" width="1055" height="664" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9827aa7b-a3d2-47e9-a340-8ab49eb4223f_1055x664.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f7d5a399-9e40-4bda-89d4-9a6113591103_1055x664.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:664,&quot;width&quot;:1055,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:114047,&quot;alt&quot;:&quot;Encryption real world example&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Encryption real world example" title="Encryption real world example" srcset="https://substackcdn.com/image/fetch/$s_!V5on!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9827aa7b-a3d2-47e9-a340-8ab49eb4223f_1055x664.png 424w, https://substackcdn.com/image/fetch/$s_!V5on!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9827aa7b-a3d2-47e9-a340-8ab49eb4223f_1055x664.png 848w, https://substackcdn.com/image/fetch/$s_!V5on!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9827aa7b-a3d2-47e9-a340-8ab49eb4223f_1055x664.png 1272w, https://substackcdn.com/image/fetch/$s_!V5on!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9827aa7b-a3d2-47e9-a340-8ab49eb4223f_1055x664.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4><strong>Challenges and Considerations in Encryption</strong></h4><p>While encryption is a powerful tool, it's not without its challenges:</p><ol><li><p>Key Management Securely generating, storing, and distributing encryption keys is crucial. Poor key management can undermine even the strongest encryption algorithms.</p></li><li><p>Performance Overhead Encryption and decryption processes consume computational resources. Balancing security with performance is an ongoing challenge, especially in resource-constrained environments.</p></li><li><p>Quantum Computing Threat The advent of quantum computers poses a potential threat to many current encryption methods, particularly asymmetric algorithms like RSA. This has led to research in quantum-resistant cryptography.</p></li><li><p>Legal and Ethical Considerations The use of strong encryption has sparked debates about privacy vs. national security, with some governments pushing for backdoors or key escrow systems.</p></li><li><p>Implementation Vulnerabilities Even with strong algorithms, poor implementation can lead to vulnerabilities. Side-channel attacks, for instance, can exploit the physical implementation of a cryptosystem rather than its mathematical properties.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HTBB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b936747-bafc-4677-81c5-57a81e5fbdce_952x688.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HTBB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b936747-bafc-4677-81c5-57a81e5fbdce_952x688.png 424w, https://substackcdn.com/image/fetch/$s_!HTBB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b936747-bafc-4677-81c5-57a81e5fbdce_952x688.png 848w, https://substackcdn.com/image/fetch/$s_!HTBB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b936747-bafc-4677-81c5-57a81e5fbdce_952x688.png 1272w, https://substackcdn.com/image/fetch/$s_!HTBB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b936747-bafc-4677-81c5-57a81e5fbdce_952x688.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HTBB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b936747-bafc-4677-81c5-57a81e5fbdce_952x688.png" width="952" height="688" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3b936747-bafc-4677-81c5-57a81e5fbdce_952x688.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/32e9c6aa-d942-4c32-923f-a0cffeb301fa_952x688.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:688,&quot;width&quot;:952,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:96566,&quot;alt&quot;:&quot;Encryption challemges&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Encryption challemges" title="Encryption challemges" srcset="https://substackcdn.com/image/fetch/$s_!HTBB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b936747-bafc-4677-81c5-57a81e5fbdce_952x688.png 424w, https://substackcdn.com/image/fetch/$s_!HTBB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b936747-bafc-4677-81c5-57a81e5fbdce_952x688.png 848w, https://substackcdn.com/image/fetch/$s_!HTBB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b936747-bafc-4677-81c5-57a81e5fbdce_952x688.png 1272w, https://substackcdn.com/image/fetch/$s_!HTBB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b936747-bafc-4677-81c5-57a81e5fbdce_952x688.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Best Practices for Implementing Encryption</strong></h2><p>As software engineers, we play a crucial role in implementing encryption correctly. Here are some best practices to keep in mind:</p><ol><li><p>Use Well-Established Algorithms Don't roll your own crypto. Stick to well-vetted, publicly scrutinized algorithms and libraries.</p></li><li><p>Keep Encryption Keys Secure Use secure key management systems and avoid hardcoding keys in your source code.</p></li><li><p>Use Strong Key Sizes Ensure your key sizes are adequate for the level of security required. For instance, use at least 2048-bit keys for RSA.</p></li><li><p>Implement Perfect Forward Secrecy This ensures that even if long-term keys are compromised, past communications remain secure.</p></li><li><p>Regular Security Audits Conduct regular audits of your cryptographic implementations to identify and address any vulnerabilities.</p></li><li><p>Stay Updated Cryptography is an evolving field. Stay informed about the latest developments, vulnerabilities, and best practices.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!syJ2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feedaa37d-9fe8-4edc-a593-be11ca2f8f45_926x596.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!syJ2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feedaa37d-9fe8-4edc-a593-be11ca2f8f45_926x596.png 424w, https://substackcdn.com/image/fetch/$s_!syJ2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feedaa37d-9fe8-4edc-a593-be11ca2f8f45_926x596.png 848w, https://substackcdn.com/image/fetch/$s_!syJ2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feedaa37d-9fe8-4edc-a593-be11ca2f8f45_926x596.png 1272w, https://substackcdn.com/image/fetch/$s_!syJ2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feedaa37d-9fe8-4edc-a593-be11ca2f8f45_926x596.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!syJ2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feedaa37d-9fe8-4edc-a593-be11ca2f8f45_926x596.png" width="926" height="596" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/eedaa37d-9fe8-4edc-a593-be11ca2f8f45_926x596.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5f11aa75-4c29-4fe7-8be2-f810625acf1f_926x596.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:596,&quot;width&quot;:926,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:84926,&quot;alt&quot;:&quot;Encryption best practices&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Encryption best practices" title="Encryption best practices" srcset="https://substackcdn.com/image/fetch/$s_!syJ2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feedaa37d-9fe8-4edc-a593-be11ca2f8f45_926x596.png 424w, https://substackcdn.com/image/fetch/$s_!syJ2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feedaa37d-9fe8-4edc-a593-be11ca2f8f45_926x596.png 848w, https://substackcdn.com/image/fetch/$s_!syJ2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feedaa37d-9fe8-4edc-a593-be11ca2f8f45_926x596.png 1272w, https://substackcdn.com/image/fetch/$s_!syJ2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feedaa37d-9fe8-4edc-a593-be11ca2f8f45_926x596.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h2><strong>The Future of Encryption</strong></h2><p>As technology advances, so too does the field of cryptography. Here are some exciting developments to watch:</p><ol><li><p>Post-Quantum Cryptography Researchers are developing new algorithms resistant to attacks by quantum computers. NIST is currently in the process of standardizing post-quantum cryptographic algorithms.</p></li><li><p>Homomorphic Encryption This revolutionary approach allows computations to be performed on encrypted data without decrypting it first, opening up new possibilities for secure cloud computing.</p></li><li><p>Blockchain and Decentralized Systems The principles of cryptography are being applied in innovative ways to create secure, decentralized systems beyond just cryptocurrencies.</p></li><li><p>Quantum Key Distribution Quantum physics principles are being used to create theoretically unbreakable encryption methods for key distribution.</p></li></ol><h2><strong>Conclusion</strong></h2><p>Encryption is the unsung hero of our digital world, silently protecting our data and communications from prying eyes. As software engineers and tech enthusiasts, understanding encryption is not just about implementing security features - it's about being guardians of digital privacy and trust.</p><p>From the symmetric ciphers that secure our stored data to the asymmetric algorithms that enable secure internet communications, encryption touches every aspect of our digital lives. By mastering these concepts, we can build more secure systems, protect user data more effectively, and contribute to a safer digital ecosystem.</p><p>As we stand on the brink of new technological frontiers - quantum computing, AI, and beyond - the importance of robust encryption will only grow. It's an exciting time to be in this field, with new challenges and innovations emerging constantly.</p><p>So, the next time you see that little padlock in your browser or send an encrypted message, take a moment to appreciate the complex mathematics and ingenious algorithms working behind the scenes. And remember, as builders of the digital world, the responsibility of implementing and maintaining these crucial security measures falls to us.</p><p>Let's encrypt, protect, and innovate - for a more secure digital future.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[SD 5: What is DNS and how does it work?]]></title><description><![CDATA[Demystifying DNS: The Internet's Hidden Directory Service. Uncover the secrets of DNS, the internet's hidden directory. Learn how it works, its critical role in web navigation, and why it matters for tech enthusiasts and engineers.]]></description><link>https://blog.dailydev.in/p/sd-5-what-is-dns-and-how-does-it-work</link><guid isPermaLink="false">https://blog.dailydev.in/p/sd-5-what-is-dns-and-how-does-it-work</guid><dc:creator><![CDATA[Yashraj Balidani]]></dc:creator><pubDate>Wed, 15 Jan 2025 14:31:04 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f1ebd54-a562-47d3-86d4-a0284c75c237_395x1248.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Your All-in-One Utility Platform for Developers and Beyond &#128640;</h2><p>Imagine having access to dozens of essential tools in one place&#8212;no more switching tabs, searching for utilities, or dealing with daily limits. <strong><a href="https://app.dailydev.in?utm_source=blog.dailydev.in&amp;utm_medium=referral&amp;utm_campaign=sd-5">app.dailydev.in</a></strong> is your ultimate toolbox, offering solutions for developers, analysts, and tech enthusiasts alike.</p><p>Here&#8217;s what you&#8217;ll find:</p><ul><li><p><strong>Code Utilities</strong>: Format code, parse JWT, generate UUIDs, and more.</p></li><li><p><strong>System Tools</strong>: Git commands, system utilities, epoch converters.</p></li><li><p><strong>Data Transformers</strong>: YAML &#8596; JSON, CSV &#8596; JSON, Base64 encoders, and URL encoders.</p></li><li><p><strong>Design Helpers</strong>: Color converters, CSS unit converters, image resizers, and HTML previews.</p></li><li><p><strong>Analysis Tools</strong>: Diff checkers, hash generators, and UTM generators.</p></li></ul><p>&#128161; <strong>Why Choose <a href="https://app.dailydev.in?utm_source=blog.dailydev.in&amp;utm_medium=referral&amp;utm_campaign=sd-5">app.dailydev.in</a>?</strong></p><ul><li><p><strong>Free &amp; Unlimited Access</strong>: No restrictions or daily limits.</p></li><li><p><strong>User-Driven Features</strong>: Share feedback, report bugs, or request new tools&#8212;we&#8217;re here to build what you need.</p></li><li><p><strong>Time-Saving</strong>: Simplify your workflow with everything you need in one platform.</p></li></ul><p>Start exploring today and see how <strong><a href="https://app.dailydev.in?utm_source=blog.dailydev.in&amp;utm_medium=referral&amp;utm_campaign=sd-4-what-are-microservices">app.dailydev.in</a></strong> can transform your productivity.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jVMA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jVMA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 424w, https://substackcdn.com/image/fetch/$s_!jVMA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 848w, https://substackcdn.com/image/fetch/$s_!jVMA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 1272w, https://substackcdn.com/image/fetch/$s_!jVMA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jVMA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png" width="1456" height="918" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:918,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:441557,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!jVMA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 424w, https://substackcdn.com/image/fetch/$s_!jVMA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 848w, https://substackcdn.com/image/fetch/$s_!jVMA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 1272w, https://substackcdn.com/image/fetch/$s_!jVMA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h2>Introduction</h2><p>Imagine trying to navigate a vast, bustling city without street names or addresses - just a sea of IP numbers. That's what the internet would be like without the Domain Name System (DNS). For tech enthusiasts, software engineers, and aspiring technologists, understanding DNS is crucial. It's the silent workhorse that makes the internet user-friendly and navigable. In this deep dive, we'll unravel the mysteries of DNS, exploring how it works, why it's critical, and the challenges it faces in our increasingly connected world.</p><h2>What is DNS?</h2><p>At its core, DNS is like the internet's phone book. It translates the human-readable domain names we type into our browsers (like www.example.com) into the IP addresses that computers use to identify each other (like 192.0.2.1). This translation is essential because while we're great at remembering names, computers communicate more efficiently with numbers.</p><p>Key Components of DNS:</p><ol><li><p>Domain Names: The human-readable addresses (e.g., www.google.com)</p></li><li><p>IP Addresses: The numerical identifiers for networked devices</p></li><li><p>DNS Servers: The infrastructure that stores and provides DNS information</p></li><li><p>DNS Records: Different types of data stored in DNS servers</p></li></ol><h3>The DNS Hierarchy</h3><p>DNS is structured hierarchically, much like an inverted tree:</p><ol><li><p>Root Zone: The starting point of DNS resolution, represented by a dot (.)</p></li><li><p>Top-Level Domains (TLDs): Such as .com, .org, .net</p></li><li><p>Second-Level Domains: The main part of a web address (e.g., "google" in google.com)</p></li><li><p>Subdomains: Additional prefixes like "www" or "mail"</p></li></ol><p>This structure allows for efficient management and distribution of DNS information across the globe.</p><h2>How DNS Works: A Step-by-Step Breakdown</h2><p>Let's walk through what happens when you type "www.example.com" into your browser:</p><ol><li><p>Local DNS Cache Check: Your computer first checks its local DNS cache to see if it already knows the IP address.</p></li><li><p>Recursive DNS Query: If not found locally, your computer asks your ISP's DNS resolver to find the IP address.</p></li><li><p>Root Server Query: If the ISP's resolver doesn't have the answer, it asks a root server.</p></li><li><p>TLD Server Query: The root server directs the resolver to the TLD server for ".com".</p></li><li><p>Authoritative Name Server Query: The TLD server points to the authoritative name server for "example.com".</p></li><li><p>IP Address Return: The authoritative server provides the IP address for "www.example.com".</p></li><li><p>Caching: The resolver caches this information for future use and returns it to your computer.</p></li><li><p>Connection Establishment: Your browser can now connect to the web server at that IP address.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NO11!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f1ebd54-a562-47d3-86d4-a0284c75c237_395x1248.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NO11!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f1ebd54-a562-47d3-86d4-a0284c75c237_395x1248.png 424w, https://substackcdn.com/image/fetch/$s_!NO11!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f1ebd54-a562-47d3-86d4-a0284c75c237_395x1248.png 848w, https://substackcdn.com/image/fetch/$s_!NO11!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f1ebd54-a562-47d3-86d4-a0284c75c237_395x1248.png 1272w, https://substackcdn.com/image/fetch/$s_!NO11!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f1ebd54-a562-47d3-86d4-a0284c75c237_395x1248.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NO11!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f1ebd54-a562-47d3-86d4-a0284c75c237_395x1248.png" width="395" height="1248" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5f1ebd54-a562-47d3-86d4-a0284c75c237_395x1248.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6e5247b6-8266-4aed-833a-0ae5b7fb32e5_395x1248.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1248,&quot;width&quot;:395,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:62065,&quot;alt&quot;:&quot;DNS look up workflow&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="DNS look up workflow" title="DNS look up workflow" srcset="https://substackcdn.com/image/fetch/$s_!NO11!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f1ebd54-a562-47d3-86d4-a0284c75c237_395x1248.png 424w, https://substackcdn.com/image/fetch/$s_!NO11!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f1ebd54-a562-47d3-86d4-a0284c75c237_395x1248.png 848w, https://substackcdn.com/image/fetch/$s_!NO11!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f1ebd54-a562-47d3-86d4-a0284c75c237_395x1248.png 1272w, https://substackcdn.com/image/fetch/$s_!NO11!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f1ebd54-a562-47d3-86d4-a0284c75c237_395x1248.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>This entire process typically takes just milliseconds, showcasing the remarkable efficiency of the DNS system.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Dailydev.in Newsletter! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h2>DNS Record Types: More Than Just IP Addresses</h2><p>DNS isn't just about IP addresses. It stores various types of records, each serving a specific purpose:</p><ol><li><p>A Record: Maps a domain to an IPv4 address</p></li><li><p>AAAA Record: Maps a domain to an IPv6 address</p></li><li><p>CNAME Record: Creates an alias from one domain to another</p></li><li><p>MX Record: Specifies mail servers for the domain</p></li><li><p>TXT Record: Stores text information, often used for verification purposes</p></li><li><p>NS Record: Indicates which name servers are authoritative for the domain</p></li></ol><p>Understanding these record types is crucial for managing domain configurations and troubleshooting DNS issues.</p><h2>DNS Caching: Speed vs. Accuracy</h2><p>DNS caching occurs at multiple levels - from your local machine to your ISP - to speed up future requests. While this significantly improves performance, it can lead to outdated information persisting. This is why DNS changes can take time to propagate across the internet, a concept known as DNS propagation time.</p><h2>DNS Security: Protecting the Internet's Directory</h2><p>As a critical internet infrastructure, DNS is a prime target for cyberattacks. Some key security concerns include:</p><ol><li><p>DNS Cache Poisoning: Injecting false information into DNS caches</p></li><li><p>DNS Tunneling: Using DNS queries to smuggle other data in and out of networks</p></li><li><p>DDoS Attacks: Overwhelming DNS servers with traffic</p></li></ol><p>To combat these threats, several security measures have been developed:</p><ol><li><p>DNSSEC (DNS Security Extensions): Adds cryptographic signatures to DNS records</p></li><li><p>DNS over HTTPS (DoH): Encrypts DNS queries to protect privacy</p></li><li><p>Response Policy Zones (RPZ): Allows DNS servers to return modified responses to malicious queries</p></li></ol><p>For software engineers and security enthusiasts, understanding these security measures is crucial in building robust, secure systems.</p><h2>DNS in the Cloud Era</h2><p>Cloud computing has introduced new complexities and opportunities in DNS management:</p><ol><li><p>Geo-routing: Using DNS to direct users to the nearest server</p></li><li><p>Load Balancing: Distributing traffic across multiple servers</p></li><li><p>Blue-Green Deployments: Using DNS to switch between different versions of an application</p></li></ol><p>These techniques leverage DNS's flexibility to improve application performance and reliability.</p><h2>Troubleshooting DNS: Essential Skills for Tech Professionals</h2><p>When websites or services go down, DNS is often the first suspect. Here are some essential troubleshooting tools:</p><ol><li><p><a href="https://www.nslookup.io/?utm_source=blog.dailydev.in&amp;utm_medium=referall&amp;utm_campaign=sd-5-what-is-DNS-and-how-does-it-work">nslookup</a>/dig: Command-line tools for querying DNS servers</p></li><li><p><a href="https://traceroute-online.com/?utm_source=blog.dailydev.in&amp;utm_medium=referall&amp;utm_campaign=sd-5-what-is-DNS-and-how-does-it-work">traceroute</a>: Shows the path packets take to reach a domain</p></li><li><p><a href="https://dnschecker.org/?utm_source=blog.dailydev.in&amp;utm_medium=referall&amp;utm_campaign=sd-5-what-is-DNS-and-how-does-it-work">DNS Propagation Checkers</a>: Online tools to check DNS propagation status</p></li></ol><p>Mastering these tools can make you an invaluable asset in resolving network issues.</p><h2>The Future of DNS</h2><p>As the internet evolves, so does DNS. Here are some trends to watch:</p><ol><li><p>DNS over HTTPS and DNS over TLS: Enhancing privacy and security</p></li><li><p>DANE (DNS-based Authentication of Named Entities): Using DNS to distribute public keys</p></li><li><p>Blockchain DNS: Decentralized domain name management</p></li></ol><p>These developments aim to make DNS more secure, private, and resistant to censorship.</p><h2>DNS in Practice: Real-World Applications</h2><p>To truly appreciate DNS, let's look at some practical applications:</p><ol><li><p>Content Delivery Networks (CDNs): Use DNS to route users to the nearest server</p></li><li><p>Email Systems: Rely on MX records for mail routing</p></li><li><p>Service Discovery: In microservices architectures, DNS can be used for service discovery</p></li></ol><p>Understanding these applications can help in designing scalable, efficient systems.</p><h2>Conclusion: The Unsung Hero of the Internet</h2><p>DNS is the unsung hero of the internet, working tirelessly behind the scenes to make our online experiences seamless. For tech enthusiasts, software engineers, and students, a deep understanding of DNS is not just academic - it's a powerful tool in your technical arsenal. Whether you're troubleshooting network issues, designing distributed systems, or simply curious about how the internet works, DNS knowledge is invaluable.</p><p>As we've explored, DNS is a complex system with many moving parts, but its fundamental purpose remains simple: to make the internet accessible and usable for humans while enabling efficient machine-to-machine communication. As the internet continues to evolve, DNS will undoubtedly adapt and grow with it, remaining at the heart of our connected world.</p><h2>Call to Action:</h2><ol><li><p>Experiment with DNS: Try using tools like dig or <a href="https://www.nslookup.io/?utm_source=blog.dailydev.in&amp;utm_medium=referall&amp;utm_campaign=sd-5-what-is-DNS-and-how-does-it-work">nslookup </a>to explore DNS records for your favorite websites. What can you discover?</p></li><li><p>Secure Your Domain: If you manage a domain, ensure you're using DNSSEC and consider implementing DNS over HTTPS.</p></li><li><p>Stay Informed: Keep an eye on emerging DNS technologies and standards. They could shape the future of internet infrastructure.</p></li><li><p>Share Your Knowledge: DNS is often misunderstood. Share what you've learned with your peers and help demystify this crucial technology.</p></li></ol><p>Remember, in the world of technology, understanding the fundamentals like DNS sets you apart. It's not just about knowing how to use tools, but understanding how they work under the hood. So next time you type a URL into your browser, take a moment to appreciate the complex dance of DNS that makes it all possible.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Dailydev.in Newsletter! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[SD 4: What are microservices?]]></title><description><![CDATA[Explore the differences between microservices and monolithic architectures, their pros and cons, and how to choose the best approach for your software project.]]></description><link>https://blog.dailydev.in/p/what-are-microservices</link><guid isPermaLink="false">https://blog.dailydev.in/p/what-are-microservices</guid><dc:creator><![CDATA[Yashraj Balidani]]></dc:creator><pubDate>Wed, 08 Jan 2025 15:22:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Your All-in-One Utility Platform for Developers and Beyond &#128640; </h2><p>Imagine having access to dozens of essential tools in one place&#8212;no more switching tabs, searching for utilities, or dealing with daily limits. <strong><a href="https://app.dailydev.in?utm_source=blog.dailydev.in&amp;utm_medium=referral&amp;utm_campaign=sd-4-what-are-microservices">app.dailydev.in</a></strong> is your ultimate toolbox, offering solutions for developers, analysts, and tech enthusiasts alike.</p><p>Here&#8217;s what you&#8217;ll find:</p><ul><li><p><strong>Code Utilities</strong>: Format code, parse JWT, generate UUIDs, and more.</p></li><li><p><strong>System Tools</strong>: Git commands, system utilities, epoch converters.</p></li><li><p><strong>Data Transformers</strong>: YAML &#8596; JSON, CSV &#8596; JSON, Base64 encoders, and URL encoders.</p></li><li><p><strong>Design Helpers</strong>: Color converters, CSS unit converters, image resizers, and HTML previews.</p></li><li><p><strong>Analysis Tools</strong>: Diff checkers, hash generators, and UTM generators.</p></li></ul><p>&#128161; <strong>Why Choose <a href="https://app.dailydev.in?utm_source=blog.dailydev.in&amp;utm_medium=referral&amp;utm_campaign=sd-4-what-are-microservices">app.dailydev.in</a>?</strong></p><ul><li><p><strong>Free &amp; Unlimited Access</strong>: No restrictions or daily limits.</p></li><li><p><strong>User-Driven Features</strong>: Share feedback, report bugs, or request new tools&#8212;we&#8217;re here to build what you need.</p></li><li><p><strong>Time-Saving</strong>: Simplify your workflow with everything you need in one platform.</p></li></ul><p>Start exploring today and see how <strong><a href="https://app.dailydev.in?utm_source=blog.dailydev.in&amp;utm_medium=referral&amp;utm_campaign=sd-4-what-are-microservices">app.dailydev.in</a></strong> can transform your productivity.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jVMA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jVMA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 424w, https://substackcdn.com/image/fetch/$s_!jVMA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 848w, https://substackcdn.com/image/fetch/$s_!jVMA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 1272w, https://substackcdn.com/image/fetch/$s_!jVMA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jVMA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png" width="1456" height="918" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:918,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:441557,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!jVMA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 424w, https://substackcdn.com/image/fetch/$s_!jVMA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 848w, https://substackcdn.com/image/fetch/$s_!jVMA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 1272w, https://substackcdn.com/image/fetch/$s_!jVMA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><p>Welcome to DailyDev.in, where we help software engineers level up their skills! Today, we're diving into the fascinating world of microservices. Buckle up, tech enthusiasts - this is going to be an exciting ride!</p><p>Have you ever wondered how tech giants like Netflix handle massive amounts of data and traffic? The secret sauce is microservices! But what exactly are they, and why should you care? Let's break it down.</p><h3>&#127959;&#65039; Microservices: The Building Blocks of Modern Software</h3><p>Imagine you're constructing a digital city. Instead of building one massive, monolithic structure, you create smaller, specialized buildings that work together seamlessly. That's the essence of microservices!</p><blockquote><p>Q: Can you think of any advantages this approach might have over a single, large structure?</p></blockquote><p>Microservices are like individual Lego blocks that fit together to create a larger, more flexible application. Each "block" or service is:</p><ol><li><p>Self-contained</p></li><li><p>Focused on a specific function</p></li><li><p>Independently deployable and scalable</p></li></ol><p>&#129300; Think about it: How might this architecture benefit large teams working on complex projects?</p><p>Let's take a trip down memory lane to understand how we got here.</p><h4>&#128197; The Evolution of Software Architecture</h4><p><strong>1970s</strong>: Computers tackle simple, scientific problems </p><p><strong>1990s</strong>: Businesses start adopting software solutions </p><p><strong>Early 2000s</strong>: Social media emerges</p><p>Fast forward to today, and software is everywhere! From ordering a ride to transferring money, our daily lives are powered by applications.</p><p><strong>&#128722; The Amazon Example</strong></p><p>Consider Amazon's website. It's not just one big application, but a collection of microservices handling various functions:</p><ul><li><p>Product search</p></li><li><p>User accounts</p></li><li><p>Shopping cart</p></li><li><p>Payment processing</p></li><li><p>Seller marketplace</p></li></ul><p>Each of these could be a separate microservice, working together to create the Amazon experience we know.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!D95q!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44747cfb-6244-470f-a02b-d0304101545a_570x293.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!D95q!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44747cfb-6244-470f-a02b-d0304101545a_570x293.png 424w, https://substackcdn.com/image/fetch/$s_!D95q!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44747cfb-6244-470f-a02b-d0304101545a_570x293.png 848w, https://substackcdn.com/image/fetch/$s_!D95q!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44747cfb-6244-470f-a02b-d0304101545a_570x293.png 1272w, https://substackcdn.com/image/fetch/$s_!D95q!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44747cfb-6244-470f-a02b-d0304101545a_570x293.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!D95q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44747cfb-6244-470f-a02b-d0304101545a_570x293.png" width="570" height="293" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/44747cfb-6244-470f-a02b-d0304101545a_570x293.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0d327cce-1198-4f84-aba0-cf1f394e50d2_570x293.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:293,&quot;width&quot;:570,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:84569,&quot;alt&quot;:&quot;Amazon.com microservices&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Amazon.com microservices" title="Amazon.com microservices" srcset="https://substackcdn.com/image/fetch/$s_!D95q!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44747cfb-6244-470f-a02b-d0304101545a_570x293.png 424w, https://substackcdn.com/image/fetch/$s_!D95q!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44747cfb-6244-470f-a02b-d0304101545a_570x293.png 848w, https://substackcdn.com/image/fetch/$s_!D95q!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44747cfb-6244-470f-a02b-d0304101545a_570x293.png 1272w, https://substackcdn.com/image/fetch/$s_!D95q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44747cfb-6244-470f-a02b-d0304101545a_570x293.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>&#128101; Team Collaboration in Microservices</p><p>Imagine you have a team of 50 developers. With microservices, you could:</p><ul><li><p>Divide into 10 teams of 5 members each</p></li><li><p>Assign each team to a specific service</p></li><li><p>Allow teams to work independently and choose their preferred technologies</p></li></ul><p><em>Question for you: How do you think this approach might impact team productivity and innovation?</em></p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Enjoying this post! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h3>&#127963;&#65039; Monoliths vs. Microservices: The Great Debate</h3><p>Let's compare these two architectural approaches:</p><p><strong>Monoliths:</strong></p><ul><li><p>Simple and fast initial development</p></li><li><p>High performance for smaller applications</p></li></ul><ul><li><p>Harder to scale as complexity grows</p></li><li><p>Technology stack limitations</p></li><li><p>Entire application affected by issues</p></li></ul><p><strong>Microservices:</strong></p><ul><li><p>Easier to scale specific functions</p></li><li><p>Technology flexibility</p></li><li><p>Isolated failures</p></li></ul><ul><li><p>More complex to set up and manage</p></li><li><p>Requires strong DevOps practices</p></li></ul><blockquote><p>Fun fact: <a href="https://research.google/pubs/why-google-stores-billions-of-lines-of-code-in-a-single-repository/?utm_source=blog.dailydev.in&amp;utm_medium=referral&amp;utm_campaign=ds-4-what-are-microservices">Google uses a monolithic architecture</a>, while <a href="https://www.techaheadcorp.com/blog/design-of-microservices-architecture-at-netflix/?utm_source=blog.dailydev.in&amp;utm_medium=referral&amp;utm_campaign=sd-4-what-are-microservices">Netflix embraces microservices</a>. There's no one-size-fits-all solution!</p></blockquote><p>&#129299; Pop Quiz: Can you name one advantage and one disadvantage of each approach?</p><h3>&#128295; The Nuts and Bolts of Microservices</h3><p>So, how do these little services talk to each other? Through <a href="https://blog.dailydev.in/p/unlocking-the-secrets-of-api-protocols?utm_source=blog.dailydev.in&amp;utm_medium=referral&amp;utm_campaign=sd-4-what-are-microservices">APIs</a> and protocols like gRPC. It's like each service has its own phone number, and they call each other when they need something.</p><p>But wait, it's not all sunshine and rainbows! Microservices come with their own set of challenges:</p><ol><li><p>Service discovery: How do services find each other?</p></li><li><p>API Gateway: Who manages all the incoming requests?</p></li><li><p>Resilience: What happens if one service fails?</p></li></ol><h4>&#128640; Implementing Microservices: More Than Just Coding</h4><p>Before you start coding, you need to design your microservices architecture carefully. Ask yourself:</p><ul><li><p>How will you divide your application into services?</p></li><li><p>What communication patterns will you use?</p></li><li><p>How will you handle data consistency across services?</p></li></ul><blockquote><p>Remember: Poor design can lead to a distributed mess that's worse than a monolith!</p></blockquote><p>&#128161; Pro Tip: Start with a monolith and gradually break it into microservices as your application grows and your needs become clearer.</p><h4>&#128272; Security in Microservices</h4><p>With multiple services, security becomes more complex. You need to consider:</p><ul><li><p>Authentication between services</p></li><li><p>Authorization for user requests</p></li><li><p>Data encryption in transit</p></li></ul><p>How would you approach these security challenges in a microservices architecture?</p><h4>&#127917; Real-World Examples</h4><ol><li><p>Netflix: Uses microservices to handle millions of streams simultaneously</p></li><li><p>Uber: Manages ride requests, payments, and driver locations with microservices</p></li><li><p>Airbnb: Scales its accommodation platform using a microservices approach</p></li></ol><p>Can you think of other companies that might benefit from a microservices architecture?</p><p><strong>&#129504; Food for Thought</strong></p><ol><li><p>How might microservices impact the way you approach software development?</p></li><li><p>What skills do you think are crucial for working with microservices?</p></li><li><p>How could microservices influence your career path in software engineering?</p></li></ol><h3>&#127881; Wrapping Up</h3><p>Microservices are revolutionizing the way we build and scale software. They offer flexibility, scalability, and the ability to innovate rapidly. However, they also come with increased complexity and operational challenges.</p><p>As a young professional in tech, understanding microservices can give you a significant edge in your career. Whether you're looking to switch jobs or grow in your current role, this knowledge is invaluable in today's software landscape.</p><p><strong>&#128640; Take Action!</strong></p><ol><li><p>Research a company you admire and try to determine if they use microservices.</p></li><li><p>Experiment with breaking down a simple application into microservices.</p></li><li><p>Discuss microservices with your colleagues or in online tech communities.</p></li></ol><p>Remember, the journey to mastering microservices is ongoing. Stay curious, keep learning, and don't be afraid to experiment!</p><p>What's your take on microservices? Are you excited to explore this architecture further? Share your thoughts and let's continue this conversation!</p><div><hr></div><h3>Recommended Reads for Your Career Journey</h3><p>Explore these highly recommended books to deepen your knowledge in <strong>System Design, Software Engineering, and Coding</strong>:</p><ol><li><p><strong>Designing Data-Intensive Applications</strong> by Martin Kleppmann<br>A must-read for understanding distributed systems and modern data engineering.<br><a href="https://amzn.to/4iU2Z9I">View here</a></p></li><li><p><strong>System Design Interview &#8211; An Insider's Guide</strong> by Alex Xu<br>Perfect for preparing for system design interviews with practical case studies.<br><a href="https://amzn.to/4iPM6gC">View here</a></p></li><li><p><strong>Clean Code: A Handbook of Agile Software Craftsmanship</strong> by Robert C. Martin<br>Learn how to write code that is readable, maintainable, and efficient.<br><a href="https://amzn.to/3ZPjrzr">View here</a></p></li><li><p><strong>The Pragmatic Programmer: Your Journey to Mastery</strong> by Andy Hunt and Dave Thomas<br>A timeless guide for becoming a well-rounded software developer.<br><a href="https://amzn.to/3ZV318C">view here</a></p></li><li><p><strong>Operating Systems: Three Easy Pieces</strong> by Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau<br>Dive deep into the fundamentals of operating systems.<br><a href="https://amzn.to/4fuFbq5">view here</a></p></li></ol><div><hr></div>]]></content:encoded></item><item><title><![CDATA[SD 3: What is proxy and reverse proxy?]]></title><description><![CDATA[Curious how websites handle massive traffic and stay secure? Dive into the world of proxy and reverse proxy servers! Learn how these digital guardians protect networks, balance loads, and keep your browsing anonymous. Perfect for tech-savvy professionals and students looking to level up their web knowledge.]]></description><link>https://blog.dailydev.in/p/sd-3-what-is-proxy-and-reverse-proxy</link><guid isPermaLink="false">https://blog.dailydev.in/p/sd-3-what-is-proxy-and-reverse-proxy</guid><dc:creator><![CDATA[Yashraj Balidani]]></dc:creator><pubDate>Wed, 01 Jan 2025 15:38:58 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77aa2d6f-5b3e-4c0b-a7d2-c3837d03ede9_800x350.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div><hr></div><h2>Your All-in-One Utility Platform for Developers and Beyond &#128640; (Promotion)</h2><p>Imagine having access to dozens of essential tools in one place&#8212;no more switching tabs, searching for utilities, or dealing with daily limits. <strong><a href="https://app.dailydev.in">app.dailydev.in</a></strong> is your ultimate toolbox, offering solutions for developers, analysts, and tech enthusiasts alike.</p><p>Here&#8217;s what you&#8217;ll find:</p><ul><li><p><strong>Code Utilities</strong>: Format code, parse JWT, generate UUIDs, and more.</p></li><li><p><strong>System Tools</strong>: Git commands, system utilities, epoch converters.</p></li><li><p><strong>Data Transformers</strong>: YAML &#8596; JSON, CSV &#8596; JSON, Base64 encoders, and URL encoders.</p></li><li><p><strong>Design Helpers</strong>: Color converters, CSS unit converters, image resizers, and HTML previews.</p></li><li><p><strong>Analysis Tools</strong>: Diff checkers, hash generators, and UTM generators.</p></li></ul><p>&#128161; <strong>Why Choose app.dailydev.in?</strong></p><ul><li><p><strong>Free &amp; Unlimited Access</strong>: No restrictions or daily limits.</p></li><li><p><strong>User-Driven Features</strong>: Share feedback, report bugs, or request new tools&#8212;we&#8217;re here to build what you need.</p></li><li><p><strong>Time-Saving</strong>: Simplify your workflow with everything you need in one platform.</p></li></ul><p>Start exploring today and see how <strong><a href="https://app.dailydev.in">app.dailydev.in</a></strong> can transform your productivity.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jVMA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jVMA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 424w, https://substackcdn.com/image/fetch/$s_!jVMA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 848w, https://substackcdn.com/image/fetch/$s_!jVMA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 1272w, https://substackcdn.com/image/fetch/$s_!jVMA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jVMA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png" width="1456" height="918" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:918,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:441557,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!jVMA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 424w, https://substackcdn.com/image/fetch/$s_!jVMA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 848w, https://substackcdn.com/image/fetch/$s_!jVMA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 1272w, https://substackcdn.com/image/fetch/$s_!jVMA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22a059be-21c5-4f50-a96c-9cecc5af80a2_3000x1892.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><p>Hey there, tech enthusiasts and curious minds! &#128075; Ever wondered how your favorite websites handle millions of requests without breaking a sweat? Or how your company keeps its network secure from prying eyes? Today, we're diving into the fascinating world of proxies and reverse proxies. Buckle up &#8211; it's going to be an exciting ride!</p><div class="pullquote"><p>&#129300; Pop Quiz: What's the first thing that comes to mind when you hear the word "proxy"?</p><p>A Proxy is someone or something that has the authority to function (do something) on behalf of another person or thing. Thus, Proxy generally means acting on the behalf of others.</p></div><h4>What is a Proxy, Anyway?</h4><p>Imagine you're at a fancy restaurant, and you want to order something off-menu. Instead of barging into the kitchen yourself, you tell the waiter what you want, and they relay your request to the chef. In this scenario, the waiter is acting as a proxy &#8211; they're the middleman between you and the kitchen.</p><p>In the digital world, a proxy server plays a similar role. It's an intermediary between your device and the internet, handling requests on your behalf.</p><p>&#128269; Think About It: How many times a day do you think your online activities go through a proxy without you even realizing it?</p><h2>Forward Proxy: Your Digital Bodyguard</h2><p>Now, let's talk about a specific type of proxy &#8211; the forward proxy. Picture this:</p><p>You're in a corporate office, trying to access a website. Instead of connecting directly to that site, your request first goes through a forward proxy server. This server then makes the request on your behalf and returns the results to you.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!W2AQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77aa2d6f-5b3e-4c0b-a7d2-c3837d03ede9_800x350.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!W2AQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77aa2d6f-5b3e-4c0b-a7d2-c3837d03ede9_800x350.png 424w, https://substackcdn.com/image/fetch/$s_!W2AQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77aa2d6f-5b3e-4c0b-a7d2-c3837d03ede9_800x350.png 848w, https://substackcdn.com/image/fetch/$s_!W2AQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77aa2d6f-5b3e-4c0b-a7d2-c3837d03ede9_800x350.png 1272w, https://substackcdn.com/image/fetch/$s_!W2AQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77aa2d6f-5b3e-4c0b-a7d2-c3837d03ede9_800x350.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!W2AQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77aa2d6f-5b3e-4c0b-a7d2-c3837d03ede9_800x350.png" width="800" height="350" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/77aa2d6f-5b3e-4c0b-a7d2-c3837d03ede9_800x350.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3027ffcd-d197-4aa8-8e65-7b7879a4524e_800x350.gif&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:350,&quot;width&quot;:800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:574724,&quot;alt&quot;:&quot;Forward proxy server&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/gif&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Forward proxy server" title="Forward proxy server" srcset="https://substackcdn.com/image/fetch/$s_!W2AQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77aa2d6f-5b3e-4c0b-a7d2-c3837d03ede9_800x350.png 424w, https://substackcdn.com/image/fetch/$s_!W2AQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77aa2d6f-5b3e-4c0b-a7d2-c3837d03ede9_800x350.png 848w, https://substackcdn.com/image/fetch/$s_!W2AQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77aa2d6f-5b3e-4c0b-a7d2-c3837d03ede9_800x350.png 1272w, https://substackcdn.com/image/fetch/$s_!W2AQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77aa2d6f-5b3e-4c0b-a7d2-c3837d03ede9_800x350.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Key Benefits of Forward Proxies:</p><ol><li><p>Anonymity: Masks your IP address</p></li><li><p>Access Control: Can block harmful websites</p></li><li><p>Caching: Stores frequently accessed content for faster retrieval</p></li><li><p>Logging: Keeps track of user activity (bosses love this one!)</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1XWe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35d4a4f8-fc4f-4734-9e25-1ccd3920ac25_1588x748.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1XWe!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35d4a4f8-fc4f-4734-9e25-1ccd3920ac25_1588x748.png 424w, https://substackcdn.com/image/fetch/$s_!1XWe!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35d4a4f8-fc4f-4734-9e25-1ccd3920ac25_1588x748.png 848w, https://substackcdn.com/image/fetch/$s_!1XWe!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35d4a4f8-fc4f-4734-9e25-1ccd3920ac25_1588x748.png 1272w, https://substackcdn.com/image/fetch/$s_!1XWe!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35d4a4f8-fc4f-4734-9e25-1ccd3920ac25_1588x748.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1XWe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35d4a4f8-fc4f-4734-9e25-1ccd3920ac25_1588x748.png" width="1456" height="686" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/35d4a4f8-fc4f-4734-9e25-1ccd3920ac25_1588x748.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c2802d9a-9eb2-40b2-9cb2-c937a08ac9f0_1588x748.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:686,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:123560,&quot;alt&quot;:&quot;Forward proxy benefits&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Forward proxy benefits" title="Forward proxy benefits" srcset="https://substackcdn.com/image/fetch/$s_!1XWe!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35d4a4f8-fc4f-4734-9e25-1ccd3920ac25_1588x748.png 424w, https://substackcdn.com/image/fetch/$s_!1XWe!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35d4a4f8-fc4f-4734-9e25-1ccd3920ac25_1588x748.png 848w, https://substackcdn.com/image/fetch/$s_!1XWe!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35d4a4f8-fc4f-4734-9e25-1ccd3920ac25_1588x748.png 1272w, https://substackcdn.com/image/fetch/$s_!1XWe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35d4a4f8-fc4f-4734-9e25-1ccd3920ac25_1588x748.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>&#128736;&#65039; Hands-On Challenge: Try using a simple web proxy like hide.me to access a website. Notice any differences in speed or the information displayed about your location?</p><div><hr></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.dailydev.in/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><h2>Reverse Proxy: The Bouncer of the Web</h2><p>Now, let's flip the script and talk about reverse proxies. If a forward proxy protects clients, a reverse proxy protects servers.</p><p>Imagine a popular nightclub. At the entrance, there's a bouncer who manages the crowd, checks IDs, and ensures the club doesn't get overcrowded. A reverse proxy does the same for web servers!</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!q1XK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df934c2-f60b-4898-9152-2890e53cbe82_800x350.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!q1XK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df934c2-f60b-4898-9152-2890e53cbe82_800x350.gif 424w, https://substackcdn.com/image/fetch/$s_!q1XK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df934c2-f60b-4898-9152-2890e53cbe82_800x350.gif 848w, https://substackcdn.com/image/fetch/$s_!q1XK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df934c2-f60b-4898-9152-2890e53cbe82_800x350.gif 1272w, https://substackcdn.com/image/fetch/$s_!q1XK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df934c2-f60b-4898-9152-2890e53cbe82_800x350.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!q1XK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df934c2-f60b-4898-9152-2890e53cbe82_800x350.gif" width="800" height="350" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9df934c2-f60b-4898-9152-2890e53cbe82_800x350.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:350,&quot;width&quot;:800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:457720,&quot;alt&quot;:&quot;reverse proxy server&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/gif&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="reverse proxy server" title="reverse proxy server" srcset="https://substackcdn.com/image/fetch/$s_!q1XK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df934c2-f60b-4898-9152-2890e53cbe82_800x350.gif 424w, https://substackcdn.com/image/fetch/$s_!q1XK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df934c2-f60b-4898-9152-2890e53cbe82_800x350.gif 848w, https://substackcdn.com/image/fetch/$s_!q1XK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df934c2-f60b-4898-9152-2890e53cbe82_800x350.gif 1272w, https://substackcdn.com/image/fetch/$s_!q1XK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df934c2-f60b-4898-9152-2890e53cbe82_800x350.gif 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>Key Functions of Reverse Proxies:</p><ol><li><p>Load Balancing: Distributes incoming traffic across multiple servers</p></li><li><p>Security: Acts as a shield against attacks like DDoS</p></li><li><p>SSL Encryption: Handles HTTPS encryption, reducing the load on application servers</p></li><li><p>Caching: Stores and serves static content, reducing server load</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!94U9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1381843a-8919-4069-9404-49c9cce9d77e_1804x748.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!94U9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1381843a-8919-4069-9404-49c9cce9d77e_1804x748.png 424w, https://substackcdn.com/image/fetch/$s_!94U9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1381843a-8919-4069-9404-49c9cce9d77e_1804x748.png 848w, https://substackcdn.com/image/fetch/$s_!94U9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1381843a-8919-4069-9404-49c9cce9d77e_1804x748.png 1272w, https://substackcdn.com/image/fetch/$s_!94U9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1381843a-8919-4069-9404-49c9cce9d77e_1804x748.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!94U9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1381843a-8919-4069-9404-49c9cce9d77e_1804x748.png" width="1456" height="604" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1381843a-8919-4069-9404-49c9cce9d77e_1804x748.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/150900dd-e73e-4fd1-b758-8b635dd9da65_1804x748.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:604,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:129649,&quot;alt&quot;:&quot;reverse proxy benefits&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="reverse proxy benefits" title="reverse proxy benefits" srcset="https://substackcdn.com/image/fetch/$s_!94U9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1381843a-8919-4069-9404-49c9cce9d77e_1804x748.png 424w, https://substackcdn.com/image/fetch/$s_!94U9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1381843a-8919-4069-9404-49c9cce9d77e_1804x748.png 848w, https://substackcdn.com/image/fetch/$s_!94U9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1381843a-8919-4069-9404-49c9cce9d77e_1804x748.png 1272w, https://substackcdn.com/image/fetch/$s_!94U9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1381843a-8919-4069-9404-49c9cce9d77e_1804x748.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>&#127947;&#65039; Real-World Application: Have you ever used Cloudflare for your website or project? Congratulations, you've implemented a reverse proxy!</p><h2>The Great Proxy Showdown: Forward vs. Reverse</h2><p>Let's break down the key differences:</p><p>Forward Proxy:</p><ul><li><p>Protects clients</p></li><li><p>Sits in front of clients</p></li><li><p>Helps clients access the internet anonymously</p></li></ul><p>Reverse Proxy:</p><ul><li><p>Protects servers</p></li><li><p>Sits in front of servers</p></li><li><p>Helps servers handle incoming traffic efficiently &#129504; Quick Thinking Exercise: Can you think of a scenario where you might need both a forward and a reverse proxy in the same network setup?</p></li></ul><h4>Popular Proxy Players</h4><h5>Forward Proxy Examples:</h5><ul><li><p><a href="http://www.squid-cache.org/">Squid</a></p></li><li><p><a href="https://httpd.apache.org/">Apache</a> (when configured as a forward proxy)</p></li><li><p><a href="https://www.f5.com/go/product/welcome-to-nginx">Nginx</a> (yes, it can do both!)</p></li></ul><h5>Reverse Proxy Examples:</h5><ul><li><p><a href="https://www.f5.com/go/product/welcome-to-nginx">Nginx</a> (most common use)</p></li><li><p><a href="https://www.haproxy.com/">HAProxy</a></p></li><li><p><a href="https://traefik.io/traefik/">Traefik</a> &#128104;&#8205;&#128187; Coding Challenge: If you're feeling adventurous, try setting up a simple reverse proxy using Nginx on your local machine. It's easier than you might think!</p></li></ul><h5>Setting Up Your Own Proxy</h5><p>Ready to get your hands dirty? Here's a mini-guide to setting up a basic reverse proxy using NGINX:</p><ol><li><p>Install NGINX on your system.</p></li><li><p>Edit the NGINX configuration file (usually found at /etc/nginx/nginx.conf).</p></li><li><p>Add a server block like this:</p></li></ol><pre><code><code>server {
    listen 80;
    server_name yourdomain.com;

    location / {
        proxy_pass http://your_backend_server;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}</code></code></pre><ol start="4"><li><p>Restart NGINX to apply changes.</p></li></ol><h3>Why Should You Care About Proxies?</h3><p>As a professional or student in tech, understanding proxies can:</p><ol><li><p>Enhance your network security knowledge</p></li><li><p>Improve your web application architecture skills</p></li><li><p>Help you optimize web performance</p></li><li><p>Give you an edge in system design interviews</p></li></ol><p>&#128640; Career Boost: Many DevOps and SRE roles require a solid understanding of proxy servers. Adding this skill to your toolkit can open up new opportunities!</p><h4>Proxies in Action: Real-World Scenarios</h4><ol><li><p>Content Delivery Networks (CDNs): Ever wonder how Netflix streams videos so smoothly? CDNs use reverse proxies to cache and serve content from servers closer to you.</p></li><li><p>Corporate Networks: Many companies use forward proxies to monitor and control employee internet usage.</p></li><li><p>Microservices Architecture: Reverse proxies are crucial in managing traffic between different microservices in modern application design.</p></li><li><p>Geoblocking Bypass: Forward proxies can help access content that's restricted in certain regions (but always respect copyright laws!).</p></li></ol><p>&#127760; Global Perspective: How might the use of proxies differ in countries with strict internet censorship compared to those with open internet policies?</p><h4>The Future of Proxies</h4><p>As the internet evolves, so do proxies. Keep an eye on:</p><ul><li><p>AI-powered proxies for smarter traffic management</p></li><li><p>Increased use in IoT (Internet of Things) networks</p></li><li><p>Integration with blockchain for enhanced security </p></li></ul><p></p><h2>Wrapping Up</h2><p>Proxies are the unsung heroes of the internet, working behind the scenes to keep our online experiences smooth, secure, and speedy. Whether you're building the next big web app or just curious about how the internet works, understanding proxies is a valuable skill.</p><p>&#127919; Action Item: Next time you're browsing the web or developing an application, take a moment to consider the proxies that might be at work. How might you leverage them to improve performance or security?</p><p>Remember, in the world of web technology, knowledge is power. Keep learning, keep experimenting, and who knows? You might just become the proxy expert your team never knew they needed!</p><p>What aspect of proxies intrigues you the most? Drop a comment below and let's keep the conversation going! &#128172;</p><div><hr></div><h3>Recommended Reads for Your Career Journey</h3><p>Explore these highly recommended books to deepen your knowledge in <strong>System Design, Software Engineering, and Coding</strong>:</p><ol><li><p><strong>Designing Data-Intensive Applications</strong> by Martin Kleppmann<br>A must-read for understanding distributed systems and modern data engineering.<br><a href="https://amzn.to/4iU2Z9I">View here</a></p></li><li><p><strong>System Design Interview &#8211; An Insider's Guide</strong> by Alex Xu<br>Perfect for preparing for system design interviews with practical case studies.<br><a href="https://amzn.to/4iPM6gC">View here</a></p></li><li><p><strong>Clean Code: A Handbook of Agile Software Craftsmanship</strong> by Robert C. Martin<br>Learn how to write code that is readable, maintainable, and efficient.<br><a href="https://amzn.to/3ZPjrzr">View here</a></p></li><li><p><strong>The Pragmatic Programmer: Your Journey to Mastery</strong> by Andy Hunt and Dave Thomas<br>A timeless guide for becoming a well-rounded software developer.<br><a href="https://amzn.to/3ZV318C">view here</a></p></li><li><p><strong>Operating Systems: Three Easy Pieces</strong> by Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau<br>Dive deep into the fundamentals of operating systems.<br><a href="https://amzn.to/4fuFbq5">view here</a></p></li></ol><div><hr></div><p></p>]]></content:encoded></item><item><title><![CDATA[SD 2: Cracking the Code: What the Heck are JWT Tokens?]]></title><description><![CDATA[Demystifying JWT Tokens: The Key to Modern Web Security Ever wondered how websites keep you logged in securely? Dive into the world of JWT tokens - the digital passports of the web. Learn how these clever bits of code are revolutionizing user authentication and keeping your data safe. Perfect for curious minds and budding developers alike! #WebSecurity #JWT #CodingMadeSimple]]></description><link>https://blog.dailydev.in/p/what-are-jwt-tokens</link><guid isPermaLink="false">https://blog.dailydev.in/p/what-are-jwt-tokens</guid><dc:creator><![CDATA[Yashraj Balidani]]></dc:creator><pubDate>Wed, 25 Dec 2024 16:50:52 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85b17c1c-9d67-456b-920d-0ff41f9cc3d7_943x501.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey there, future tech wizards! &#128075; Ever wondered how websites remember who you are without asking for your password every single time? Or maybe you've heard the term "JWT tokens" thrown around in your coding classes and thought, "What in the world are those?" Well, buckle up, because we're about to dive into the fascinating world of JSON Web Tokens (JWTs)!</p><h2>The Authentication Dilemma</h2><p>Imagine this: You're building the next big social media app (move over, Zuckerberg!). How do you make sure that when Alice logs in, she sees her cat photos and not Bob's dog videos? &#128049;&#128054;</p><p>This is where authentication comes into play. </p><blockquote><p>&#129300; <strong>Quick Question:</strong> What's the first solution that comes to your mind? Take a moment to think about it!</p></blockquote><p>If you thought about using cookies, you're on the right track! Cookies have been the go-to solution for a while. But as the web evolves, we need something more flexible and powerful. Enter JWT tokens &#8211; the cool new kid on the authentication block!</p><h1>The Traditional Cookie Approach: A Quick Recap</h1><p>Before we dive into JWT tokens, let's take a quick trip down memory lane and revisit how cookies work. Imagine you're at a fancy tech conference, and here's how they might handle your registration:</p><p>&#127903;&#65039; <strong>Cookie Authentication: The Conference Analogy</strong></p><ol><li><p><strong>Registration (Login)</strong>: You arrive and give your name at the reception.</p></li><li><p><strong>Cookie Creation</strong>: They give you a special wristband with a unique code.</p></li><li><p><strong>Server-side Storage</strong>: The reception keeps a record of your name and wristband code.</p></li><li><p><strong>Subsequent Visits</strong>: Every time you enter a room, you show your wristband.</p></li><li><p><strong>Verification</strong>: Staff checks with reception if your wristband is valid.</p></li><li><p><strong>Access Granted</strong>: If valid, you're allowed to enter.</p></li></ol><p>Now, let's break this down in tech terms:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qFLe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F628e4ee0-e0c5-4bdc-95b5-061f5e588510_1396x683.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qFLe!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F628e4ee0-e0c5-4bdc-95b5-061f5e588510_1396x683.png 424w, https://substackcdn.com/image/fetch/$s_!qFLe!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F628e4ee0-e0c5-4bdc-95b5-061f5e588510_1396x683.png 848w, https://substackcdn.com/image/fetch/$s_!qFLe!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F628e4ee0-e0c5-4bdc-95b5-061f5e588510_1396x683.png 1272w, https://substackcdn.com/image/fetch/$s_!qFLe!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F628e4ee0-e0c5-4bdc-95b5-061f5e588510_1396x683.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qFLe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F628e4ee0-e0c5-4bdc-95b5-061f5e588510_1396x683.png" width="1396" height="683" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/628e4ee0-e0c5-4bdc-95b5-061f5e588510_1396x683.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/de50e669-b68c-417b-84e9-31e06c6595c8_1396x683.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:683,&quot;width&quot;:1396,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:78505,&quot;alt&quot;:&quot;Cookie based authentication&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Cookie based authentication" title="Cookie based authentication" srcset="https://substackcdn.com/image/fetch/$s_!qFLe!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F628e4ee0-e0c5-4bdc-95b5-061f5e588510_1396x683.png 424w, https://substackcdn.com/image/fetch/$s_!qFLe!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F628e4ee0-e0c5-4bdc-95b5-061f5e588510_1396x683.png 848w, https://substackcdn.com/image/fetch/$s_!qFLe!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F628e4ee0-e0c5-4bdc-95b5-061f5e588510_1396x683.png 1272w, https://substackcdn.com/image/fetch/$s_!qFLe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F628e4ee0-e0c5-4bdc-95b5-061f5e588510_1396x683.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><strong>Cookie Workflow</strong></figcaption></figure></div><pre><code><code>&#128421;&#65039; Server-side Session Storage
&#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
&#9474; Session ID | User   &#9474;
&#9500;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9508;
&#9474; ABC123     | Alice  &#9474;
&#9474; XYZ789     | Bob    &#9474;
&#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;</code></code></pre><blockquote><p>&#129504; <strong>Quick Quiz</strong>: Can you guess why this might be problematic for websites with millions of users?</p></blockquote><p>The server needs to store session information for every single user. As the number of users grows, this requires more and more server memory and can slow down the authentication process.</p><p><strong>Issues with Cookie-based Authentication:</strong></p><ol><li><p><strong>Server Memory Overload</strong>: Imagine trying to keep track of wristbands for millions of conference attendees!</p></li><li><p><strong>Scalability Challenges</strong>: What if the conference spreads across multiple buildings (servers)?</p></li><li><p><strong>Single Point of Failure</strong>: If the reception desk (session storage) crashes, everyone's wristbands become useless.</p></li></ol><blockquote><p>&#128161; <strong>Fun Fact</strong>: Some large websites handle billions of logins per day. That's a lot of cookies to keep track of!</p></blockquote><p>Now that we've refreshed our memory on cookies, are you ready to see how JWT tokens solve these problems? Let's dive in!</p><h2>JWT Tokens: Your Digital VIP Wristband</h2><p>Imagine you're at the hottest tech conference in town. At the entrance, instead of checking your ID every time you move between rooms, they give you a special wristband. This wristband has all the info they need about you &#8211; your name, which talks you can attend, even your favorite programming language!</p><p>That's essentially what a JWT token does in the digital world. It's like a secure, coded wristband for your web applications.</p><h3>But What Exactly is a JWT Token?</h3><p>JWT stands for JSON Web Token. Let's break it down:</p><ul><li><p><strong>JSON</strong>: You know this one! It's that neat format we use to structure data.</p></li><li><p><strong>Web</strong>: Because, duh, we're using it on the web!</p></li><li><p><strong>Token</strong>: A piece of data that represents something else (in this case, a user's identity and permissions).</p></li></ul><p>Put them all together, and you get a secure way to transmit information between parties as a JSON object. Cool, right?</p><p>&#128640; <strong>Interactive Moment:</strong> Go to <a href="https://jwt.io/">jwt.io</a> and look at the structure of a JWT token. Can you identify the three main parts? (Hint: They're separated by dots!)</p><h2>The Anatomy of a JWT Token</h2><p>Every JWT token has three parts:</p><p><strong>Header</strong>: </p><ul><li><p>The header contains the data about the token itself. It is mainly used to give information about the signing/decryption technique used on it.</p></li><li><p>It can also hold key information about the media or content type of the transmitted data. All this information is present as a JSON object, then this JSON object is encoded to <strong><a href="https://www.base64encode.org/?utm_source=hw.glich.co&amp;utm_medium=referral&amp;utm_campaign=ep-2-what-the-hell-is-jwt-tokens">BASE64URL</a></strong>.</p></li></ul><p><strong>Payload</strong>:</p><ul><li><p>It can contain any data related to your system. Basically, it can have the data you want to feed in, i.e. it may include the user's ID with a list of features they can interact with.</p></li><li><p>The information is presented as key/value pairs, and the keys are called "claims" in JWT. Even this is encoded to BASE64URL.</p></li></ul><p><strong>Signature</strong>: </p><ul><li><p>A signature is used to verify the authenticity of the token. It ensures that the token hasn&#8217;t been altered along its way.</p></li><li><p>The signature of a JSON Web Token is created using the BASE64URL encoded header and payload which are joined together with dot(.) which is further hashed using the hashing algorithm mentioned in the header with a secret key.</p></li></ul><p>These parts are each encoded and concatenated with dots, looking something like this:</p><pre><code><code>[header].[payload].[signature]

xxxxx.yyyyy.zzzzz</code></code></pre><p>Where <code>xxxxx</code> is the encoded header, <code>yyyyy</code> is the encoded payload, and <code>zzzzz</code> is the signature.</p><p>In reality, it looks like this (I know &#129326;)</p><pre><code><code>eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c</code></code></pre><p>Don't worry; you don't need to memorize this! &#128517;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!s-M1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85b17c1c-9d67-456b-920d-0ff41f9cc3d7_943x501.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!s-M1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85b17c1c-9d67-456b-920d-0ff41f9cc3d7_943x501.png 424w, https://substackcdn.com/image/fetch/$s_!s-M1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85b17c1c-9d67-456b-920d-0ff41f9cc3d7_943x501.png 848w, https://substackcdn.com/image/fetch/$s_!s-M1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85b17c1c-9d67-456b-920d-0ff41f9cc3d7_943x501.png 1272w, https://substackcdn.com/image/fetch/$s_!s-M1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85b17c1c-9d67-456b-920d-0ff41f9cc3d7_943x501.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!s-M1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85b17c1c-9d67-456b-920d-0ff41f9cc3d7_943x501.png" width="943" height="501" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/85b17c1c-9d67-456b-920d-0ff41f9cc3d7_943x501.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fc050c46-ba53-40e3-9bcc-b85c44ac79a7_943x501.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:501,&quot;width&quot;:943,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:237368,&quot;alt&quot;:&quot;JWT creation algorithm&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="JWT creation algorithm" title="JWT creation algorithm" srcset="https://substackcdn.com/image/fetch/$s_!s-M1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85b17c1c-9d67-456b-920d-0ff41f9cc3d7_943x501.png 424w, https://substackcdn.com/image/fetch/$s_!s-M1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85b17c1c-9d67-456b-920d-0ff41f9cc3d7_943x501.png 848w, https://substackcdn.com/image/fetch/$s_!s-M1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85b17c1c-9d67-456b-920d-0ff41f9cc3d7_943x501.png 1272w, https://substackcdn.com/image/fetch/$s_!s-M1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85b17c1c-9d67-456b-920d-0ff41f9cc3d7_943x501.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><strong>JWT Algorithm</strong></figcaption></figure></div><h2>Real-World Use Cases of JWT Tokens</h2><p>Now that we understand what JWT tokens are, let's explore where they shine in the real world. Imagine you're building the next big tech startup &#8211; here's how you might use JWTs:</p><h3>&#128272; 1. Single Sign-On (SSO)</h3><p><strong>Scenario</strong>: Your startup has multiple services (email, project management, chat).</p><p><strong>How JWTs Help</strong>: Users log in once and get a JWT that works across all services.</p><blockquote><p>&#129300; <strong>Think About It</strong>: How many times do you log into Google to use Gmail, YouTube, and Google Drive?</p></blockquote><h3>&#127760; 2. Authentication in Microservices</h3><p><strong>Scenario</strong>: Your app is built with microservices architecture.</p><p><strong>How JWTs Help</strong>: Each microservice can verify the JWT without calling a central auth service.</p><pre><code><code>   &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;    JWT     &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
   &#9474; User    &#9474; &#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9654; &#9474; Service &#9474;
   &#9474; Service &#9474;            &#9474;    A    &#9474;
   &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;     &#9474;      &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
        &#9474;          &#9474;
        &#9474;          &#9474;      &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
        &#9474;          &#9492;&#9472;&#9472;&#9472;&#9472;&#9654; &#9474; Service &#9474;
        &#9474;                 &#9474;    B    &#9474;
        &#9660;                 &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
  No central auth
  service needed!</code></code></pre><h3>&#128241; 3. Mobile App Authentication</h3><p><strong>Scenario</strong>: You're developing both web and mobile versions of your app.</p><p><strong>How JWTs Help</strong>: Mobile apps can easily store and send JWTs with each request.</p><h3>&#128257; 4. API Authentication</h3><p><strong>Scenario</strong>: You're offering a public API for developers.</p><p><strong>How JWTs Help</strong>: Developers can use JWTs to authenticate their requests to your API.</p><blockquote><p>&#128104;&#8205;&#128187; <strong>Coding Challenge</strong>: Can you think of a popular API that uses JWT for authentication? (Hint: Think social media platforms)</p></blockquote><p>Twitter's API uses OAuth 2.0, which often involves JWTs for token-based authentication.</p><h3>&#128260; 5. Stateless Session Management</h3><p><strong>Scenario</strong>: You want to scale your app without worrying about session storage.</p><p><strong>How JWTs Help</strong>: All session info is in the token &#8211; no need to store sessions on the server!</p><div><hr></div><p>&#128640; <strong>Pro Tip</strong>: While JWTs are powerful, they're not a one-size-fits-all solution. Always consider your specific security needs and potential trade-offs!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.dailydev.in/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><p>Now that we've seen where JWTs are commonly used, can you think of an app or service you use daily that might be using JWTs behind the scenes? Share your thoughts!</p><h3>How JWT Works: A Step-by-Step Adventure</h3><ol><li><p>You log in with your username and password</p></li><li><p>The server verifies your credentials</p></li><li><p>If correct, the server creates a JWT token with your info</p></li><li><p>The server sends this token back to your browser</p></li><li><p>Your browser stores the token (usually in local storage)</p></li><li><p>For future requests, your browser sends this token along</p></li><li><p>The server verifies the token's signature and grants access if valid</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cPxR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe47df89d-8d9c-423b-b038-ed99f5545ad1_1540x1084.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cPxR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe47df89d-8d9c-423b-b038-ed99f5545ad1_1540x1084.png 424w, https://substackcdn.com/image/fetch/$s_!cPxR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe47df89d-8d9c-423b-b038-ed99f5545ad1_1540x1084.png 848w, https://substackcdn.com/image/fetch/$s_!cPxR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe47df89d-8d9c-423b-b038-ed99f5545ad1_1540x1084.png 1272w, https://substackcdn.com/image/fetch/$s_!cPxR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe47df89d-8d9c-423b-b038-ed99f5545ad1_1540x1084.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cPxR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe47df89d-8d9c-423b-b038-ed99f5545ad1_1540x1084.png" width="1456" height="1025" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e47df89d-8d9c-423b-b038-ed99f5545ad1_1540x1084.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7c1113d1-2597-4932-9a91-6ca50e6e4653_1540x1084.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1025,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:139667,&quot;alt&quot;:&quot;JWT Authentication workflow&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="JWT Authentication workflow" title="JWT Authentication workflow" srcset="https://substackcdn.com/image/fetch/$s_!cPxR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe47df89d-8d9c-423b-b038-ed99f5545ad1_1540x1084.png 424w, https://substackcdn.com/image/fetch/$s_!cPxR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe47df89d-8d9c-423b-b038-ed99f5545ad1_1540x1084.png 848w, https://substackcdn.com/image/fetch/$s_!cPxR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe47df89d-8d9c-423b-b038-ed99f5545ad1_1540x1084.png 1272w, https://substackcdn.com/image/fetch/$s_!cPxR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe47df89d-8d9c-423b-b038-ed99f5545ad1_1540x1084.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><strong>JWT Authentication workflow</strong></figcaption></figure></div><p>&#129327; <strong>Mind-Blowing Fact:</strong> The server doesn't need to store session information for each user. The token itself contains all the necessary info!</p><h2>Why Are JWTs So Cool?</h2><ol><li><p><strong>Stateless</strong>: Servers don't need to keep track of sessions.</p></li><li><p><strong>Scalability</strong>: Great for distributed systems and microservices.</p></li><li><p><strong>Security</strong>: Can be encrypted and signed.</p></li><li><p><strong>Flexibility</strong>: Can include any type of claims or custom data.</p></li><li><p><strong>Decentralized</strong>: Can be verified by multiple servers</p></li></ol><p>But remember, with great power comes great responsibility! JWT tokens aren't a silver bullet for all security concerns.</p><p>&#9888;&#65039; <strong>Security Tip</strong>: Never store sensitive info (like passwords) in the JWT payload. It's encoded, not encrypted!</p><h2>Hands-On Time!</h2><p>Let's create a simple JWT token:</p><ul><li><p>Go to <a href="https://jwt.io/">jwt.io</a>.</p></li><li><p>Go to the "Debugger" section</p></li><li><p>In the "Payload" section, try adding your own claims. For example:</p></li></ul><pre><code>{
  "name": "Your Name",
  "role": "Awesome Developer",
  "exp": 1735689600
}</code></pre><ul><li><p>Watch how the token changes in real-time!</p></li></ul><p><strong>Challenge:</strong> Try changing the algorithm in the header from HS256 to RS256. What happens? Why do you think this change is significant?</p><h2>Common Pitfalls and Best Practices</h2><p>While JWTs are powerful, they're not a silver bullet. Here are some things to keep in mind:</p><ul><li><p><strong>Don't store sensitive info</strong> in the payload (it's base64 encoded, not encrypted!).</p></li><li><p><strong>Use HTTPS</strong> to prevent token interception.</p></li><li><p><strong>Set appropriate expiration times</strong> for your tokens.</p></li><li><p><strong>Implement token refresh mechanisms</strong> for long-lived sessions.</p></li></ul><h2>The JWT Journey: From Login to Logout</h2><ol><li><p><strong>Login</strong>: User provides credentials, server creates JWT</p></li><li><p><strong>Storage</strong>: Token is stored in the browser (usually localStorage)</p></li><li><p><strong>Usage</strong>: Token is sent with each request in the Authorization header</p></li><li><p><strong>Verification</strong>: Server checks the token's signature and expiration</p></li><li><p><strong>Refresh</strong>: For long sessions, implement a refresh token mechanism</p></li><li><p><strong>Logout</strong>: Simply delete the token from storage</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-0S1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3223d4fd-0dec-45f6-87df-ac9bf84f2fae_1276x1492.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-0S1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3223d4fd-0dec-45f6-87df-ac9bf84f2fae_1276x1492.png 424w, https://substackcdn.com/image/fetch/$s_!-0S1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3223d4fd-0dec-45f6-87df-ac9bf84f2fae_1276x1492.png 848w, https://substackcdn.com/image/fetch/$s_!-0S1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3223d4fd-0dec-45f6-87df-ac9bf84f2fae_1276x1492.png 1272w, https://substackcdn.com/image/fetch/$s_!-0S1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3223d4fd-0dec-45f6-87df-ac9bf84f2fae_1276x1492.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-0S1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3223d4fd-0dec-45f6-87df-ac9bf84f2fae_1276x1492.png" width="1276" height="1492" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3223d4fd-0dec-45f6-87df-ac9bf84f2fae_1276x1492.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b49415f7-6787-4069-be42-6fee2708cfb6_1276x1492.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1492,&quot;width&quot;:1276,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:236352,&quot;alt&quot;:&quot;JWT Journey from login to logout&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="JWT Journey from login to logout" title="JWT Journey from login to logout" srcset="https://substackcdn.com/image/fetch/$s_!-0S1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3223d4fd-0dec-45f6-87df-ac9bf84f2fae_1276x1492.png 424w, https://substackcdn.com/image/fetch/$s_!-0S1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3223d4fd-0dec-45f6-87df-ac9bf84f2fae_1276x1492.png 848w, https://substackcdn.com/image/fetch/$s_!-0S1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3223d4fd-0dec-45f6-87df-ac9bf84f2fae_1276x1492.png 1272w, https://substackcdn.com/image/fetch/$s_!-0S1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3223d4fd-0dec-45f6-87df-ac9bf84f2fae_1276x1492.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">JWT Journey</figcaption></figure></div><p>&#129327; <strong>Mind-Bender</strong>: How would you handle token expiration on the client-side? Think about user experience!</p><h2>The Big Picture: JWTs in System Design</h2><p>Understanding JWTs is crucial for modern system design, especially when building scalable, distributed systems. They solve many authentication and authorization challenges in microservices architectures.</p><p>&#129300; <strong>Food for Thought:</strong> How might JWTs change the way you approach session management in your next project?</p><h2>Wrapping Up</h2><p>Congratulations! You've just unlocked the mystery of JWT tokens. From understanding their structure to grasping their role in modern web applications, you're now equipped with knowledge that's crucial for any aspiring system designer or web developer.</p><h3>Quick Recap:</h3><ul><li><p>JWTs are like digital wristbands for web apps.</p></li><li><p>They consist of a header, payload, and signature.</p></li><li><p>JWTs enable stateless authentication, improving scalability.</p></li><li><p>Always use them securely and never store sensitive data in them. <strong>Final Challenge:</strong> Think about an app you use daily. How might it be using JWTs behind the scenes? Can you spot any potential security improvements?</p></li></ul><p>&#128640; <strong>Next Steps</strong>:</p><ul><li><p>Implement JWT authentication in a small project</p></li><li><p>Explore libraries like <a href="https://www.npmjs.com/package/jsonwebtoken">jsonwebtoken</a> for Node.js</p></li><li><p>Research best practices for JWT token storage and security</p></li></ul><p>Remember, the world of web development is constantly evolving, and understanding concepts like JWTs puts you ahead of the curve. Keep exploring, keep coding, and who knows? Maybe you'll be the one designing the next big authentication system!</p><p>Got questions? Excited to use JWTs in your next project? Drop a comment below and let's keep the conversation going! &#128640;&#128187;</p><div><hr></div><h3>Recommended Reads for Your Journey</h3><p>Explore these highly recommended books to deepen your knowledge in <strong>System Design, Software Engineering, and Coding</strong>:</p><ol><li><p><strong>Designing Data-Intensive Applications</strong> by Martin Kleppmann<br>A must-read for understanding distributed systems and modern data engineering.<br><a href="https://amzn.to/4iU2Z9I">Buy here</a></p></li><li><p><strong>System Design Interview &#8211; An Insider's Guide</strong> by Alex Xu<br>Perfect for preparing for system design interviews with practical case studies.<br><a href="https://amzn.to/4iPM6gC">Buy here</a></p></li><li><p><strong>Clean Code: A Handbook of Agile Software Craftsmanship</strong> by Robert C. Martin<br>Learn how to write code that is readable, maintainable, and efficient.<br><a href="https://amzn.to/3ZPjrzr">Buy here</a></p></li><li><p><strong>The Pragmatic Programmer: Your Journey to Mastery</strong> by Andy Hunt and Dave Thomas<br>A timeless guide for becoming a well-rounded software developer.<br><a href="https://amzn.to/3ZV318C">Buy here</a></p></li><li><p><strong>Operating Systems: Three Easy Pieces</strong> by Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau<br>Dive deep into the fundamentals of operating systems.<br><a href="https://amzn.to/4fuFbq5">Buy here</a></p></li></ol><div><hr></div><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/p/what-are-jwt-tokens?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption">Thanks for reading Dailydev.in Newsletter! This post is public so feel free to share it.</p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/p/what-are-jwt-tokens?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.dailydev.in/p/what-are-jwt-tokens?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Dailydev.in Newsletter! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[Demystifying TStore: The Backbone of Billions of Transactions at PhonePe]]></title><description><![CDATA[Discover the architecture behind TStore, the backbone of PhonePe's transaction processing system. Learn how HBase, Elasticsearch, Kafka, and Active-Active clusters enable high-speed ingestion, efficient reads, robust security, and seamless scalability for millions of transactions daily.]]></description><link>https://blog.dailydev.in/p/demystifying-tstore-the-backbone-of-phonepe</link><guid isPermaLink="false">https://blog.dailydev.in/p/demystifying-tstore-the-backbone-of-phonepe</guid><dc:creator><![CDATA[Yashraj Balidani]]></dc:creator><pubDate>Sat, 21 Dec 2024 14:31:12 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fd5c3d1-1a36-4672-9c17-fe8fe82d807b_947x812.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Disclaimer: The details in this post have been derived from the PhonePe Engineering Blog. All credit for the technical details goes to the PhonePe engineering team. The links to the original articles are present in the references section at the end of the post. We&#8217;ve attempted to analyze the details and provide our input about them. If you find any inaccuracies or omissions, please leave a comment, and we will do our best to fix them.</em></p><div><hr></div><h4>Ever Wondered How Your PhonePe Payment Happens in a Flash?</h4><p>Imagine you&#8217;re at a grocery store, waiting in line to pay for your items. You scan the QR code with your PhonePe app, tap to pay, and within seconds, you see the green confirmation screen. Your transaction is complete, and the details are instantly updated in your transaction history. But have you ever wondered how this seamless experience is supported behind the scenes? Welcome to the world of PhonePe&#8217;s <strong>Transaction Store</strong> (TStore), the backbone that powers billions of transactions every day.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4-_z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa7f4713-66e3-4330-8b1d-f28b1784c05c_320x697.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4-_z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa7f4713-66e3-4330-8b1d-f28b1784c05c_320x697.gif 424w, https://substackcdn.com/image/fetch/$s_!4-_z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa7f4713-66e3-4330-8b1d-f28b1784c05c_320x697.gif 848w, https://substackcdn.com/image/fetch/$s_!4-_z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa7f4713-66e3-4330-8b1d-f28b1784c05c_320x697.gif 1272w, https://substackcdn.com/image/fetch/$s_!4-_z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa7f4713-66e3-4330-8b1d-f28b1784c05c_320x697.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4-_z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa7f4713-66e3-4330-8b1d-f28b1784c05c_320x697.gif" width="320" height="697" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa7f4713-66e3-4330-8b1d-f28b1784c05c_320x697.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:697,&quot;width&quot;:320,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1340647,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/gif&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!4-_z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa7f4713-66e3-4330-8b1d-f28b1784c05c_320x697.gif 424w, https://substackcdn.com/image/fetch/$s_!4-_z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa7f4713-66e3-4330-8b1d-f28b1784c05c_320x697.gif 848w, https://substackcdn.com/image/fetch/$s_!4-_z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa7f4713-66e3-4330-8b1d-f28b1784c05c_320x697.gif 1272w, https://substackcdn.com/image/fetch/$s_!4-_z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa7f4713-66e3-4330-8b1d-f28b1784c05c_320x697.gif 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>The Scale of PhonePe&#8217;s Transactions</h4><p>PhonePe has been the leading third-party Unified Payments Interface (UPI) payment app in India. In August 2024, PhonePe alone recorded a staggering <em><strong>7.23 billion</strong></em> customer-initiated UPI transactions, amounting to <em><strong>Rs 10,33,264.34 crore</strong></em>. To put that into perspective, this converts to roughly <em><strong>124.49 billion USD</strong></em> for a single month. Extrapolating this for a year, PhonePe processes an incredible volume of transactions, highlighting the need for a robust and efficient system like TStore.</p><h2>Unveiling TStore</h2><h4>The Backbone of Billions of Transactions</h4><p>TStore is the unsung hero behind PhonePe&#8217;s seamless payment experience. It ensures high-velocity ingestion, efficient data retrieval, and real-time reads, powering billions of transactions every day. Let&#8217;s dive into how TStore makes this possible.</p><h4>Capturing the User Journey</h4><p>Consider a typical mobile recharge flow. You select a plan and top up your phone through PhonePe. Here&#8217;s a simplified view of how it works:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!erRT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03c0bf67-930a-4925-a450-b867b50d2df0_1889x1660.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!erRT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03c0bf67-930a-4925-a450-b867b50d2df0_1889x1660.png 424w, https://substackcdn.com/image/fetch/$s_!erRT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03c0bf67-930a-4925-a450-b867b50d2df0_1889x1660.png 848w, https://substackcdn.com/image/fetch/$s_!erRT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03c0bf67-930a-4925-a450-b867b50d2df0_1889x1660.png 1272w, https://substackcdn.com/image/fetch/$s_!erRT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03c0bf67-930a-4925-a450-b867b50d2df0_1889x1660.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!erRT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03c0bf67-930a-4925-a450-b867b50d2df0_1889x1660.png" width="1456" height="1279" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/03c0bf67-930a-4925-a450-b867b50d2df0_1889x1660.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1279,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:94617,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!erRT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03c0bf67-930a-4925-a450-b867b50d2df0_1889x1660.png 424w, https://substackcdn.com/image/fetch/$s_!erRT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03c0bf67-930a-4925-a450-b867b50d2df0_1889x1660.png 848w, https://substackcdn.com/image/fetch/$s_!erRT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03c0bf67-930a-4925-a450-b867b50d2df0_1889x1660.png 1272w, https://substackcdn.com/image/fetch/$s_!erRT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03c0bf67-930a-4925-a450-b867b50d2df0_1889x1660.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ol><li><p><strong>Initiate Recharge</strong>: You start the mobile recharge process through the PhonePe app.</p></li><li><p><strong>Retrieve Payment Options</strong>: The Checkout Service fetches available payment options from BillPay.</p></li><li><p><strong>Select Payment Method</strong>: You choose your preferred method (UPI, card, etc.) and submit payment details.</p></li><li><p><strong>Validate and Initiate Transaction</strong>: The Payments Service validates constraints, initiates the transaction with the provider, and triggers fulfillment via BillPay.</p></li><li><p><strong>Track Transaction Status</strong>: The app tracks the transaction status using TStore&#8217;s APIs, showing &#8220;PENDING&#8221; during processing and &#8220;COMPLETED&#8221; or &#8220;ERRORED&#8221; at the end.</p></li></ol><p>TStore captures, consolidates, and disseminates payment flow information to stakeholders, ensuring a consistent post-payment experience.</p><div><hr></div><h3>Capabilities: High-Velocity Ingestion, Reads and Beyond</h3><p><strong>High-Velocity Ingestion</strong>: During peak hours, PhonePe processes over 8,000 transactions per second. TStore ingests data with minimal latency (~45,000 RPS and &lt; 10 ms).</p><p><strong>Efficient Scrolling Through Transaction History</strong>: TStore uses pointer-based scrolling mechanisms for efficient transaction retrieval:</p><ul><li><p><strong>Backward Scrolling for Initial Load</strong>: During initial app installation or when a user first accesses their transaction history, the client app downloads transactions in descending order of update timestamps.</p></li><li><p><strong>Forward Polling for Updates</strong>: Apps already installed use forward polling to retrieve only the new updates that have occurred since the last poll, minimizing data transfer and improving response times.</p></li></ul><p><strong>Real-Time Reads</strong>: Both internal applications and external services rely on TStore for real-time access to transaction data, enabling features like instant transaction status and updates tracking (~100,000 RPS and &lt; 20ms).</p><p><strong>Flexible Querying Capability</strong>: TStore empowers diverse stakeholders with the ability to query and retrieve specific transaction details efficiently via real-time data aggregation, filtering, and sorting capabilities.</p><p><strong>Historical Archiving Beyond Real-Time</strong>: TStore integrates with the data lake, enabling long-term storage and sophisticated analytics. This empowers deeper understanding of user behavior, payment trends, compliance reporting, fraud detection, and business insights.</p><p><strong>Data Consistency and High Availability</strong>: TStore ensures data consistency across the system, spread across geographies, and implements redundancy, replication, and disaster recovery mechanisms to prevent service disruptions, ensuring business continuity seamlessly.</p><h4>Terminologies</h4><ul><li><p><strong>Entity</strong>: The most atomic element in TStore, representing actions taken by the user or supporting data elements generated by systems.</p></li><li><p><strong>Unit</strong>: All entities are united by a common ID called Unit Id, consolidating their information, states, and timestamps into a unified record.</p></li><li><p><strong>Views</strong>: Customizable filters applied to Unit details, ensuring clients only see relevant information, protecting privacy, and improving network efficiency.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ErY9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ea2bc70-5430-4c89-99c9-1b00de4e9a6e_2048x1538.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ErY9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ea2bc70-5430-4c89-99c9-1b00de4e9a6e_2048x1538.png 424w, https://substackcdn.com/image/fetch/$s_!ErY9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ea2bc70-5430-4c89-99c9-1b00de4e9a6e_2048x1538.png 848w, https://substackcdn.com/image/fetch/$s_!ErY9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ea2bc70-5430-4c89-99c9-1b00de4e9a6e_2048x1538.png 1272w, https://substackcdn.com/image/fetch/$s_!ErY9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ea2bc70-5430-4c89-99c9-1b00de4e9a6e_2048x1538.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ErY9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ea2bc70-5430-4c89-99c9-1b00de4e9a6e_2048x1538.png" width="1456" height="1093" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8ea2bc70-5430-4c89-99c9-1b00de4e9a6e_2048x1538.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1093,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:155896,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ErY9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ea2bc70-5430-4c89-99c9-1b00de4e9a6e_2048x1538.png 424w, https://substackcdn.com/image/fetch/$s_!ErY9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ea2bc70-5430-4c89-99c9-1b00de4e9a6e_2048x1538.png 848w, https://substackcdn.com/image/fetch/$s_!ErY9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ea2bc70-5430-4c89-99c9-1b00de4e9a6e_2048x1538.png 1272w, https://substackcdn.com/image/fetch/$s_!ErY9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ea2bc70-5430-4c89-99c9-1b00de4e9a6e_2048x1538.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h3>Architectural Deep Dive &#8211; A Closer Look at its Key Components</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oUTb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33ec1920-ce6b-48d2-bff0-37639eb9a0ef_2048x932.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oUTb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33ec1920-ce6b-48d2-bff0-37639eb9a0ef_2048x932.png 424w, https://substackcdn.com/image/fetch/$s_!oUTb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33ec1920-ce6b-48d2-bff0-37639eb9a0ef_2048x932.png 848w, https://substackcdn.com/image/fetch/$s_!oUTb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33ec1920-ce6b-48d2-bff0-37639eb9a0ef_2048x932.png 1272w, https://substackcdn.com/image/fetch/$s_!oUTb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33ec1920-ce6b-48d2-bff0-37639eb9a0ef_2048x932.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oUTb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33ec1920-ce6b-48d2-bff0-37639eb9a0ef_2048x932.png" width="1456" height="663" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/33ec1920-ce6b-48d2-bff0-37639eb9a0ef_2048x932.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:663,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:129433,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!oUTb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33ec1920-ce6b-48d2-bff0-37639eb9a0ef_2048x932.png 424w, https://substackcdn.com/image/fetch/$s_!oUTb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33ec1920-ce6b-48d2-bff0-37639eb9a0ef_2048x932.png 848w, https://substackcdn.com/image/fetch/$s_!oUTb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33ec1920-ce6b-48d2-bff0-37639eb9a0ef_2048x932.png 1272w, https://substackcdn.com/image/fetch/$s_!oUTb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33ec1920-ce6b-48d2-bff0-37639eb9a0ef_2048x932.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>TStore Client Bundle</strong>: This library serves as the bridge between applications and TStore, abstracting away complexities, interacting with the discovery service, and ensuring serialized writes and maximized performance.</p><p><strong>Schema Registry</strong>: Manages and governs the evolution of entity schemas within TStore, ensuring data integrity and facilitating seamless schema evolution.</p><p><strong>Entity Ingestor</strong>: Responsible for ingesting new entities and disseminating updates across systems, ensuring data persistence and notification details are only sent if underlying data changes have been successfully persisted.</p><p><strong>Feed Service</strong>: The primary gateway for read-only access to transaction data, enabling clients to poll for transaction status updates and providing paginated transaction history and dashboards for detailed analysis and reporting.</p><div><hr></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.dailydev.in/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><h2>TStore&#8217;s Technical Foundations</h2><h3>1. Datastores: The Heart of TStore</h3><h4><strong>HBase: The Transaction Backbone</strong></h4><p>HBase is TStore&#8217;s primary data store, chosen for its ability to handle high write throughput and ultra-fast reads. Here&#8217;s how it delivers:</p><ul><li><p><strong>Optimized Writes</strong>:</p><ul><li><p>Data is written to an in-memory <strong>MemStore</strong> and a disk-based <strong>Write-Ahead Log (WAL)</strong>.</p></li><li><p>These mechanisms minimize disk I/O, ensuring consistent performance even under heavy write loads.</p></li></ul></li><li><p><strong>Bloom Filters</strong>:</p><ul><li><p>Bloom filters efficiently check if a row exists, speeding up index lookups for new transactions.</p></li></ul></li><li><p><strong>In-Memory Read Optimization</strong>:</p><ul><li><p>Most reads target recently written data in MemStore, bypassing the disk.</p></li><li><p>For older data, <strong>block caching</strong> keeps frequently accessed SSTable blocks in memory, ensuring low-latency retrieval.</p></li></ul></li><li><p><strong>Cluster Architecture</strong>:</p><ul><li><p>HBase operates on hundreds of <strong>Region Servers</strong> layered on <strong>HDFS</strong> (Hadoop Distributed File System).</p></li><li><p>This architecture enables fault tolerance and horizontal scalability, critical for managing billions of transactions.</p></li></ul></li></ul><p>HBase isn&#8217;t just fast&#8212;it&#8217;s resilient, offering fine-grained control over reads and writes. However, TStore remains adaptable to future datastore options, with compatibility for alternatives like <strong>Azure CosmosDB</strong> for scenarios requiring fully managed, globally distributed databases.</p><h4><strong>Elasticsearch: Search and Analytics Engine</strong></h4><p>While HBase excels at storing raw transactional data, Elasticsearch handles <strong>real-time search and analytics</strong>:</p><ul><li><p><strong>Sharded Architecture</strong>:</p><ul><li><p>Data is distributed across hundreds of nodes, ensuring scalability for terabytes of transaction records.</p></li></ul></li><li><p><strong>Lucene Indexing</strong>:</p><ul><li><p>Elasticsearch uses Lucene to enable full-text search and multi-field aggregations.</p></li></ul></li><li><p><strong>Aggregation Framework</strong>:</p><ul><li><p>TStore leverages this framework to generate merchant insights (e.g., total sales) with near real-time speed.</p></li></ul></li></ul><h3>2. Message Queues: Kafka and RabbitMQ</h3><h4><strong>Kafka: The Courier of TStore</strong></h4><p>Kafka acts as the data pipeline, efficiently transporting entities across different components of the TStore ecosystem. It handles asynchronous tasks like data lake backups, payment notifications, and near real-time search indexing. This asynchronous approach frees up TStore&#8217;s core for real-time operations while Kafka reliably delivers data in the background.</p><h4><strong>RabbitMQ: The Safety Net</strong></h4><p>RabbitMQ serves as a backup if Kafka experiences latency or degradation. It reliably buffers pending messages until Kafka recovers, ensuring none get lost. In extreme cases, messages are directed to RabbitMQ&#8217;s dead letter exchanges (DLX) for separate processing, allowing for human intervention or alternative handling strategies.</p><h3>3. Disaster Recovery: Active-Active Architecture</h3><p>In the high-stakes world of financial transactions, downtime is not an option. TStore incorporates a robust Active-Active Business Continuity and Disaster Recovery (BCP/DR) strategy to ensure uninterrupted transaction processing.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4Yo1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fd5c3d1-1a36-4672-9c17-fe8fe82d807b_947x812.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4Yo1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fd5c3d1-1a36-4672-9c17-fe8fe82d807b_947x812.png 424w, https://substackcdn.com/image/fetch/$s_!4Yo1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fd5c3d1-1a36-4672-9c17-fe8fe82d807b_947x812.png 848w, https://substackcdn.com/image/fetch/$s_!4Yo1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fd5c3d1-1a36-4672-9c17-fe8fe82d807b_947x812.png 1272w, https://substackcdn.com/image/fetch/$s_!4Yo1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fd5c3d1-1a36-4672-9c17-fe8fe82d807b_947x812.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4Yo1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fd5c3d1-1a36-4672-9c17-fe8fe82d807b_947x812.png" width="947" height="812" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5fd5c3d1-1a36-4672-9c17-fe8fe82d807b_947x812.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:812,&quot;width&quot;:947,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:321097,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!4Yo1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fd5c3d1-1a36-4672-9c17-fe8fe82d807b_947x812.png 424w, https://substackcdn.com/image/fetch/$s_!4Yo1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fd5c3d1-1a36-4672-9c17-fe8fe82d807b_947x812.png 848w, https://substackcdn.com/image/fetch/$s_!4Yo1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fd5c3d1-1a36-4672-9c17-fe8fe82d807b_947x812.png 1272w, https://substackcdn.com/image/fetch/$s_!4Yo1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fd5c3d1-1a36-4672-9c17-fe8fe82d807b_947x812.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h4><strong>Active-Active Clusters: The Power of Two</strong></h4><p>TStore leverages geographically distinct Active-Active clusters, running two independent instances of the entire system in separate data centers. Both clusters handle read and write requests concurrently, eliminating single points of failure and guaranteeing service continuity. This design ensures:</p><ul><li><p>Transactions continue processing even if one data center encounters an outage.</p></li><li><p>Data remains geographically separated, reducing the risk of regional disasters impacting both locations simultaneously.</p></li><li><p>Scalability is readily achievable by adding app and database instances to individual clusters as transaction volumes increase.</p></li></ul><h4><strong>Seamless Data Synchronization: Replication and Mirroring</strong></h4><p>To maintain data consistency across both clusters, TStore employs various multi-leader data replication and mirroring mechanisms:</p><ul><li><p><strong>HBase Bi-directional Replication</strong>: Every write operation performed on one cluster triggers a replication stream to the other, ensuring identical data states in both locations.</p></li><li><p><strong>Kafka Mirroring with MirrorMaker 2 (MM2)</strong>: Continuously streams data topics from one Kafka cluster to the other, ensuring both clusters have identical, in-sync topics. This mirroring provides both read and write consistency across clusters.</p></li></ul><h4><strong>Intelligent Traffic Shaping and Consistency Handling</strong></h4><p>The TStore client plays a crucial role in directing traffic and maintaining data consistency within the Active-Active setup:</p><ul><li><p><strong>Traffic Shaping</strong>: Routes writes to the appropriate cluster, balancing load and optimizing performance.</p></li><li><p><strong>Out-of-Order Update Handling</strong>: Pins related updates together, ensuring they are always processed within the same cluster.</p></li><li><p><strong>Failover and Recovery</strong>: Leverages manual intervention through Admin APIs to readjust request split and steer requests towards available and healthy clusters, prioritizing performance and business continuity.</p></li></ul><h3><strong>4. Security and Privacy by Design</strong></h3><h4><strong>Views for Data Privacy</strong></h4><p>Views act as a protective layer, ensuring clients access only the fields they need while keeping sensitive information secure. For example:</p><ul><li><p>A merchant view exposes only transaction amounts and payment statuses.</p></li><li><p>Personally Identifiable Information (PII) is excluded from all views.</p></li></ul><p>Views improve network efficiency by minimizing data transfer, especially critical for TStore&#8217;s scale.</p><h4><strong>IAM for Access Control</strong></h4><p>TStore integrates with PhonePe&#8217;s <strong>in-house IAM platform</strong>, enforcing tenant-specific roles and permissions for every API call. This ensures that unauthorized access is impossible, even under edge cases.</p><h2>Engineering Lessons from TStore</h2><p>Whether you&#8217;re a student exploring system design or an engineer managing large-scale systems, TStore offers several key takeaways:</p><ol><li><p><strong>Polyglot Persistence</strong>: Use databases for what they do best&#8212;HBase for raw transaction storage, Elasticsearch for search and analytics.</p></li><li><p><strong>Asynchronous Workflows</strong>: Offload non-critical tasks to message queues to ensure real-time performance.</p></li><li><p><strong>Active-Active Resilience</strong>: Design for failure. Distributed systems must assume outages and plan accordingly.</p></li><li><p><strong>Data Privacy by Default</strong>: Always restrict data access to the minimum required for business needs.</p></li></ol><p></p><h2>Closing Thoughts</h2><p>TStore is more than a transactional system&#8212;it&#8217;s a testament to the art and science of engineering for scale, resilience, and efficiency. Its design empowers PhonePe to handle billions of transactions while ensuring security, reliability, and performance.</p><p>As TStore continues to evolve, it serves as a blueprint for the next generation of financial systems, inspiring engineers to push the boundaries of what&#8217;s possible.</p><p>The next time you complete a payment with PhonePe, remember the intricate machinery of TStore working tirelessly in the background, ensuring every transaction is swift, secure, and seamless.</p><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/p/demystifying-tstore-the-backbone-of-phonepe?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption">Thanks for reading Dailydev.in Newsletter! This post is public so feel free to share it.</p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/p/demystifying-tstore-the-backbone-of-phonepe?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.dailydev.in/p/demystifying-tstore-the-backbone-of-phonepe?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><p><strong>References:</strong></p><ul><li><p>https://tech.phonepe.com/demystifying-tstore-the-backbone-of-billions-of-transactions-at-phonepe-chapter-2/</p></li><li><p>https://tech.phonepe.com/demystifying-tstore-the-backbone-of-billions-of-transactions-at-phonepe/</p></li></ul><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Discover the Brilliance of Zanzibar: Google’s Authorization Solution]]></title><description><![CDATA[Discover Google&#8217;s Zanzibar: a global authorization system ensuring consistent, scalable access control across services. Learn its architecture, data model, and optimizations.]]></description><link>https://blog.dailydev.in/p/google-zanzibar-global-authorization-system</link><guid isPermaLink="false">https://blog.dailydev.in/p/google-zanzibar-global-authorization-system</guid><dc:creator><![CDATA[Yashraj Balidani]]></dc:creator><pubDate>Wed, 18 Dec 2024 14:30:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/30e1e066-5192-462e-9183-5fe0cc576aec_1200x628.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>Welcome to DailyDev.in!</strong></p><p>At DailyDev.in, we make learning new software engineering concepts easy and fun, one week at a time.</p><p>Interested in diving deeper? Check out our latest post:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;b22ed2c6-8dcd-4ae9-8fb1-400a552b6733&quot;,&quot;caption&quot;:&quot;Welcome to DailyDev.in!&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;lg&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;SD 1: What is an ORM?&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:302104863,&quot;name&quot;:&quot;Dailydev.in&quot;,&quot;bio&quot;:null,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a71b5643-99db-4938-85e6-236d7ea671e1_144x144.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2024-12-14T16:56:49.000Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2836100c-9b0b-4aab-b1a9-7bc544fe35e3_843x1024.webp&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://dailydevin.substack.com/p/what-is-an-orm&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:153418374,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:0,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;Dailydev.in Newsletter&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb45c683d-6d98-4a5e-94b6-d82f49679f03_500x500.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div><hr></div><p><strong>Ever wondered how Google ensures that billions of users can access their emails, YouTube videos, or shared Google Drive files seamlessly and securely?</strong> Behind the scenes, a powerful system works tirelessly to decide <em>who can access what</em>, no matter where they are in the world or how complex the rules might be. That system is <strong>Google Zanzibar</strong>&#8212;a globally distributed authorization framework that quietly powers the access control behind services like Google Calendar, Maps, Photos, Drive, and more.</p><p>Imagine managing trillions of access rules, answering millions of requests <em>every second</em>, all while ensuring decisions are <strong>correct, lightning-fast, and reliable</strong>. Sounds like magic? It&#8217;s not&#8212;it&#8217;s engineering at scale. In this blog, we&#8217;ll uncover the secrets of Zanzibar&#8217;s architecture, its data model, and how it achieves the holy grail of consistency, scalability, and low latency. Whether you&#8217;re a curious student, a software engineer, or a tech leader, by the end of this deep dive, you&#8217;ll have a clear understanding of how one of Google&#8217;s most impressive systems operates&#8212;and why it&#8217;s a benchmark for modern access control.</p><p>Ready to explore how Google keeps the gears of authorization running smoothly? Let&#8217;s dive in.</p><div><hr></div><h3>Table of Contents</h3><ul><li><p><a href="#what-is-zanzibar">What is Zanzibar?</a></p><ul><li><p><a href="#key-features-of-zanzibar">Key Features of Zanzibar</a></p></li><li><p><a href="#data-model-and-configuration">Data Model and Configuration</a></p></li></ul></li><li><p><a href="#check-evaluation">Check Evaluation</a></p><ul><li><p><a href="#summary">Summary</a></p></li></ul></li><li><p><a href="#api">API</a></p></li><li><p><a href="#architecture">Architecture</a></p></li><li><p><a href="#performance-optimizations">Performance Optimizations</a></p><ul><li><p><a href="#distributed-caching">Distributed Caching</a></p></li><li><p><a href="#request-hedging">Request Hedging</a></p></li><li><p><a href="#performance-isolation">Performance Isolation</a></p></li></ul></li><li><p><a href="#deep-dive-into-zanzibars-components">Deep Dive into Zanzibar&#8217;s Components</a></p><ul><li><p><a href="#aclservers">Aclservers</a></p></li><li><p><a href="#watchservers">Watchservers</a></p></li><li><p><a href="#spanner">Spanner</a></p></li><li><p><a href="#leopard">Leopard</a></p></li></ul></li></ul><div><hr></div><h2><strong>What is Zanzibar?</strong></h2><p>Zanzibar is Google&#8217;s global authorization system designed to store and evaluate access control lists (ACLs) for a wide range of services, including Calendar, Cloud, Drive, Maps, Photos, and YouTube. It offers a uniform data model and configuration language to express diverse access control policies.</p><h3><strong>Key Features of Zanzibar</strong></h3><ul><li><p><strong>Correctness</strong>: Ensures consistent access control decisions.</p></li><li><p><strong>Flexibility</strong>: Supports a rich set of access control policies.</p></li><li><p><strong>Low Latency</strong>: Responds quickly to authorization checks.</p></li><li><p><strong>High Availability</strong>: Reliably handles requests.</p></li><li><p><strong>Large Scale</strong>: Manages trillions of ACLs and millions of requests per second.</p></li></ul><h3><strong>Data Model and Configuration</strong></h3><h4>Defining the Tuple Data Model</h4><p>Zanzibar uses relation tuples to represent ACLs. These tuples can include groups and nested group memberships. The tuple format is as follows:</p><pre><code>&#10216;tuple&#10217; ::= &#10216;object&#10217;&#8216;#&#8217;&#10216;relation&#10217;&#8216;@&#8217;&#10216;user&#10217;
&#10216;object&#10217; ::= &#10216;namespace&#10217;&#8216;:&#8217;&#10216;object id&#10217;
&#10216;user&#10217; ::= &#10216;user id&#10217; | &#10216;userset&#10217;
&#10216;userset&#10217; ::= &#10216;object&#10217;&#8216;#&#8217;&#10216;relation&#10217;</code></pre><p><strong>Example Tuples:</strong></p><pre><code>doc:readme#owner@10          # User 10 is an owner of doc:readme

group:eng#member@11         # User 11 is a member of group:eng

doc:readme#viewer@group:eng#member  # Members of group:eng are viewers of doc:readme</code></pre><h4><strong>Namespace Configuration</strong></h4><p>Before clients can store relation tuples in Zanzibar, they must configure their namespaces. A namespace configuration specifies its relations as well as its storage parameters. Each relation has a name and a relation config. Storage parameters include sharding settings and an encoding for object IDs.</p><h4><strong>Userset Rewrite Rules</strong></h4><p>Userset rewrite rules allow clients to define relationships between different relations in a namespace. These rules enable the creation of complex access control policies by specifying how one relation can be derived from another. In the given example, the namespace is <code>"doc"</code>, and it defines three relations: <code>"owner"</code>, <code>"editor"</code>, and <code>"viewer"</code>.</p><p><strong>Configuration Breakdown</strong></p><pre><code>name: "doc"
relation { name: "owner" }
relation {
    name: "editor"
    userset_rewrite {
        union {
            child { _this {} }
            child { computed_userset { relation: "owner" } }
        }
    }
}
relation {
    name: "viewer"
    userset_rewrite {
        union {
            child { _this {} }
            child { computed_userset { relation: "editor" } }
        }
    }
}</code></pre><p><strong>Relations Defined</strong></p><ol><li><p><strong><code>owner</code></strong>: This is a basic relation that directly specifies the owners of a document.</p></li><li><p><strong><code>editor</code></strong>: This relation is defined with a userset rewrite rule that combines the current editors (<code>_this</code>) with the owners (<code>computed_userset { relation: "owner" }</code>).</p></li><li><p><strong><code>viewer</code></strong>: This relation is defined with a userset rewrite rule that combines the current viewers (<code>_this</code>) with the editors (<code>computed_userset { relation: "editor" }</code>).</p></li></ol><p><strong>Userset Rewrite Rules</strong></p><p><strong><code>editor</code> Relation</strong></p><pre><code>relation {
    name: "editor"
    userset_rewrite {
        union {
            child { _this {} }
            child { computed_userset { relation: "owner" } }
        }
    }
}
</code></pre><ul><li><p><strong><code>_this</code></strong>: Refers to the current set of users who have the <code>editor</code> relation.</p></li><li><p><strong><code>computed_userset { relation: "owner" }</code></strong>: Computes the set of users who have the <code>owner</code> relation.</p></li></ul><p>The <code>union</code> operation combines these two sets, meaning that anyone who is an <code>owner</code> of a document is also considered an <code>editor</code>.</p><p><strong><code>viewer</code> Relation</strong></p><pre><code>relation {
    name: "viewer"
    userset_rewrite {
        union {
            child { _this {} }
            child { computed_userset { relation: "editor" } }
        }
    }
}
</code></pre><ul><li><p><strong><code>_this</code></strong>: Refers to the current set of users who have the <code>viewer</code> relation.</p></li><li><p><strong><code>computed_userset { relation: "editor" }</code></strong>: Computes the set of users who have the <code>editor</code> relation.</p></li></ul><p>The <code>union</code> operation combines these two sets, meaning that anyone who is an <code>editor</code> of a document is also considered a <code>viewer</code>.</p><p><strong>Practical Example</strong></p><p>Let&#8217;s say we have the following relation tuples:</p><pre><code>doc:example#owner@alice       # Alice is the owner of the example document
doc:example#editor@bob        # Bob is an editor of the example document
doc:example#viewer@charlie    # Charlie is a viewer of the example document
</code></pre><p>Based on the userset rewrite rules:</p><ul><li><p><strong>Editors</strong>: The set of editors includes both <code>bob</code> (explicitly defined) and <code>alice</code> (implicitly included because she is an owner).</p></li><li><p><strong>Viewers</strong>: The set of viewers includes <code>charlie</code> (explicitly defined), <code>bob</code> (implicitly included because he is an editor), and <code>alice</code> (implicitly included because she is an owner).</p></li></ul><h2>Enjoying What You Read?</h2><p>Subscribe to our newsletter for more insightful content like this!</p><p><strong><a href="https://blog.dailydev.in/subscribe?">Subscribe Now</a></strong></p><h2>Check Evaluation</h2><p>Zanzibar evaluates ACL checks by converting check requests to boolean expressions. For example:</p><pre><code>CHECK(U, &#10216;object#relation&#10217;) = 
&#9;&#9;&#9;&#8707; tuple &#10216;object#relation@U&#10217;
&#9;&#9;&#9;&#8744; &#8707; tuple &#10216;object#relation@U&#8242;&#10217;, where
&#9;&#9;&#9;&#9;&#9;U&#8242; = &#10216;object&#8242;#relation&#8242;&#10217; s.t. CHECK(U,U&#8242;).</code></pre><p><strong>Example Scenario</strong></p><p>Consider a document named <code>example</code> with the following relation tuples:</p><pre><code>doc:example#owner@alice       # Alice is the owner of the example document
doc:example#editor@bob        # Bob is an editor of the example document
doc:example#viewer@charlie    # Charlie is a viewer of the example document
</code></pre><p>And the namespace configuration for <code>doc</code> is:</p><pre><code>name: "doc"
relation { name: "owner" }
relation {
    name: "editor"
    userset_rewrite {
        union {
            child { _this {} }
            child { computed_userset { relation: "owner" } }
        }
    }
}
relation {
    name: "viewer"
    userset_rewrite {
        union {
            child { _this {} }
            child { computed_userset { relation: "editor" } }
        }
    }
}
</code></pre><p><strong>Check Evaluation: Does <code>david</code> have <code>viewer</code> access to <code>doc:example</code>?</strong></p><p>To evaluate this, Zanzibar will follow these steps:</p><ol><li><p><strong>Direct Check</strong>: First, Zanzibar checks if <code>david</code> is directly listed as a <code>viewer</code> of <code>doc:example</code>.</p><ul><li><p>There is no direct tuple for <code>david</code> as a <code>viewer</code>.</p></li></ul></li><li><p><strong>Inherited Check</strong>: Next, Zanzibar checks if <code>david</code> is an <code>editor</code> of <code>doc:example</code> because <code>viewers</code> include <code>editors</code>.</p><ul><li><p>There is no direct tuple for <code>david</code> as an <code>editor</code>.</p></li></ul></li><li><p><strong>Further Inherited Check</strong>: Finally, Zanzibar checks if <code>david</code> is an <code>owner</code> of <code>doc:example</code> because <code>editors</code> include <code>owners</code>.</p><ul><li><p>There is no direct tuple for <code>david</code> as an <code>owner</code>.</p></li></ul></li></ol><p>Since <code>david</code> is not directly or indirectly listed as a <code>viewer</code>, <code>editor</code>, or <code>owner</code> of <code>doc:example</code>, the check evaluation concludes that <code>david</code> does not have <code>viewer</code> access to <code>doc:example</code>.</p><p><strong>Check Evaluation: Does <code>bob</code> have <code>viewer</code> access to <code>doc:example</code>?</strong></p><p>To evaluate this, Zanzibar will follow these steps:</p><ol><li><p><strong>Direct Check</strong>: First, Zanzibar checks if <code>bob</code> is directly listed as a <code>viewer</code> of <code>doc:example</code>.</p><ul><li><p>There is no direct tuple for <code>bob</code> as a <code>viewer</code>.</p></li></ul></li><li><p><strong>Inherited Check</strong>: Next, Zanzibar checks if <code>bob</code> is an <code>editor</code> of <code>doc:example</code> because <code>viewers</code> include <code>editors</code>.</p><ul><li><p>There is a direct tuple for <code>bob</code> as an <code>editor</code>.</p></li></ul></li></ol><p>Since <code>bob</code> is an <code>editor</code> of <code>doc:example</code>, and <code>viewers</code> include <code>editors</code>, the check evaluation concludes that <code>bob</code> has <code>viewer</code> access to <code>doc:example</code>.</p><p><strong>Check Evaluation: Does <code>alice</code> have <code>viewer</code> access to <code>doc:example</code>?</strong></p><p>To evaluate this, Zanzibar will follow these steps:</p><ol><li><p><strong>Direct Check</strong>: First, Zanzibar checks if <code>alice</code> is directly listed as a <code>viewer</code> of <code>doc:example</code>.</p><ul><li><p>There is no direct tuple for <code>alice</code> as a <code>viewer</code>.</p></li></ul></li><li><p><strong>Inherited Check</strong>: Next, Zanzibar checks if <code>alice</code> is an <code>editor</code> of <code>doc:example</code> because <code>viewers</code> include <code>editors</code>.</p><ul><li><p>There is no direct tuple for <code>alice</code> as an <code>editor</code>.</p></li></ul></li><li><p><strong>Further Inherited Check</strong>: Finally, Zanzibar checks if <code>alice</code> is an <code>owner</code> of <code>doc:example</code> because <code>editors</code> include <code>owners</code>.</p><ul><li><p>There is a direct tuple for <code>alice</code> as an <code>owner</code>.</p></li></ul></li></ol><p>Since <code>alice</code> is an <code>owner</code> of <code>doc:example</code>, and <code>editors</code> include <code>owners</code>, and <code>viewers</code> include <code>editors</code>, the check evaluation concludes that <code>alice</code> has <code>viewer</code> access to <code>doc:example</code>.</p><h3>Summary</h3><p>Zanzibar&#8217;s check evaluation process involves:</p><ol><li><p>Checking for direct relations.</p></li><li><p>Checking for inherited relations based on userset rewrite rules.</p></li><li><p>Combining these checks to determine if a user has the requested relation to an object.</p></li></ol><p>This approach allows Zanzibar to handle complex access control policies efficiently and consistently.</p><h2>API</h2><p>Zanzibar provides several APIs:</p><ul><li><p><strong>Check</strong>: Determines if a user has a specific relation to an object.</p></li><li><p><strong>Read</strong>: Retrieves relation tuples.</p></li><li><p><strong>Write</strong>: Modifies relation tuples.</p></li><li><p><strong>Watch</strong>: Monitors changes to relation tuples.</p></li><li><p><strong>Expand</strong>: Returns the effective userset for an object-relation pair.</p></li></ul><h2><strong>Architecture</strong></h2><p>Zanzibar&#8217;s architecture includes:</p><ul><li><p><strong>aclservers</strong>: Handle Check, Read, Expand, and Write requests.</p></li><li><p><strong>watchservers</strong>: Respond to Watch requests.</p></li><li><p><strong>Spanner</strong>: A globally distributed database system that stores ACLs and metadata.</p></li><li><p><strong>Leopard</strong>: An indexing system for efficient set computations.</p></li></ul><h2><strong>Performance Optimizations</strong></h2><h3>Distributed Caching</h3><p>Zanzibar employs a distributed cache to store results of recent checks and reads. This helps in handling hot spots and reducing latency. Cache entries are distributed across <code>Zanzibar</code> servers using consistent hashing.</p><h3>Request Hedging</h3><p>To mitigate tail latency, Zanzibar uses request hedging. This involves sending the same request to multiple servers and using the first response that arrives. This technique helps in accommodating slow tasks without significantly increasing load.</p><h3>Performance Isolation</h3><p>Zanzibar implements performance isolation to ensure that misbehaving clients or unexpected usage patterns do not affect other clients. This is achieved through:</p><ul><li><p><strong>CPU Capacity Allocation</strong>: Each client has a global limit on maximum CPU usage per second.</p></li><li><p><strong>Memory Usage Limits</strong>: Each server limits the total number of outstanding RPCs to control memory usage.</p></li><li><p><strong>Spanner Server Limits</strong>: Limits the maximum number of concurrent reads per (object, client) and per client on each Spanner server.</p></li></ul><p><strong>Real-Life Example</strong></p><p>Imagine a photo-sharing service where users can share photos with specific groups. Using Zanzibar, the service can efficiently manage ACLs to ensure that only authorized users can view or edit photos. For example:</p><pre><code>photo:vacation#owner@alice       # Alice is the owner of the vacation photo
group:family#member@bob          # Bob is a member of the family group
photo:vacation#viewer@group:family#member  # Family members can view the vacation photo
</code></pre><p><strong>Code Sample</strong></p><p>Here&#8217;s a simplified example of how you might use Zanzibar&#8217;s API to check if a user has permission to view a photo:</p><pre><code>from zanzibar_client import ZanzibarClient

client = ZanzibarClient()

# Check if Bob can view the vacation photo
result = client.check("photo:vacation", "viewer", "bob")
print("Bob can view the photo:", result)
</code></pre><p><strong>Graphs and Data</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nQ4q!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32032583-cb41-4696-b8ce-a3bd9f5257a6_870x560.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nQ4q!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32032583-cb41-4696-b8ce-a3bd9f5257a6_870x560.webp 424w, https://substackcdn.com/image/fetch/$s_!nQ4q!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32032583-cb41-4696-b8ce-a3bd9f5257a6_870x560.webp 848w, https://substackcdn.com/image/fetch/$s_!nQ4q!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32032583-cb41-4696-b8ce-a3bd9f5257a6_870x560.webp 1272w, https://substackcdn.com/image/fetch/$s_!nQ4q!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32032583-cb41-4696-b8ce-a3bd9f5257a6_870x560.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nQ4q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32032583-cb41-4696-b8ce-a3bd9f5257a6_870x560.webp" width="870" height="560" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/32032583-cb41-4696-b8ce-a3bd9f5257a6_870x560.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:560,&quot;width&quot;:870,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:51716,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nQ4q!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32032583-cb41-4696-b8ce-a3bd9f5257a6_870x560.webp 424w, https://substackcdn.com/image/fetch/$s_!nQ4q!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32032583-cb41-4696-b8ce-a3bd9f5257a6_870x560.webp 848w, https://substackcdn.com/image/fetch/$s_!nQ4q!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32032583-cb41-4696-b8ce-a3bd9f5257a6_870x560.webp 1272w, https://substackcdn.com/image/fetch/$s_!nQ4q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32032583-cb41-4696-b8ce-a3bd9f5257a6_870x560.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mUfW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15051d17-5e73-4428-92fe-abb6af0e6773_870x496.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mUfW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15051d17-5e73-4428-92fe-abb6af0e6773_870x496.png 424w, https://substackcdn.com/image/fetch/$s_!mUfW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15051d17-5e73-4428-92fe-abb6af0e6773_870x496.png 848w, https://substackcdn.com/image/fetch/$s_!mUfW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15051d17-5e73-4428-92fe-abb6af0e6773_870x496.png 1272w, https://substackcdn.com/image/fetch/$s_!mUfW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15051d17-5e73-4428-92fe-abb6af0e6773_870x496.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mUfW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15051d17-5e73-4428-92fe-abb6af0e6773_870x496.png" width="870" height="496" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/15051d17-5e73-4428-92fe-abb6af0e6773_870x496.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:496,&quot;width&quot;:870,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:71737,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!mUfW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15051d17-5e73-4428-92fe-abb6af0e6773_870x496.png 424w, https://substackcdn.com/image/fetch/$s_!mUfW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15051d17-5e73-4428-92fe-abb6af0e6773_870x496.png 848w, https://substackcdn.com/image/fetch/$s_!mUfW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15051d17-5e73-4428-92fe-abb6af0e6773_870x496.png 1272w, https://substackcdn.com/image/fetch/$s_!mUfW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15051d17-5e73-4428-92fe-abb6af0e6773_870x496.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Deep Dive into Zanzibar&#8217;s Components</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lP9_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9203d21-603d-4399-998b-f9cc0435ef4f_1780x890.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lP9_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9203d21-603d-4399-998b-f9cc0435ef4f_1780x890.png 424w, https://substackcdn.com/image/fetch/$s_!lP9_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9203d21-603d-4399-998b-f9cc0435ef4f_1780x890.png 848w, https://substackcdn.com/image/fetch/$s_!lP9_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9203d21-603d-4399-998b-f9cc0435ef4f_1780x890.png 1272w, https://substackcdn.com/image/fetch/$s_!lP9_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9203d21-603d-4399-998b-f9cc0435ef4f_1780x890.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lP9_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9203d21-603d-4399-998b-f9cc0435ef4f_1780x890.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a9203d21-603d-4399-998b-f9cc0435ef4f_1780x890.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:201452,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!lP9_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9203d21-603d-4399-998b-f9cc0435ef4f_1780x890.png 424w, https://substackcdn.com/image/fetch/$s_!lP9_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9203d21-603d-4399-998b-f9cc0435ef4f_1780x890.png 848w, https://substackcdn.com/image/fetch/$s_!lP9_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9203d21-603d-4399-998b-f9cc0435ef4f_1780x890.png 1272w, https://substackcdn.com/image/fetch/$s_!lP9_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9203d21-603d-4399-998b-f9cc0435ef4f_1780x890.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Aclservers</h3><p><code>Aclservers</code> are the primary servers in Zanzibar&#8217;s architecture. They handle various types of requests:</p><ul><li><p><strong>Check Requests</strong>: Determine if a user has a specific relation to an object.</p></li><li><p><strong>Read Requests</strong>: Retrieve relation tuples.</p></li><li><p><strong>Expand Requests</strong>: Return the effective userset for an object-relation pair.</p></li><li><p><strong>Write Requests</strong>: Modify relation tuples.</p></li></ul><h3>Watchservers</h3><p><code>Watchservers</code> are specialized servers that respond to <code>Watch</code> requests. They tail the changelog and serve a stream of namespace changes to clients in near real-time.</p><h3>Spanner</h3><p>Spanner is a globally distributed database system used by Zanzibar to store ACLs and their metadata. It provides external consistency and snapshot reads with bounded staleness, ensuring that ACL evaluations respect the causal ordering of updates.</p><h3>Leopard</h3><p>Leopard is an indexing system used to optimize operations on large and deeply nested sets. It reads periodic snapshots of ACL data and watches for changes between snapshots. Leopard performs transformations on the data, such as denormalization, and responds to requests from <code>aclservers</code>.</p><p><strong>Learnings from Zanzibar&#8217;s System Design</strong></p><ol><li><p><strong>Unified Data Model</strong>: Zanzibar&#8217;s use of a unified data model for ACLs and groups simplifies the representation and management of access control policies.</p></li><li><p><strong>External Consistency</strong>: By leveraging Spanner&#8217;s TrueTime mechanism, Zanzibar ensures that ACL evaluations respect the causal ordering of updates, preventing issues like the &#8220;new enemy&#8221; problem.</p></li><li><p><strong>Scalability</strong>: Zanzibar&#8217;s architecture, with its distributed servers and caching mechanisms, allows it to scale to trillions of ACLs and millions of requests per second.</p></li><li><p><strong>Low Latency</strong>: Techniques like distributed caching, request hedging, and performance isolation help Zanzibar achieve low latency, even under high load.</p></li><li><p><strong>Flexibility</strong>: The system&#8217;s configuration language and userset rewrite rules provide the flexibility needed to accommodate a wide range of access control policies.</p></li></ol><p><strong>Conclusion</strong></p><p>Zanzibar is a powerful authorization system that ensures consistent, scalable, and performant access control across Google&#8217;s services. By understanding its data model, consistency model, and architecture, developers can build robust authorization mechanisms in their own applications. Whether you&#8217;re a college student learning about system design or a senior engineer looking to implement a global authorization system, Zanzibar offers valuable insights and techniques.</p><div><hr></div><p>Have you worked with authorization systems before? How do you ensure consistency and scalability in your projects? Share your experiences and thoughts in the comments below!</p><div><hr></div><p><strong>References</strong></p><ol><li><p>Pang, R., C&#225;ceres, R., Burrows, M., et al. (2019). <a href="https://storage.googleapis.com/gweb-research2023-media/pubtools/pdf/10683a8987dbf0c6d4edcafb9b4f05cc9de5974a.pdf">Zanzibar: Google&#8217;s Consistent, Global Authorization System</a>. USENIX Annual Technical Conference (USENIX ATC &#8217;19).</p></li><li><p>Google Cloud Identity and Access Management. <a href="https://cloud.google.com/iam/">https://cloud.google.com/iam/</a></p></li></ol>]]></content:encoded></item><item><title><![CDATA[SD 1: What is an ORM?]]></title><description><![CDATA[An ORM, or Object Relational Mapper, is a piece of software designed to translate between the data representations used by databases and those used in object-oriented programming.]]></description><link>https://blog.dailydev.in/p/what-is-an-orm</link><guid isPermaLink="false">https://blog.dailydev.in/p/what-is-an-orm</guid><dc:creator><![CDATA[Yashraj Balidani]]></dc:creator><pubDate>Sat, 14 Dec 2024 16:56:49 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/2836100c-9b0b-4aab-b1a9-7bc544fe35e3_843x1024.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>Welcome to DailyDev.in!</strong></p><p>At DailyDev.in, we make learning new software engineering concepts easy and fun, one week at a time.</p><p>Interested in diving deeper? Check out our latest post:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;7cff43a2-f230-4029-be42-b0bb4b7f62b1&quot;,&quot;caption&quot;:&quot;The API world is at a crossroads, poised for transformative change. From enabling seamless integrations to fueling the digital economy, APIs are the invisible engines driving modern innovation. But with emerging technologies like generative AI and edge computing&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;lg&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;What&#8217;s Next for APIs? 4 Key Trends Shaping the Future&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:302104863,&quot;name&quot;:&quot;Dailydev.in&quot;,&quot;bio&quot;:null,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a71b5643-99db-4938-85e6-236d7ea671e1_144x144.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2024-12-02T18:20:26.000Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/456fbb58-5d73-4d2e-bcb9-e5d74cf11ff4_1024x966.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://dailydevin.substack.com/p/whats-next-for-apis-4-key-trends&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:153418377,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:0,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;Dailydev.in Newsletter&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb45c683d-6d98-4a5e-94b6-d82f49679f03_500x500.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><h2>Table of Contents</h2><ul><li><p><a href="#bh-DkgShh4ygdQTQOaY7jaqW">The Great Divide: Code vs. Database</a></p></li><li><p><a href="#how-does-orm-work-lets-rent-a-car">How Does ORM Work? Let&#8217;s Rent a Car</a></p><ul><li><p><a href="#without-orm-doing-everything-yourself">Without ORM: Doing Everything Yourself</a></p></li><li><p><a href="#with-orm-renting-made-easy">With ORM: Renting Made Easy</a></p></li></ul></li><li><p><a href="#bh-Hx5YFxWUKDb0TkpEaOt26">Why Use an ORM?</a></p></li><li><p><a href="#performance-considerations-not-all-magic-is-instant">Performance Considerations: Not All Magic is Instant</a></p><ul><li><p><a href="#when-to-be-cautious">When to Be Cautious</a></p></li><li><p><a href="#the-philosophical-dimension">The Philosophical Dimension</a></p></li></ul></li><li><p><a href="#choosing-your-orm-companion">Choosing Your ORM Companion</a></p></li><li><p><a href="#bringing-it-all-together">Bringing It All Together</a></p></li></ul><div><hr></div><p>Picture this: You&#8217;re on a treasure hunt. The treasure is a chest full of data (users, orders, inventory). But it&#8217;s locked inside a vault (database), and you don&#8217;t have the key. Now imagine you have a magical helper who knows the vault&#8217;s language and can retrieve or store your treasure with ease. That magical helper? It&#8217;s an <strong>ORM</strong>&#8212; Object Relational Mapper.</p><p>But don&#8217;t worry; we&#8217;re not diving straight into technical jargon. Let&#8217;s take it step by step, using stories, analogies, and a pinch of code magic to unravel the mystery.</p><h2>The Great Divide: Code vs. Database</h2><p>Your application and your database are like two neighbors who speak different languages. Your app speaks in objects (classes, methods, attributes), while your database talks in tables (rows, columns, SQL).</p><pre><code>SQL stands for Structured Query Language and is a computer language that we use to interact with a relational database. It is mainly used for organizing, managing, and retrieving data from a computer database.  </code></pre><p>For example, in code, you might describe a person like this:</p><p>Python</p><pre><code>class User:
    def __init__(self, name, age):
        self.name = name
        self.age = age</code></pre><p>But the database doesn&#8217;t understand this fancy &#8220;User&#8221; class. It expects something like this:</p><p>The ORM acts as the translator, ensuring both sides understand each other.</p><h2>How Does ORM Work? Let&#8217;s Rent a Car</h2><p>Imagine you&#8217;re at a car rental service:</p><ol><li><p><strong>You (the developer)</strong>: You walk in and say, &#8220;I need a red sedan for 3 days.&#8221;</p></li><li><p><strong>The Clerk (ORM)</strong>: The clerk understands your request and translates it into a detailed system lookup: &#8220;Find all available cars where type = &#8216;sedan&#8217;, color = &#8216;red&#8217;, and mark them as reserved for 3 days.&#8221;</p></li><li><p><strong>The Rental System (Database)</strong>: The system fetches the appropriate car, processes your request, and reserves it for you.</p></li></ol><p>Without the clerk, you&#8217;d need to learn the rental system&#8217;s complex interface, manually search for the car, and reserve it yourself. With the clerk (ORM), all the hard work is handled behind the scenes.</p><p>In database terms:</p><ul><li><p><strong>You writing code</strong>: &#8220;Fetch all users where the age is greater than 18.&#8221;</p></li><li><p><strong>ORM translates</strong>: It generates SQL like <code>SELECT * FROM Users WHERE Age &gt; 18;</code>.</p></li><li><p><strong>Database executes</strong>: The table rows matching your request are returned.</p></li></ul><p>Let&#8217;s see this in action with C#:</p><h4>Without ORM: Doing Everything Yourself</h4><p>C#</p><pre><code>using System;
using System.Data.SqlClient;

class Program
{
    static void Main()
    {
        string connectionString = "Server=myServer;Database=myDatabase;User Id=myUsername;Password=myPassword;";
        string query = "SELECT * FROM Users WHERE Age &gt; 18;";

        using (SqlConnection connection = new SqlConnection(connectionString))
        {
            connection.Open();
            SqlCommand command = new SqlCommand(query, connection);
            SqlDataReader reader = command.ExecuteReader();

            while (reader.Read())
            {
                Console.WriteLine($"Name: {reader["Name"]}, Age: {reader["Age"]}");
            }
        }
    }
}
</code></pre><p>Here, you&#8217;re acting as the car rental clerk and the system, manually running SQL queries and processing the results.</p><h4>With ORM: Renting Made Easy</h4><p>C#</p><pre><code>using System;
using System.Linq;
using Microsoft.EntityFrameworkCore;

// Define the User class
public class User
{
    public int Id { get; set; }
    public string Name { get; set; }
    public int Age { get; set; }
}

// Define the DbContext
...

class Program
{
    static void Main()
    {
        using (var context = new AppDbContext())
        {
            var adults = context.Users.Where(user =&gt; user.Age &gt; 18).ToList();

            foreach (var user in adults)
            {
                Console.WriteLine($"Name: {user.Name}, Age: {user.Age}");
            }
        }
    }
}
</code></pre><p>In this ORM example:</p><ol><li><p>You define a <code>User</code> class and an <code>AppDbContext</code> to represent the database.</p></li><li><p>ORM automatically translates the <code>.Where()</code> query into SQL and retrieves the results for you.</p></li></ol><h3>Why This Matters</h3><p>Without ORM, you&#8217;d need to understand SQL deeply and manually handle queries, connections, and results. With ORM, you focus on writing code that describes <em>what</em> you want, and it handles <em>how</em> to get it.</p><p>This analogy shows how ORM bridges the gap between your application and the database, just like the rental clerk simplifies your car rental process.</p><p></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.dailydev.in/subscribe?"><span>Subscribe now</span></a></p><h2></h2><h2>Why Use an ORM?</h2><ol><li><p><strong>Less Code, More Focus</strong>: Write meaningful code without worrying about SQL details.</p></li><li><p><strong>Consistency</strong>: The ORM takes care of database connections, making your code cleaner and easier to debug.</p></li><li><p><strong>Database Independence</strong>: Switching from SQLite to PostgreSQL? No problem&#8212;your ORM handles it.</p></li></ol><h2>Performance Considerations: Not All Magic is Instant</h2><p>While ORMs are powerful, they&#8217;re not always the fastest solution. Think of them like a gourmet chef who takes slightly longer but guarantees a perfect meal every time.</p><h3>When to Be Cautious</h3><ul><li><p>Extremely large datasets</p></li><li><p>Performance-critical applications</p></li><li><p>Scenarios requiring complex, optimized queries</p></li></ul><h3>The Philosophical Dimension</h3><p>ORMs represent more than technical tools &#8211; they&#8217;re bridges between different programming paradigms. They embody the principle of abstraction, allowing developers to focus on solving business problems rather than wrestling with low-level data manipulation.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jH3R!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f936d7c-21ea-4f60-931c-6b26c010110d_843x1024.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jH3R!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f936d7c-21ea-4f60-931c-6b26c010110d_843x1024.webp 424w, https://substackcdn.com/image/fetch/$s_!jH3R!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f936d7c-21ea-4f60-931c-6b26c010110d_843x1024.webp 848w, https://substackcdn.com/image/fetch/$s_!jH3R!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f936d7c-21ea-4f60-931c-6b26c010110d_843x1024.webp 1272w, https://substackcdn.com/image/fetch/$s_!jH3R!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f936d7c-21ea-4f60-931c-6b26c010110d_843x1024.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jH3R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f936d7c-21ea-4f60-931c-6b26c010110d_843x1024.webp" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8f936d7c-21ea-4f60-931c-6b26c010110d_843x1024.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;orm pros and cons&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="orm pros and cons" title="orm pros and cons" srcset="https://substackcdn.com/image/fetch/$s_!jH3R!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f936d7c-21ea-4f60-931c-6b26c010110d_843x1024.webp 424w, https://substackcdn.com/image/fetch/$s_!jH3R!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f936d7c-21ea-4f60-931c-6b26c010110d_843x1024.webp 848w, https://substackcdn.com/image/fetch/$s_!jH3R!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f936d7c-21ea-4f60-931c-6b26c010110d_843x1024.webp 1272w, https://substackcdn.com/image/fetch/$s_!jH3R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f936d7c-21ea-4f60-931c-6b26c010110d_843x1024.webp 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h2>Choosing Your ORM Companion</h2><p>Popular ORMs across languages:</p><ul><li><p>Python: <a href="https://www.sqlalchemy.org/">SQLAlchemy</a></p></li><li><p>JavaScript/TypeScript: <a href="https://sequelize.org/">Sequelize</a>, <a href="https://www.prisma.io/">Prisma</a></p></li><li><p>Java: <a href="https://hibernate.org/">Hibernate</a></p></li><li><p>.NET: <a href="https://learn.microsoft.com/en-us/ef/">Entity Framework</a></p></li><li><p>Ruby: <a href="https://guides.rubyonrails.org/active_record_querying.html">ActiveRecord</a></p></li></ul><h2>Bringing It All Together</h2><p>An ORM is like your bridge to the database. It translates your code&#8217;s objects into something the database can store and understand, and vice versa. It&#8217;s not about avoiding SQL entirely but about empowering you to focus on the bigger picture while leaving the mundane tasks to your magical helper.</p><p>So the next time you&#8217;re working on an app and need to save or fetch data, remember you don&#8217;t have to do it alone. Let the ORM work its magic, while you focus on building the treasure map itself.</p><p>Now, go forth and code, treasure hunter!</p>]]></content:encoded></item><item><title><![CDATA[AWS re:Invent 2024: Key Announcements (GT 3)]]></title><description><![CDATA[Welcome to DailyDev.in!]]></description><link>https://blog.dailydev.in/p/aws-reinvent-2024-key-announcements</link><guid isPermaLink="false">https://blog.dailydev.in/p/aws-reinvent-2024-key-announcements</guid><dc:creator><![CDATA[Yashraj Balidani]]></dc:creator><pubDate>Sun, 08 Dec 2024 11:36:55 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/53f9217e-6eed-410c-b8dd-f57024e1fa1d_1200x675.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>Welcome to DailyDev.in!</strong></p><p>At DailyDev.in, we make learning new software engineering concepts easy and fun, one week at a time.</p><p>Interested in diving deeper? Check out our latest post:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;70b36883-4c41-4b4a-81dd-3fb13f21cfeb&quot;,&quot;caption&quot;:&quot;The API world is at a crossroads, poised for transformative change. From enabling seamless integrations to fueling the digital economy, APIs are the invisible engines driving modern innovation. But with emerging technologies like generative AI and edge computing&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;md&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;What&#8217;s Next for APIs? 4 Key Trends Shaping the Future&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:302104863,&quot;name&quot;:&quot;Dailydev.in&quot;,&quot;bio&quot;:null,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a71b5643-99db-4938-85e6-236d7ea671e1_144x144.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2024-12-02T18:20:26.000Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/456fbb58-5d73-4d2e-bcb9-e5d74cf11ff4_1024x966.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://dailydevin.substack.com/p/whats-next-for-apis-4-key-trends&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:153418377,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:0,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;Dailydev.in Newsletter&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb45c683d-6d98-4a5e-94b6-d82f49679f03_500x500.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div><hr></div><p>The AWS re:Invent 2024 conference has once again set the bar for cloud innovation, offering a wealth of advancements poised to transform industries and empower software developers. From breakthroughs in generative AI to improved sustainability efforts, here&#8217;s a concise breakdown of the highlights and their implications.</p><h3><strong>Amazon Nova: Redefining AI Integration</strong></h3><p>Amazon unveiled <strong>Nova</strong>, its latest suite of foundational AI models. Nova comes in four tiers&#8212;Micro, Lite, Pro, and Premier&#8212;and supports text, image, and video generation. With tools like <strong>Nova Canvas</strong> (for image creation) and <strong>Nova Reel</strong> (for video editing), Nova is designed to cater to diverse workloads. This directly challenges competitors like OpenAI and Google. <a href="https://www.aboutamazon.com/news/aws/aws-reinvent-2024-keynote-live-news-updates?p=introducing-amazon-nova">Read More</a></p><p>For developers, Nova simplifies AI integration through <strong>Amazon Bedrock</strong>, enabling rapid prototyping of AI-powered applications.</p><blockquote><p>As AWS CEO Matt Garman remarked, &#8220;<em>Nova represents our commitment to making advanced AI capabilities accessible to everyone</em>&#8221;&#8203;</p></blockquote><div><hr></div><h3><strong>Graviton4: Sustainability Meets Performance</strong></h3><p>The <strong>Graviton4 processors</strong> promise 40% better price-performance while consuming 60% less energy compared to their predecessor. These instances are ideal for developers working on large-scale, cost-sensitive applications. They also support AWS&#8217;s sustainability goals, appealing to organizations aiming to reduce their carbon footprint. <a href="https://www.aboutamazon.com/news/aws/aws-reinvent-2024-keynote-live-news-updates?p=aws-ceo-shares-new-advancements-in-ai-chips-foundation-models-and-more-during-re-invent-keynote">Read More</a></p><h2>Stay Updated!</h2><p>Don&#8217;t miss out on the latest insights and updates. Subscribe to our newsletter to receive new content directly to your inbox.</p><p>Join our community and stay ahead in the world of software development and system design!</p><p> The form can be filled in the actual <a href="https://blog.dailydev.in/aws-reinvent-2024-key-announcements/">website url</a>.</p><h3><strong>SageMaker Lakehouse: Data Unification</strong></h3><p>AWS introduced <strong>SageMaker Lakehouse</strong>, an innovative solution that unifies S3 data lakes and Redshift warehouses. This update simplifies complex analytics workflows, allowing software engineers to seamlessly access and manipulate data for AI/ML projects.</p><p>With this tool, developers can expect reduced overhead in managing disparate datasets, fostering productivity and innovation. <a href="https://www.aboutamazon.com/news/aws/aws-reinvent-2024-keynote-live-news-updates?p=new-amazon-sagemaker-ai-capabilities-reimagine-how-customers-build-and-scale-generative-ai-and-machine-learning-models">Read More</a></p><div><hr></div><h3><strong>Bedrock Enhancements: Smarter AI Workflows</strong></h3><p>AWS&#8217;s <strong>Bedrock</strong> received several upgrades, including:</p><ul><li><p><strong>Model Distillation</strong>: Reduces the complexity of large AI models, making them more efficient.</p></li><li><p><strong>Automated Reasoning</strong>: Ensures the factual accuracy of AI-generated outputs, a critical feature for sensitive applications.</p></li><li><p><strong>Multi-Agent Collaboration</strong>: Orchestrates multiple AI agents for complex tasks, boosting productivity.</p></li></ul><p>These features signal AWS&#8217;s commitment to making AI tools more practical and reliable for developers and businesses. <a href="https://www.aboutamazon.com/news/aws/aws-reinvent-2024-keynote-live-news-updates?p=aws-strengthens-amazon-bedrock-with-industry-first-ai-safeguard-new-agent-capability-and-model-customization">Read More</a></p><div><hr></div><h2>Project Rainier</h2><p><strong>Project Rainier</strong> is an ambitious initiative by AWS, created in collaboration with AI safety and research company <strong><a href="https://www.aboutamazon.com/news/aws/amazon-invests-additional-4-billion-anthropic-ai">Anthropic</a></strong>. It involves the deployment of <strong>Trn2 UltraServers</strong>, an EC2 offering designed for scaling generative AI workloads. These servers connect multiple <strong>Trn2</strong> instances using <strong>NeuronLink</strong>, allowing customers to scale up to 64 <strong>Trainium2 chips</strong> for training and inference tasks. The project aims to provide one of the largest AI compute clusters in the world, supporting the development of next-gen AI models by distributing model training across hundreds of thousands of <strong>Trainium2 chips</strong>. With the ultra-fast <strong>EFA networking</strong> and over five times the exaflops used in current AI models, <strong>Project Rainier</strong> is set to dramatically accelerate AI research and model deployment&#8203;. <a href="https://www.aboutamazon.com/news/aws/aws-reinvent-2024-keynote-live-news-updates?p=trainium3-chips-designed-for-high-performance-needs-of-next-frontier-of-generative-ai-workloads">Read More</a></p><div><hr></div><h3><strong>Market Implications</strong></h3><p>AWS&#8217;s innovations will likely accelerate the adoption of generative AI across industries, challenging competitors like Microsoft Azure and Google Cloud. However, some concerns remain, such as the potential over-reliance on proprietary ecosystems like Amazon Bedrock, which might limit multi-cloud flexibility for businesses.</p><p>For developers, these announcements offer opportunities to innovate faster and tackle more complex challenges with scalable, efficient tools.</p><div><hr></div><h3><strong>Stay Updated</strong></h3><p>AWS re:Invent 2024 reinforces Amazon&#8217;s position as a leader in cloud innovation. Developers and businesses alike have much to look forward to as these tools roll out.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.dailydev.in/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Dailydev.in Newsletter! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[What’s Next for APIs? 4 Key Trends Shaping the Future]]></title><description><![CDATA[The API world is at a crossroads, poised for transformative change.]]></description><link>https://blog.dailydev.in/p/whats-next-for-apis-4-key-trends</link><guid isPermaLink="false">https://blog.dailydev.in/p/whats-next-for-apis-4-key-trends</guid><dc:creator><![CDATA[Yashraj Balidani]]></dc:creator><pubDate>Mon, 02 Dec 2024 18:20:26 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/456fbb58-5d73-4d2e-bcb9-e5d74cf11ff4_1024x966.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The API world is at a crossroads, poised for transformative change. From enabling seamless integrations to fueling the digital economy, APIs are the invisible engines driving modern innovation. But with emerging technologies like <strong>generative AI</strong> and <strong>edge computing</strong> revolutionizing how APIs are designed and consumed, the landscape is shifting fast. Add to this the growing complexity of distributed systems and the ever-present threat of cyberattacks, and it&#8217;s clear: the way we build and manage APIs is evolving at breakneck speed.</p><p>As we gear up for 2025 and beyond, understanding these shifts is crucial for anyone&#8212;developers, tech leaders, or enthusiasts&#8212;who wants to stay ahead of the curve. Here&#8217;s a look at four trends shaping the future of APIs and why they matter to you.</p><div><hr></div><h3><strong>1. API Security Takes Center Stage</strong></h3><p>With the rise of distributed systems and microservices, APIs are multiplying&#8212;and so are their vulnerabilities. Each new endpoint creates an opportunity for attackers, and the stakes are high. A stark reminder came in 2024 when a data breach at Twilio&#8217;s Authy service exposed sensitive information of over <a href="https://www.bleepingcomputer.com/news/security/hackers-abused-api-to-verify-millions-of-authy-mfa-phone-numbers/">33 million</a> users, all through an unsecured API endpoint.</p><p><strong>Why it matters:</strong><br>The more interconnected our systems become, the more we rely on APIs&#8212;and the harder they are to secure. Research shows 95% of companies faced API security issues last year. But the future holds promise: new standards, <strong>AI-powered threat detection</strong>, and <strong>zero-trust architectures</strong> are stepping in to combat these risks.</p><p><strong>The takeaway:</strong><br>Think of API security as the seatbelt in your car. It&#8217;s not just a precaution; it&#8217;s essential. As businesses integrate smarter tools and stricter protocols, users can expect safer, more reliable digital experiences.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vJQt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4f142d9-54a8-4902-93d2-4d6eb8cd6b4c_1024x966.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vJQt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4f142d9-54a8-4902-93d2-4d6eb8cd6b4c_1024x966.png 424w, https://substackcdn.com/image/fetch/$s_!vJQt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4f142d9-54a8-4902-93d2-4d6eb8cd6b4c_1024x966.png 848w, https://substackcdn.com/image/fetch/$s_!vJQt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4f142d9-54a8-4902-93d2-4d6eb8cd6b4c_1024x966.png 1272w, https://substackcdn.com/image/fetch/$s_!vJQt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4f142d9-54a8-4902-93d2-4d6eb8cd6b4c_1024x966.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vJQt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4f142d9-54a8-4902-93d2-4d6eb8cd6b4c_1024x966.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f4f142d9-54a8-4902-93d2-4d6eb8cd6b4c_1024x966.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Diagram illustrating the three pillars of API security: Zero-Trust Architectures emphasizing no implicit trust in systems, New Standards introducing emerging protocols for enhanced security, and AI-Powered Detection leveraging advanced AI systems to identify and mitigate threats.&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram illustrating the three pillars of API security: Zero-Trust Architectures emphasizing no implicit trust in systems, New Standards introducing emerging protocols for enhanced security, and AI-Powered Detection leveraging advanced AI systems to identify and mitigate threats." title="Diagram illustrating the three pillars of API security: Zero-Trust Architectures emphasizing no implicit trust in systems, New Standards introducing emerging protocols for enhanced security, and AI-Powered Detection leveraging advanced AI systems to identify and mitigate threats." srcset="https://substackcdn.com/image/fetch/$s_!vJQt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4f142d9-54a8-4902-93d2-4d6eb8cd6b4c_1024x966.png 424w, https://substackcdn.com/image/fetch/$s_!vJQt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4f142d9-54a8-4902-93d2-4d6eb8cd6b4c_1024x966.png 848w, https://substackcdn.com/image/fetch/$s_!vJQt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4f142d9-54a8-4902-93d2-4d6eb8cd6b4c_1024x966.png 1272w, https://substackcdn.com/image/fetch/$s_!vJQt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4f142d9-54a8-4902-93d2-4d6eb8cd6b4c_1024x966.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div><hr></div><h3><strong>2. Generative AI is Redefining API Development</strong></h3><p>AI isn&#8217;t just a buzzword&#8212;it&#8217;s reshaping how we build and use APIs. Tools like <strong>ChatGPT</strong> and <strong>GitHub Copilot</strong> are helping developers write code faster, generate better documentation, and even create APIs from plain English descriptions. This trend is unlocking a new level of accessibility, enabling even non-technical teams to interact with APIs effectively.</p><p><strong>Why it matters:</strong><br>AI is democratizing the development process. A developer&#8217;s productivity isn&#8217;t just about how fast they can code anymore; it&#8217;s about how effectively they can leverage AI tools. Postman&#8217;s <a href="https://www.postman.com/state-of-api/2024/artificial-intelligence/">2024 report</a> found a 73% increase in AI-driven API traffic, showing that this isn&#8217;t a future trend&#8212;it&#8217;s happening now.</p><p><strong>The takeaway:</strong><br>AI isn&#8217;t replacing developers; it&#8217;s amplifying their capabilities. Expect APIs to become smarter, faster, and easier to use, unlocking new possibilities for businesses and consumers alike.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!i0iR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa10b5893-6977-463f-86b4-3b91f331ef75_660x672.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!i0iR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa10b5893-6977-463f-86b4-3b91f331ef75_660x672.png 424w, https://substackcdn.com/image/fetch/$s_!i0iR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa10b5893-6977-463f-86b4-3b91f331ef75_660x672.png 848w, https://substackcdn.com/image/fetch/$s_!i0iR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa10b5893-6977-463f-86b4-3b91f331ef75_660x672.png 1272w, https://substackcdn.com/image/fetch/$s_!i0iR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa10b5893-6977-463f-86b4-3b91f331ef75_660x672.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!i0iR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa10b5893-6977-463f-86b4-3b91f331ef75_660x672.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a10b5893-6977-463f-86b4-3b91f331ef75_660x672.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Graph showcasing the rise in AI-driven API traffic over time, highlighting the growing integration of artificial intelligence in API development and usage, with a significant upward trend indicating increased adoption by developers and businesses.&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Graph showcasing the rise in AI-driven API traffic over time, highlighting the growing integration of artificial intelligence in API development and usage, with a significant upward trend indicating increased adoption by developers and businesses." title="Graph showcasing the rise in AI-driven API traffic over time, highlighting the growing integration of artificial intelligence in API development and usage, with a significant upward trend indicating increased adoption by developers and businesses." srcset="https://substackcdn.com/image/fetch/$s_!i0iR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa10b5893-6977-463f-86b4-3b91f331ef75_660x672.png 424w, https://substackcdn.com/image/fetch/$s_!i0iR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa10b5893-6977-463f-86b4-3b91f331ef75_660x672.png 848w, https://substackcdn.com/image/fetch/$s_!i0iR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa10b5893-6977-463f-86b4-3b91f331ef75_660x672.png 1272w, https://substackcdn.com/image/fetch/$s_!i0iR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa10b5893-6977-463f-86b4-3b91f331ef75_660x672.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><strong>3. A Mix of API Standards is the New Normal</strong></h3><p>Remember when REST APIs were the universal standard? That&#8217;s changing. Technologies like <strong>GraphQL</strong> and <strong>AsyncAPI</strong> are gaining ground, offering more flexibility and better performance for <a href="https://blog.dailydev.in/unlocking-the-secrets-of-api-protocols/">specific use cases</a>. For example, GraphQL simplifies data queries, making it easier to get exactly what you need without overloading systems. Meanwhile, AsyncAPI is emerging as the go-to choice for real-time, event-driven systems.</p><p><strong>Why it matters:</strong><br>The &#8220;one-size-fits-all&#8221; approach to APIs is no longer viable. As applications grow more complex, businesses are adopting multiple standards to meet diverse needs.</p><p><strong>The takeaway:</strong><br>For users, this means more responsive apps, better real-time features, and richer experiences. Behind the scenes, it&#8217;s a challenge for developers&#8212;but one that&#8217;s driving innovation in <a href="https://blog.dailydev.in/unlocking-the-secrets-of-api-protocols/">API management tools</a>.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!10AI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2437e56-30c3-458a-abb8-1092e0280987_1024x896.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!10AI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2437e56-30c3-458a-abb8-1092e0280987_1024x896.png 424w, https://substackcdn.com/image/fetch/$s_!10AI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2437e56-30c3-458a-abb8-1092e0280987_1024x896.png 848w, https://substackcdn.com/image/fetch/$s_!10AI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2437e56-30c3-458a-abb8-1092e0280987_1024x896.png 1272w, https://substackcdn.com/image/fetch/$s_!10AI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2437e56-30c3-458a-abb8-1092e0280987_1024x896.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!10AI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2437e56-30c3-458a-abb8-1092e0280987_1024x896.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f2437e56-30c3-458a-abb8-1092e0280987_1024x896.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Cycle diagram illustrating the evolving API landscape, emphasizing key trends: adoption of new standards, improved application performance, enhanced user experience, developer challenges, and innovation in API management, showcasing the dynamic interplay shaping modern API ecosystems.&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Cycle diagram illustrating the evolving API landscape, emphasizing key trends: adoption of new standards, improved application performance, enhanced user experience, developer challenges, and innovation in API management, showcasing the dynamic interplay shaping modern API ecosystems." title="Cycle diagram illustrating the evolving API landscape, emphasizing key trends: adoption of new standards, improved application performance, enhanced user experience, developer challenges, and innovation in API management, showcasing the dynamic interplay shaping modern API ecosystems." srcset="https://substackcdn.com/image/fetch/$s_!10AI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2437e56-30c3-458a-abb8-1092e0280987_1024x896.png 424w, https://substackcdn.com/image/fetch/$s_!10AI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2437e56-30c3-458a-abb8-1092e0280987_1024x896.png 848w, https://substackcdn.com/image/fetch/$s_!10AI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2437e56-30c3-458a-abb8-1092e0280987_1024x896.png 1272w, https://substackcdn.com/image/fetch/$s_!10AI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2437e56-30c3-458a-abb8-1092e0280987_1024x896.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><strong>4. Serverless APIs and Edge Computing Are the Future</strong></h3><p>Imagine a world where your app&#8217;s backend runs exactly where it&#8217;s needed&#8212;closer to users, faster than ever, and without the hassle of managing servers. That&#8217;s the promise of <strong>serverless APIs</strong> combined with <strong>edge computing</strong>. By processing data closer to end users, these technologies reduce latency and make apps more responsive.</p><p><strong>Why it matters:</strong><br>The shift to serverless and edge computing isn&#8217;t just about speed; it&#8217;s about efficiency. Businesses save money by only paying for what they use, while users benefit from smoother, faster experiences.</p><p><strong>The takeaway:</strong><br>While there are challenges, like debugging in distributed environments, the potential benefits far outweigh the drawbacks. Look for advancements in <strong>edge-native API management</strong> to make these systems more robust and scalable.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!416a!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8e5b395e-be56-4ba9-afd9-34ba69b4a81f_1024x389.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!416a!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8e5b395e-be56-4ba9-afd9-34ba69b4a81f_1024x389.png 424w, https://substackcdn.com/image/fetch/$s_!416a!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8e5b395e-be56-4ba9-afd9-34ba69b4a81f_1024x389.png 848w, https://substackcdn.com/image/fetch/$s_!416a!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8e5b395e-be56-4ba9-afd9-34ba69b4a81f_1024x389.png 1272w, https://substackcdn.com/image/fetch/$s_!416a!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8e5b395e-be56-4ba9-afd9-34ba69b4a81f_1024x389.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!416a!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8e5b395e-be56-4ba9-afd9-34ba69b4a81f_1024x389.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8e5b395e-be56-4ba9-afd9-34ba69b4a81f_1024x389.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Infographic comparing the pros and cons of serverless and edge computing in API architectures. Key advantages include reduced latency, cost efficiency, and scalability, while challenges highlight issues like complex debugging, expanded attack surfaces, and maintaining consistent performance across distributed edge environments.&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Infographic comparing the pros and cons of serverless and edge computing in API architectures. Key advantages include reduced latency, cost efficiency, and scalability, while challenges highlight issues like complex debugging, expanded attack surfaces, and maintaining consistent performance across distributed edge environments." title="Infographic comparing the pros and cons of serverless and edge computing in API architectures. Key advantages include reduced latency, cost efficiency, and scalability, while challenges highlight issues like complex debugging, expanded attack surfaces, and maintaining consistent performance across distributed edge environments." srcset="https://substackcdn.com/image/fetch/$s_!416a!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8e5b395e-be56-4ba9-afd9-34ba69b4a81f_1024x389.png 424w, https://substackcdn.com/image/fetch/$s_!416a!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8e5b395e-be56-4ba9-afd9-34ba69b4a81f_1024x389.png 848w, https://substackcdn.com/image/fetch/$s_!416a!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8e5b395e-be56-4ba9-afd9-34ba69b4a81f_1024x389.png 1272w, https://substackcdn.com/image/fetch/$s_!416a!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8e5b395e-be56-4ba9-afd9-34ba69b4a81f_1024x389.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><strong>The Road Ahead</strong></h3><p>APIs are more than just technical tools; they&#8217;re the foundation of how we connect in the digital age. The trends we&#8217;re seeing&#8212;stronger security, smarter AI integration, diversified standards, and serverless architectures&#8212;are shaping a future where APIs are faster, safer, and more intuitive.</p><p>For organizations, this means rethinking their API strategies to stay competitive. For everyday users, it means apps and services that are more reliable, secure, and responsive than ever.</p><p>As we head into 2025, one thing is clear: the best is yet to come. Will you be ready to embrace it?</p><h3>Stay Ahead in Software Development!</h3><p><strong>Subscribe to Our Newsletter and Get:</strong></p><ul><li><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3mBq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb327d752-5ac0-4386-a0bb-aad665380447_72x72.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3mBq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb327d752-5ac0-4386-a0bb-aad665380447_72x72.png 424w, https://substackcdn.com/image/fetch/$s_!3mBq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb327d752-5ac0-4386-a0bb-aad665380447_72x72.png 848w, https://substackcdn.com/image/fetch/$s_!3mBq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb327d752-5ac0-4386-a0bb-aad665380447_72x72.png 1272w, https://substackcdn.com/image/fetch/$s_!3mBq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb327d752-5ac0-4386-a0bb-aad665380447_72x72.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3mBq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb327d752-5ac0-4386-a0bb-aad665380447_72x72.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b327d752-5ac0-4386-a0bb-aad665380447_72x72.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&#128736;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="&#128736;" title="&#128736;" srcset="https://substackcdn.com/image/fetch/$s_!3mBq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb327d752-5ac0-4386-a0bb-aad665380447_72x72.png 424w, https://substackcdn.com/image/fetch/$s_!3mBq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb327d752-5ac0-4386-a0bb-aad665380447_72x72.png 848w, https://substackcdn.com/image/fetch/$s_!3mBq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb327d752-5ac0-4386-a0bb-aad665380447_72x72.png 1272w, https://substackcdn.com/image/fetch/$s_!3mBq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb327d752-5ac0-4386-a0bb-aad665380447_72x72.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p> Expert tips on system design and software engineering.</p></li><li><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dJTe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43f5c388-f9d0-4e4d-99a8-ce0534c7aba3_72x72.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dJTe!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43f5c388-f9d0-4e4d-99a8-ce0534c7aba3_72x72.png 424w, https://substackcdn.com/image/fetch/$s_!dJTe!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43f5c388-f9d0-4e4d-99a8-ce0534c7aba3_72x72.png 848w, https://substackcdn.com/image/fetch/$s_!dJTe!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43f5c388-f9d0-4e4d-99a8-ce0534c7aba3_72x72.png 1272w, https://substackcdn.com/image/fetch/$s_!dJTe!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43f5c388-f9d0-4e4d-99a8-ce0534c7aba3_72x72.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dJTe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43f5c388-f9d0-4e4d-99a8-ce0534c7aba3_72x72.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/43f5c388-f9d0-4e4d-99a8-ce0534c7aba3_72x72.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&#128218;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="&#128218;" title="&#128218;" srcset="https://substackcdn.com/image/fetch/$s_!dJTe!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43f5c388-f9d0-4e4d-99a8-ce0534c7aba3_72x72.png 424w, https://substackcdn.com/image/fetch/$s_!dJTe!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43f5c388-f9d0-4e4d-99a8-ce0534c7aba3_72x72.png 848w, https://substackcdn.com/image/fetch/$s_!dJTe!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43f5c388-f9d0-4e4d-99a8-ce0534c7aba3_72x72.png 1272w, https://substackcdn.com/image/fetch/$s_!dJTe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43f5c388-f9d0-4e4d-99a8-ce0534c7aba3_72x72.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p> Insights into the latest tech trends.</p></li><li><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qD4X!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dc62a00-cdff-4afd-b1cf-2a8af45e53e9_72x72.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qD4X!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dc62a00-cdff-4afd-b1cf-2a8af45e53e9_72x72.png 424w, https://substackcdn.com/image/fetch/$s_!qD4X!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dc62a00-cdff-4afd-b1cf-2a8af45e53e9_72x72.png 848w, https://substackcdn.com/image/fetch/$s_!qD4X!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dc62a00-cdff-4afd-b1cf-2a8af45e53e9_72x72.png 1272w, https://substackcdn.com/image/fetch/$s_!qD4X!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dc62a00-cdff-4afd-b1cf-2a8af45e53e9_72x72.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qD4X!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dc62a00-cdff-4afd-b1cf-2a8af45e53e9_72x72.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1dc62a00-cdff-4afd-b1cf-2a8af45e53e9_72x72.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&#128161;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="&#128161;" title="&#128161;" srcset="https://substackcdn.com/image/fetch/$s_!qD4X!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dc62a00-cdff-4afd-b1cf-2a8af45e53e9_72x72.png 424w, https://substackcdn.com/image/fetch/$s_!qD4X!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dc62a00-cdff-4afd-b1cf-2a8af45e53e9_72x72.png 848w, https://substackcdn.com/image/fetch/$s_!qD4X!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dc62a00-cdff-4afd-b1cf-2a8af45e53e9_72x72.png 1272w, https://substackcdn.com/image/fetch/$s_!qD4X!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dc62a00-cdff-4afd-b1cf-2a8af45e53e9_72x72.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p> Exclusive guides and tutorials straight to your inbox.</p></li></ul><p><strong>Join our growing community of developers building the future!</strong></p><p><strong>Sign up now</strong> and never miss an update.</p><p>The form can be filled in the actual <a href="https://blog.dailydev.in/whats-next-for-apis-4-key-trends/">website url</a>.</p>]]></content:encoded></item><item><title><![CDATA[Unlocking the Secrets of API Protocols: Which One is Best for You?]]></title><description><![CDATA[In today&#8217;s tech world, APIs (Application Programming Interfaces) are the backbone of seamless digital experiences, allowing applications to communicate and share data.]]></description><link>https://blog.dailydev.in/p/unlocking-the-secrets-of-api-protocols</link><guid isPermaLink="false">https://blog.dailydev.in/p/unlocking-the-secrets-of-api-protocols</guid><dc:creator><![CDATA[Yashraj Balidani]]></dc:creator><pubDate>Mon, 25 Nov 2024 06:24:38 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/8625fdea-ab1d-4957-8b08-f63eeeb4a2e6_1800x816.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In today&#8217;s tech world, APIs (Application Programming Interfaces) are the backbone of seamless digital experiences, allowing applications to communicate and share data. But with several different API protocols out there, it can be tricky to decide which one best suits your project needs. In this blog, we&#8217;ll walk through popular API protocols&#8212;REST, GraphQL, RPC, SOAP, and others&#8212;and outline their strengths, use cases, and differences.</p><p>Let&#8217;s dive into the world of API protocols to help you make the right choice for your next project!</p><div><hr></div><h3>What is an API Protocol?</h3><p>An API protocol defines how data is structured and transmitted between systems. Choosing the right protocol is essential for performance, scalability, and overall efficiency in your application.</p><div><hr></div><h3>Key API Protocols to Know</h3><h5>1. REST (Representational State Transfer)</h5><p><strong>Overview</strong>: REST is one of the most widely used protocols, designed to be stateless and highly scalable. RESTful APIs follow a standardized HTTP request-response model (GET, POST, PUT, DELETE).</p><p><strong>Strengths</strong>:</p><ul><li><p>Simple and easy to understand.</p></li><li><p>Compatible with web services (HTTP).</p></li><li><p>Great for public APIs and micro services.</p></li></ul><p><strong>Use Case</strong>: Ideal for web applications and mobile apps that need to interact with a large number of resources.</p><div><hr></div><h5>2. GraphQL</h5><p><strong>Overview</strong>: Created by Facebook, <a href="https://graphql.org/">GraphQL</a> allows clients to request specific data, eliminating the need to over-fetch or under-fetch information. It offers flexibility to request only the data fields you need.</p><p><strong>Strengths</strong>:</p><ul><li><p>Efficient data retrieval with a single request.</p></li><li><p>Reduces network usage and optimizes performance.</p></li><li><p>Perfect for complex systems with many data types and relationships.</p></li></ul><p><strong>Use Case</strong>: Ideal for applications with complex, data-heavy interactions, such as social media platforms or e-commerce sites.</p><div><hr></div><h5>3. RPC (Remote Procedure Call)</h5><p><strong>Overview</strong>: RPC allows a client to execute a function on a remote server as if it were local. RPC protocols, like <a href="https://grpc.io/">gRPC</a> (by Google), are often used to achieve high performance and low latency.</p><p><strong>Strengths</strong>:</p><ul><li><p>High-speed communication due to binary transmission.</p></li><li><p>Great for low-latency needs.</p></li><li><p>Effective for micro services in distributed systems.</p></li></ul><p><strong>Use Case</strong>: Suitable for real-time applications, such as video streaming services, and inter micro service communication.</p><div><hr></div><h5>4. SOAP (Simple Object Access Protocol)</h5><p><strong>Overview</strong>: SOAP is an older protocol that uses XML to encode requests and responses. It provides a higher level of security and supports complex transactions.</p><p><strong>Strengths</strong>:</p><ul><li><p>High security with built-in standards.</p></li><li><p>Suitable for enterprise-level applications.</p></li><li><p>Better error handling and ACID compliance for complex transactions.</p></li></ul><p><strong>Use Case</strong>: Commonly used in industries where security and reliability are essential, such as banking and telecommunications.</p><div><hr></div><h5>5. WebSockets</h5><p><strong>Overview</strong>: WebSockets provide a full-duplex communication channel over a single, long-lived connection, making it ideal for real-time applications.</p><p><strong>Strengths</strong>:</p><ul><li><p>Real-time data transfer.</p></li><li><p>Low latency due to persistent connection.</p></li><li><p>Perfect for live data streaming.</p></li></ul><p><strong>Use Case</strong>: Best for chat applications, gaming, and live streaming platforms that require real-time updates.</p><div><hr></div><h3>Quick Comparison of API Protocols</h3><p>Here&#8217;s a handy flow diagram comparing each protocol&#8217;s strengths and weaknesses:</p><div><hr></div><div data-attrs="{&quot;url&quot;:&quot;https://47.128.245.245/wp-content/uploads/2024/11/napkin-selection-3-1024x464.png&quot;}" data-component-name="AssetErrorToDOM"><picture><img src="/img/missing-image.png" height="455" width="728"></picture></div><h3>Choosing the Right API Protocol</h3><p>Your choice of API protocol will depend on factors like <strong>performance</strong>, <strong>data needs</strong>, <strong>security</strong>, and <strong>project requirements</strong>. Here&#8217;s a quick guide to help you decide:</p><ul><li><p><strong>If you need high performance and low latency</strong> (e.g., for internal services): <strong>RPC</strong> is a strong choice.</p></li><li><p><strong>If your application handles sensitive data</strong> and requires <strong>high security</strong>: <strong>SOAP</strong> is recommended.</p></li><li><p><strong>If you want a flexible, efficient way to fetch data</strong> with minimal over-fetching: <strong>GraphQL</strong> is ideal.</p></li><li><p><strong>For general web and mobile applications</strong> where ease of use is key: <strong>REST</strong> is a good fit.</p></li><li><p><strong>If your app requires real-time updates</strong> (e.g., chat or live data): <strong>WebSockets</strong> provide the best performance.</p></li></ul><div><hr></div><h3>Conclusion</h3><p><a href="https://blog.dailydev.in/category/api/">APIs</a> are crucial for modern applications, and choosing the right protocol is essential for achieving optimal performance and user satisfaction. Whether you go with REST, GraphQL, RPC, SOAP, or WebSockets, each protocol brings unique strengths to specific use cases.</p><p>In today&#8217;s rapidly evolving digital landscape, understanding these protocols can make all the difference in building a scalable, efficient, and user-friendly application.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hYXn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43411127-aa63-4040-90ca-ecdc86d8a6d2_744x439.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hYXn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43411127-aa63-4040-90ca-ecdc86d8a6d2_744x439.png 424w, https://substackcdn.com/image/fetch/$s_!hYXn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43411127-aa63-4040-90ca-ecdc86d8a6d2_744x439.png 848w, https://substackcdn.com/image/fetch/$s_!hYXn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43411127-aa63-4040-90ca-ecdc86d8a6d2_744x439.png 1272w, https://substackcdn.com/image/fetch/$s_!hYXn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43411127-aa63-4040-90ca-ecdc86d8a6d2_744x439.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hYXn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43411127-aa63-4040-90ca-ecdc86d8a6d2_744x439.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/43411127-aa63-4040-90ca-ecdc86d8a6d2_744x439.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;napkin selection&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="napkin selection" title="napkin selection" srcset="https://substackcdn.com/image/fetch/$s_!hYXn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43411127-aa63-4040-90ca-ecdc86d8a6d2_744x439.png 424w, https://substackcdn.com/image/fetch/$s_!hYXn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43411127-aa63-4040-90ca-ecdc86d8a6d2_744x439.png 848w, https://substackcdn.com/image/fetch/$s_!hYXn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43411127-aa63-4040-90ca-ecdc86d8a6d2_744x439.png 1272w, https://substackcdn.com/image/fetch/$s_!hYXn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43411127-aa63-4040-90ca-ecdc86d8a6d2_744x439.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3>Stay Ahead in Software Development!</h3><p><strong>Subscribe to Our Newsletter and Get:</strong></p><ul><li><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_8pG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a39dadd-1b9e-45e5-acf6-e3a2409f1290_72x72.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_8pG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a39dadd-1b9e-45e5-acf6-e3a2409f1290_72x72.png 424w, https://substackcdn.com/image/fetch/$s_!_8pG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a39dadd-1b9e-45e5-acf6-e3a2409f1290_72x72.png 848w, https://substackcdn.com/image/fetch/$s_!_8pG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a39dadd-1b9e-45e5-acf6-e3a2409f1290_72x72.png 1272w, https://substackcdn.com/image/fetch/$s_!_8pG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a39dadd-1b9e-45e5-acf6-e3a2409f1290_72x72.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_8pG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a39dadd-1b9e-45e5-acf6-e3a2409f1290_72x72.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7a39dadd-1b9e-45e5-acf6-e3a2409f1290_72x72.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&#128736;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="&#128736;" title="&#128736;" srcset="https://substackcdn.com/image/fetch/$s_!_8pG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a39dadd-1b9e-45e5-acf6-e3a2409f1290_72x72.png 424w, https://substackcdn.com/image/fetch/$s_!_8pG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a39dadd-1b9e-45e5-acf6-e3a2409f1290_72x72.png 848w, https://substackcdn.com/image/fetch/$s_!_8pG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a39dadd-1b9e-45e5-acf6-e3a2409f1290_72x72.png 1272w, https://substackcdn.com/image/fetch/$s_!_8pG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a39dadd-1b9e-45e5-acf6-e3a2409f1290_72x72.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p> Expert tips on system design and software engineering.</p></li><li><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SzB5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3304e659-1377-42a1-93ad-42309b330850_72x72.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SzB5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3304e659-1377-42a1-93ad-42309b330850_72x72.png 424w, https://substackcdn.com/image/fetch/$s_!SzB5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3304e659-1377-42a1-93ad-42309b330850_72x72.png 848w, https://substackcdn.com/image/fetch/$s_!SzB5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3304e659-1377-42a1-93ad-42309b330850_72x72.png 1272w, https://substackcdn.com/image/fetch/$s_!SzB5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3304e659-1377-42a1-93ad-42309b330850_72x72.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SzB5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3304e659-1377-42a1-93ad-42309b330850_72x72.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3304e659-1377-42a1-93ad-42309b330850_72x72.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&#128218;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="&#128218;" title="&#128218;" srcset="https://substackcdn.com/image/fetch/$s_!SzB5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3304e659-1377-42a1-93ad-42309b330850_72x72.png 424w, https://substackcdn.com/image/fetch/$s_!SzB5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3304e659-1377-42a1-93ad-42309b330850_72x72.png 848w, https://substackcdn.com/image/fetch/$s_!SzB5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3304e659-1377-42a1-93ad-42309b330850_72x72.png 1272w, https://substackcdn.com/image/fetch/$s_!SzB5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3304e659-1377-42a1-93ad-42309b330850_72x72.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p> Insights into the latest tech trends.</p></li><li><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Lx9G!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7e4e7c9-2271-4fd4-986a-e4e930b13432_72x72.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Lx9G!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7e4e7c9-2271-4fd4-986a-e4e930b13432_72x72.png 424w, https://substackcdn.com/image/fetch/$s_!Lx9G!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7e4e7c9-2271-4fd4-986a-e4e930b13432_72x72.png 848w, https://substackcdn.com/image/fetch/$s_!Lx9G!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7e4e7c9-2271-4fd4-986a-e4e930b13432_72x72.png 1272w, https://substackcdn.com/image/fetch/$s_!Lx9G!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7e4e7c9-2271-4fd4-986a-e4e930b13432_72x72.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Lx9G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7e4e7c9-2271-4fd4-986a-e4e930b13432_72x72.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f7e4e7c9-2271-4fd4-986a-e4e930b13432_72x72.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&#128161;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="&#128161;" title="&#128161;" srcset="https://substackcdn.com/image/fetch/$s_!Lx9G!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7e4e7c9-2271-4fd4-986a-e4e930b13432_72x72.png 424w, https://substackcdn.com/image/fetch/$s_!Lx9G!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7e4e7c9-2271-4fd4-986a-e4e930b13432_72x72.png 848w, https://substackcdn.com/image/fetch/$s_!Lx9G!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7e4e7c9-2271-4fd4-986a-e4e930b13432_72x72.png 1272w, https://substackcdn.com/image/fetch/$s_!Lx9G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7e4e7c9-2271-4fd4-986a-e4e930b13432_72x72.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p> Exclusive guides and tutorials straight to your inbox.</p></li></ul><p><strong>Join our growing community of developers building the future!</strong></p><p><strong>Sign up now</strong> and never miss an update.</p><p>The form can be filled in the actual <a href="https://blog.dailydev.in/unlocking-the-secrets-of-api-protocols/">website url</a>.</p>]]></content:encoded></item></channel></rss>