Writing
Engineering, in depth
Practical, production-grade writing on backend systems, FastAPI, AI/LLM engineering, and the bugs worth understanding.
AI agent python ollama: Build, Test, Deploy with FastAPI
Learn how to run an AI agent in Python with Ollama, from local installation to FastAPI integration, testing, and production scaling, using code examples.
AI Generated Code Detection: Practical Guide for Builders
Learn how to reliably detect AI-generated code in CI/CD, spot hidden security bugs, and navigate legal risks before they break production.
Building microservices python fastapi: design to production
Build microservices python fastapi from design to production, covering REST/gRPC choices, RabbitMQ/Kafka queues, Docker/K8s deployment, testing and security.
Using the OpenAI Agents SDK for Python: A Practical Guide
Learn to install the OpenAI Agents SDK for Python, build agents that use tools, manage memory, add custom functions, and scale with FastAPI or serverless.
Practical RAG chunking strategies for reliable RAG pipelines
Learn effective RAG chunking strategies, choose optimal chunk sizes, and evaluate chunk quality with Python tools like LangChain, LlamaIndex, and RAGAS.
Building a Robust RAG Pipeline Architecture for Production
Learn how to design, evaluate, and scale a production-grade RAG pipeline architecture with FastAPI, LangChain, and hybrid vector stores.
FastAPI WebSockets: Production-Ready Setup and Scaling
Learn how to build, secure, and scale fastapi websockets, covering basic endpoints, lifecycle handling, auth, broadcasting, and Redis-backed scaling.
How to Build AI Agents from Scratch with FastAPI
Learn step-by-step how to build AI agents from scratch, set up the Python environment, choose a framework, design architecture, add persistent memory, and deploy with FastAPI.
Supercharge Your API: FastAPI asyncpg Integration for High‑Performance PostgreSQL Access
Learn how to combine FastAPI with asyncpg for fast, async PostgreSQL queries. Includes pooling, SQLAlchemy 2.0, transactions, and production tuning.
Mastering FastAPI Deployment on Render – From Docker to CI/CD, Scaling & Cost‑Effective Tips
Learn step‑by‑step fastapi deployment on render with Docker, environment config, GitHub Actions CI/CD, scaling strategies, and monitoring tricks.
Mastering FastAPI Async Logging: Structured, Rotating, and Worker‑Ready Logs for High‑Performance Apps
Learn how to set up fastapi async logging with standard logging, structlog, and loguru. Includes background tasks, websockets, Uvicorn/Gunicorn integration, and rotation best practices.
FastAPI Async vs Sync – When to Use Each, Benchmarks, and Real‑World Tips
Discover the practical differences between fastapi async vs sync, how to choose the right endpoint type, benchmark results, pitfalls, and testing strategies.
Mastering FastAPI Error Handling Best Practices – A Hands‑On Guide
Discover fastapi error handling best practices with custom exception handlers, middleware logging, validation strategies, and TestClient testing.
Mastering FastAPI Background Tasks: Real‑World Patterns, Testing, and When to Reach for Celery
Learn how to use FastAPI background tasks for email, file processing, and more. Compare built‑in BackgroundTasks with Celery, see testing tips, and get best‑practice guidelines.
Mastering FastAPI Deployment on Railway – From Docker to CI/CD
Learn step‑by‑step fastapi deployment on railway with Docker, Uvicorn workers, PostgreSQL, migrations, and GitHub Actions CI/CD in a practical guide.
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 and fix long-running SQLAlchemy sessions in production.
Why Your FastAPI App Works Locally But Fails in Production
FastAPI works locally but fails in production? The five usual causes: Uvicorn workers, QueuePool limits, event loop blocking, and Docker CPU limits.
Why Uvicorn Health Checks Fail Under Load (And How to Fix It Properly)
Kubernetes keeps restarting your FastAPI pods? Learn why a blocked event loop kills health checks and how to split liveness and readiness probes.
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)
Why FastAPI apps slow down over time: how session leaks and blocking code cause high latency while CPU stays low, and how to fix it for good.
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?
FastAPI vs Flask in 2026: performance, async support, ecosystem, and developer experience compared so you can pick the right Python backend.
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)
Build high-performance async APIs with FastAPI and SQLAlchemy 2.0: architecture, async sessions, and the pitfalls that break production systems.
How to Send Firebase Push Notifications with Python
Send FCM push notifications from Python with the Firebase Admin SDK: setup, working code examples, and how to test your notification integration.
Serverless Automation: Scheduling Python Scripts with Google Cloud
Schedule Python scripts serverlessly with Google Cloud Run and Cloud Scheduler. A practical guide to replacing local cron jobs in production.
How to Setup a Firebase Account for FCM Notifications: A Step-by-Step Guide
Set up a Firebase account for FCM push notifications step by step: project creation, credentials, and the settings you need before sending messages.