Writing

Engineering, in depth

Practical, production-grade writing on backend systems, FastAPI, AI/LLM engineering, and the bugs worth understanding.

fastapi 14 python 10 backend 8 sqlalchemy 4 performance 3 debugging 3 docker 3 devops 3
Welcome to LogicLoopTech
meta backend

Welcome to LogicLoopTech

A backend engineering blog focused on AI, RAG, FastAPI, and the real problems engineers hit in production.

1 min read
FastAPI SQLAlchemy Session Leak Detection: Diagnose and Fix Long-Running DB Sessions in Production
performance debugging

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.

5 min read
FastAPI Session Leak Detection: How to Find and Fix Long-Running SQLAlchemy Sessions in Production?
app-development performance

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

4 min read
Why Your FastAPI App Works Locally But Fails in Production
software-development backend

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

3 min read
Why Uvicorn Health Checks Fail Under Load (And How to Fix It Properly)
backend health-cjaeh844x02vvo3wtj5r2s75q

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

4 min read
FastAPI in Production: The Complete Deployment Guide (Docker, Workers, Scaling & Best Practices)
productivity docker

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.

7 min read
How Many Uvicorn Workers Do You Actually Need? (FastAPI Performance Guide)
backend gunicorn

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.

5 min read
Why FastAPI Apps Slow Down Over Time (Low CPU, High Latency Explained)
technology performance

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

8 min read
Fixing “QueuePool limit reached”: Debugging DB Connection Leaks in FastAPI
databases coding

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.

4 min read
FastAPI Lifespan vs Startup Events: The Mistake That Breaks Async Apps
refactoring python

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.

4 min read
FastAPI vs Flask in 2026: Is Flask Finally Dead?
software-development python

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

3 min read
AsyncSession Has No Attribute query in SQLAlchemy 2.0 (FastAPI Fix)
python migration

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.

2 min read
Fixing SQLAlchemy MissingGreenlet Error in FastAPI (Async Explained)
python debugging

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.

3 min read
Automating Production: A CI/CD Pipeline for Google Cloud Run with GitHub Actions
docker github

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.

3 min read
Serverless Python: Deploying FastAPI to Google Cloud Run with Docker
docker python

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.

3 min read
Fix AsyncSession Errors in FastAPI (SQLAlchemy 2.0 Guide)
python asynchronous

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

5 min read
How to Send Firebase Push Notifications with Python
tutorial python

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

3 min read
Serverless Automation: Scheduling Python Scripts with Google Cloud
python google-cloud

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

3 min read
How to Setup a Firebase Account for FCM Notifications: A Step-by-Step Guide
tutorial python

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

4 min read