Writing
Engineering, in depth
Practical, production-grade writing on backend systems, FastAPI, AI/LLM engineering, and the bugs worth understanding.
Welcome to LogicLoopTech
A backend engineering blog focused on AI, RAG, FastAPI, and the real problems engineers hit in production.
FastAPI SQLAlchemy Session Leak Detection: Diagnose and Fix Long-Running DB Sessions in Production
Learn how to detect and fix FastAPI session leaks. A deep dive into SQLAlchemy connection pooling, long-running sessions, and production monitoring.
FastAPI Session Leak Detection: How to Find and Fix Long-Running SQLAlchemy Sessions in Production?
Seeing QueuePool errors or rising DB latency in FastAPI? Learn how to detect session leaks, debug long-running SQLAlchemy sessions, and fix connection pool
Why Your FastAPI App Works Locally But Fails in Production
our FastAPI app works locally but crashes in production? Learn the 5 top reasons: Uvicorn managers, QueuePool limits, Event Loop blocking, and Docker CPU
Why Uvicorn Health Checks Fail Under Load (And How to Fix It Properly)
Kubernetes keeps restarting your FastAPI pods? Learn why blocking the event loop kills health checks and how to split Liveness vs. Readiness probes correct
FastAPI in Production: The Complete Deployment Guide (Docker, Workers, Scaling & Best Practices)
Deploy FastAPI the right way. Learn production architecture, Gunicorn vs Uvicorn, worker tuning, database pooling, Docker best practices, and scaling.
How Many Uvicorn Workers Do You Actually Need? (FastAPI Performance Guide)
Stop guessing your worker count. Learn the (2 x CPU) + 1 formula, avoid the Docker CPU trap, and optimize FastAPI concurrency for production.
Why FastAPI Apps Slow Down Over Time (Low CPU, High Latency Explained)
A deep dive into debugging FastAPI performance: How blocked event loops, unclosed HTTP clients, and synchronous code cause high latency even when CPU usage
Fixing “QueuePool limit reached”: Debugging DB Connection Leaks in FastAPI
FastAPI apps often fail in production due to silent database connection leaks. Learn why QueuePool errors happen and how to fix them correctly.
FastAPI Lifespan vs Startup Events: The Mistake That Breaks Async Apps
Stop using @app.on_event. Learn how to use FastAPI's new Lifespan Context Managers to handle async database connections and resource cleanup correctly.
FastAPI vs Flask in 2026: Is Flask Finally Dead?
Is Flask still relevant in 2026? We compare FastAPI vs Flask performance, async features, and developer experience to help you choose the right Python backe
AsyncSession Has No Attribute query in SQLAlchemy 2.0 (FastAPI Fix)
Why session.query() fails in SQLAlchemy 2.0 and AsyncSession. Learn the new select() syntax for migrating your Python code.
Fixing SQLAlchemy MissingGreenlet Error in FastAPI (Async Explained)
Getting the "greenlet_spawn has not been called" error? Learn why Async SQLAlchemy fails with lazy loading and how to fix it using selectinload.
Automating Production: A CI/CD Pipeline for Google Cloud Run with GitHub Actions
Automate your deployment. A step-by-step tutorial on building a continuous delivery pipeline for Dockerized apps on Google Cloud Run using GitHub Actions.
Serverless Python: Deploying FastAPI to Google Cloud Run with Docker
Learn how to containerize your Python API with Docker and deploy it to Google Cloud Run (Serverless). A step-by-step guide for production-ready deployment.
Fix AsyncSession Errors in FastAPI (SQLAlchemy 2.0 Guide)
Learn how to build high-performance async APIs using FastAPI and SQLAlchemy 2.0 for production systems. Covers architecture, async sessions, common pitfalls
How to Send Firebase Push Notifications with Python
Learn how to programmatically send FCM push notifications using Python and the Firebase Admin SDK. A complete backend guide for testing your notification in
Serverless Automation: Scheduling Python Scripts with Google Cloud
A complete guide to deploying Python scripts on Google Cloud Functions and automating them with Cloud Scheduler. Move from local cron jobs to serverless arc
How to Setup a Firebase Account for FCM Notifications: A Step-by-Step Guide
How to Setup a Firebase Account for FCM Notifications: A Step-by-Step Guide