FastAPI Day 2: ASGI Changed Everything — Understanding Event Loops & Concurrent Requests

ASGI Changed Everything — Understanding Event Loops & Concurrent Requests Most developers learn async backwards. They start with: async def hello(): without understanding: what problem async solves why event loops exist what concurrency actually means FastAPI only makes sense once you understand the engine underneath it. And that engine is ASGI. The Real Problem Was Never Speed This is the first mental model to fix. Async is not primarily about making your code execute faster. ...

May 9, 2026 · 4 min · Nitin S Kulkarni

FastAPI Day 1: FastAPI Exists Because WSGI Couldn’t Scale Modern APIs

FastAPI Exists Because WSGI Couldn’t Scale Modern APIs You think FastAPI became popular because it is “fast.” That is not the real reason. FastAPI exists because the old Python web architecture was reaching its limits. To understand FastAPI, you first need to understand the problem it was trying to solve. Before FastAPI: The WSGI World For years, Python web applications were built using: Flask Django Pyramid Most of them relied on something called: ...

May 8, 2026 · 3 min · Nitin S Kulkarni
Factory Pattern

Design Patterns Day 2: Stop Hardcoding Object Creation: Factory Pattern for Real Systems

Stop Hardcoding Object Creation: Factory Pattern for Real Systems In Part 1, we used Strategy to remove if-else from business logic. Now we fix the next problem: who decides which strategy to create—and how? The Problem (Picking Up From Strategy) After introducing Strategy, you often end up here: def get_strategy(method: str) -> PaymentStrategy: if method == "credit_card": return CreditCardPayment() elif method == "paypal": return PayPalPayment() elif method == "upi": return UPIPayment() else: raise ValueError("Unsupported payment method") We removed conditionals from business logic… but moved them into selection/creation. ...

May 5, 2026 · 3 min · Nitin S Kulkarni
Strategy Pattern Illustration

Design Patterns Day 1: Stop Writing Endless if-else: Strategy Pattern for Real Systems

Stop Writing Endless if-else: Strategy Pattern for Real Systems You start simple. A small feature. A couple of conditions. Then it grows. And suddenly, your code looks like this: def process_payment(method, amount): if method == "credit_card": return f"Processing {amount} via Credit Card" elif method == "paypal": return f"Processing {amount} via PayPal" elif method == "upi": return f"Processing {amount} via UPI" elif method == "crypto": return f"Processing {amount} via Crypto" else: raise ValueError("Unsupported payment method") Looks fine… until it doesn’t. The Problem At first glance, this works. ...

May 4, 2026 · 3 min · Nitin S Kulkarni