Skip to content

필사 모드: Python Backend Frameworks 2026 Complete Guide — FastAPI · Litestar · Starlette · Sanic · Quart · Robyn · Django Ninja · BlackSheep Deep Dive

English
0%
정확도 0%
💡 왼쪽 원문을 읽으면서 오른쪽에 따라 써보세요. Tab 키로 힌트를 받을 수 있습니다.
원문 렌더가 준비되기 전까지 텍스트 가이드로 표시합니다.

> "FastAPI has become the de facto standard of Python, but Litestar, Robyn, and Granian have begun to threaten its throne. The Python backend of 2026 is no longer a 'slow language.'" — TechEmpower Round 23, 2025

The Python backend landscape has completely transformed seven years after FastAPI 0.1.0 went public in 2018. Pydantic 2 was rewritten in Rust and became 5 to 50 times faster, Granian has started replacing uvicorn, and Robyn is going after the territory of "write like Python, run like Go" with its Rust-based core. Meanwhile, Python 3.13 ships an experimental JIT and a free-threaded (no-GIL) build, and Python 3.14 is stabilizing both of them.

As of May 2026, Python backend frameworks have split into five camps with no single winner: **layered ASGI (FastAPI/Litestar/BlackSheep), full-stack (Django/Django Ninja), micro ASGI (Starlette/Falcon), Rust-cored (Robyn), and classic WSGI (Flask/Pyramid)**. This article walks through FastAPI, Starlette, Litestar 2.x, Sanic, Quart, Robyn, Django 5.2 + Django Ninja, DRF 3.16, BlackSheep, Falcon 4, FastHTML, and even Granian, uv, Pydantic 2, and msgspec — all in one place.

1. The 2026 Python Backend Map — A Triangle of ASGI, WSGI, and Rust Cores

Python backend frameworks in 2026 can be broadly split into five categories.

| Category | Representative Frameworks | Key Traits |

|---|---|---|

| Layered ASGI | FastAPI, Litestar 2.x, BlackSheep | Auto OpenAPI, DI, Pydantic/msgspec |

| Micro ASGI | Starlette, Falcon 4 | Minimal, direct routing, high performance |

| Async single-track | Sanic, Quart, Tornado | async-first, direct handlers |

| Full-stack | Django 5.2 + Ninja, DRF | ORM, Admin, Auth all integrated |

| Rust core | Robyn, Granian (server) | Python interface + Rust internals |

The key insight is that "**framework choice is no longer about performance, it is about the operating model**." Now that Pydantic 2 has moved to Rust, the validation speeds of FastAPI and Litestar are nearly identical, and using Granian as the server yields 1.5 to 2x the throughput of uvicorn. So the criteria for choosing have shifted to operational preferences: "Do I like the DI model? Controller-based or function-based? Do I prefer msgspec or Pydantic?"

2. Python 3.13 / 3.14 — JIT, Free-Threaded, Per-Interpreter GIL

Python 3.13 (October 2024) and 3.14 (October 2025) brought three core changes that affect backend performance.

First, the **experimental JIT compiler (PEP 744)**. The copy-and-patch-based JIT compiles hot loops and delivers a 5 to 15% performance improvement, and it has stabilized further in 3.14. Second, the **free-threaded build (PEP 703)** ships as `python3.13t` / `python3.14t` and fully removes the GIL. CPU-bound multi-threaded workloads now actually scale with the number of cores. Third, the **Per-Interpreter GIL (PEP 684)** lets you spawn multiple sub-interpreters inside the same process and isolate the GIL.

From an ASGI framework's perspective, the biggest change is the free-threaded mode. Granian has already started leveraging multi-threaded workers under 3.13t, and uvicorn added support starting with 3.14. FastAPI itself is compatible with free-threaded mode, and Pydantic 2 shines even brighter when the GIL is released, thanks to its Rust core.

Install free-threaded Python 3.13 (using uv)

uv python install 3.13t

uv venv --python 3.13t

Check that free-threaded mode is on

python -c "import sys; print(sys._is_gil_enabled())"

A False output means the GIL is disabled — this is a free-threaded build

Enable the JIT compiler (3.13 baseline)

PYTHON_JIT=1 python -c "import sys; print(sys._jit.is_enabled())"

As of May 2026, most ASGI frameworks still recommend 3.11 through 3.13 (stable GIL), and they label 3.13t / 3.14t as "experimental support."

3. The ASGI Standard — The Road Starlette Paved

The common ancestor of FastAPI, Litestar, and Quart is the ASGI (Asynchronous Server Gateway Interface) specification. ASGI extends WSGI's synchronous model into an asynchronous and bidirectional one, handling not just HTTP but also WebSocket, SSE, and lifespan events. On top of ASGI, Starlette provides the "standard parts of an asynchronous micro framework" — routing, middleware, a test client, sessions, CORS, static files, and more.

FastAPI pulls Starlette in directly as a dependency and layers on a Pydantic validation layer and DI (Depends). Litestar does not use Starlette and has its own ASGI implementation, but its middleware structure is very similar. BlackSheep also stacks its own router on top of ASGI.

The simplest possible ASGI app, written in Starlette alone

from starlette.applications import Starlette

from starlette.responses import JSONResponse

from starlette.routing import Route

async def homepage(request):

return JSONResponse({"hello": "world"})

routes = [

Route("/", endpoint=homepage),

]

app = Starlette(debug=True, routes=routes)

Run with: uvicorn main:app --reload

These 25 lines are effectively the "common denominator" of FastAPI/Litestar/BlackSheep. Each framework differentiates itself by what it adds on top.

4. FastAPI — The De Facto Standard, Auto OpenAPI

FastAPI (Sebastián Ramírez, 2018~) is still the de facto standard for Python backends in 2026. It has crossed 80K GitHub stars and is approaching 90K, and its PyPI downloads have exceeded 200M per month. Its core value condenses into three points.

First, **Pydantic-based automatic validation** — just write type hints in your function signature and it validates input and output and auto-generates an OpenAPI schema. Second, **DI (Depends)** — write `Depends(dependency)` as a function argument and the dependency is injected, with scope managed automatically. Third, **automatic Swagger/ReDoc hosting** — `/docs` and `/redoc` are provided for free.

FastAPI standard pattern

from fastapi import FastAPI, Depends, HTTPException, status

from pydantic import BaseModel, EmailStr

from typing import Annotated

app = FastAPI(title="users-api", version="2.0.0")

class UserCreate(BaseModel):

email: EmailStr

name: str

class User(BaseModel):

id: int

email: EmailStr

name: str

async def get_db():

db = AsyncSessionMaker()

try:

yield db

finally:

await db.close()

DBSession = Annotated[AsyncSession, Depends(get_db)]

@app.post("/users", response_model=User, status_code=status.HTTP_201_CREATED)

async def create_user(payload: UserCreate, db: DBSession) -> User:

existing = await db.execute(select(UserTable).where(UserTable.email == payload.email))

if existing.scalar_one_or_none():

raise HTTPException(status_code=409, detail="email already exists")

row = UserTable(email=payload.email, name=payload.name)

db.add(row)

await db.commit()

await db.refresh(row)

return User.model_validate(row)

FastAPI's downsides are also clear. **As the DI tree grows complex, debugging gets harder**, and the lack of a controller-level structure means routes get scattered across large projects. Litestar set out to tackle exactly these two issues head-on.

5. Litestar 2.x — Controller-Based, High-Performance ASGI

Litestar (formerly Starlite, rebranded in 2024) started out as an alternative to FastAPI and built its own independent ecosystem in the 2.x line. As of May 2026 it has more than 6K GitHub stars, and its core differentiators are:

- **Controller class-based routing** — inherit from `Controller` so that one class is responsible for one resource

- **msgspec-first support** — provides a serialization option faster than Pydantic (Pydantic is also supported)

- **Built-in DTO pattern** — separates DB models from API models to prevent over-fetching

- **A plugin system for DI** — SQLAlchemy, SAQ, Redis, and others ship as official plugins

- **OpenAPI 3.1 first** — JSON Schema 2020-12 compatible

Litestar 2.x controller-based pattern

from litestar import Controller, Litestar, get, post

from litestar.di import Provide

from msgspec import Struct

class UserCreate(Struct):

email: str

name: str

class User(Struct):

id: int

email: str

name: str

class UserController(Controller):

path = "/users"

@post("/")

async def create(self, data: UserCreate, repo: UserRepo) -> User:

return await repo.create(data)

@get("/{user_id:int}")

async def get_one(self, user_id: int, repo: UserRepo) -> User:

return await repo.get(user_id)

async def provide_repo() -> UserRepo:

return UserRepo()

app = Litestar(

route_handlers=[UserController],

dependencies={"repo": Provide(provide_repo)},

)

In TechEmpower Round 23 (2025), the Litestar + Granian combo posted 1.2M req/s on the plaintext benchmark, 1.6 times the throughput of FastAPI + uvicorn (720K). That said, most of the gap came from Granian, and FastAPI on top of Granian reaches nearly the same level as Litestar.

6. Starlette Alone — The Minimalist's Choice

When the abstractions of FastAPI/Litestar feel heavy, you have the option of using Starlette directly. Without Pydantic you have to write validation yourself, but routing, middleware, WebSocket, and the test client are all there. It is a good fit for spinning up a microservice or two lightly, or **when you want to peel off a few routes from a larger framework**.

When paired with the other sister libraries from the Encode (Tom Christie) team — `httpx`, `databases`, `orjson` — it surprisingly turns into a strong stack. Even in 2026, Encode recommends the Starlette + httpx + databases combo as "the minimum ASGI micro stack."

7. Sanic — The Original Async-Only Track

Sanic (2016~) is an async-first Python framework that predates FastAPI. As of May 2026 it has more than 18K GitHub stars and has stabilized in the 23.x release. Sanic does not follow ASGI and ships its own **Sanic Server**, which is both a strength and a weakness.

Strengths: the server is bundled in, so external dependencies are minimal, and HTTP/3 support was added starting with 24.x. Weakness: it is incompatible with the ASGI middleware ecosystem. If you love Flask-style decorator routing, Sanic remains attractive, and the `app.ext` extension in Sanic 24 has made OpenAPI and Pydantic integration one notch smoother.

Sanic 23.x async handler

from sanic import Sanic, json

from sanic.request import Request

app = Sanic("UsersApi")

@app.post("/users")

async def create_user(request: Request):

data = request.json

user_id = await create_in_db(data["email"], data["name"])

return json({"id": user_id, **data}, status=201)

@app.get("/users/<user_id:int>")

async def get_user(request: Request, user_id: int):

row = await fetch_user(user_id)

if not row:

return json({"error": "not found"}, status=404)

return json(row)

8. Quart — Async Flask, Same API on a Different Runtime

Quart (Pallets Projects, 2017~) aims to be "an ASGI framework with the same API as Flask." You can port Flask code over almost as-is — you just need to turn route functions into `async def`. Since 2025 it has been folded into the official Pallets projects and is now managed directly by the Flask team.

For a company with a Flask codebase that wants to migrate to async gradually, Quart is the most natural choice. About 90% of Flask extensions like Flask-Login and Flask-WTF also work in Quart.

9. Flask 3.x — The Classic WSGI Is Alive and Well

Flask 3.0 (2023) and 3.1 (2024) partially support async, but they are fundamentally WSGI frameworks. Even in 2026, PyPI downloads exceed 100M per month, and Flask dominates in small internal tools, admin pages, and webhook receivers. Flask 3.1 added trusted_hosts, stabilized async views, and cleaned up MIME headers, and it is still the framework that lets you start a server in 30 lines the fastest.

10. Django 5.2 + Django Ninja — The Full-Stack Counterattack

Django 5.2 LTS (April 2025) is the apex of full-stack frameworks. It bundles ORM, Admin, Auth, Migrations, Forms, Templates, and Caching, and starting with 5.x it partially supports `async def view` and an async ORM. Sentry, Disqus, Mozilla, and (in its early days) Instagram still use Django.

The complaint was that "Django ORM is great but DRF is heavy," and the answer was **Django Ninja** (2020~). Django Ninja layers an API on top of Django that is almost identical to FastAPI (type-hint based, Pydantic validation, auto OpenAPI), and as of May 2026 it has crossed 7K GitHub stars.

Django Ninja — FastAPI-like API + Django ORM

from ninja import NinjaAPI, Schema

from django.shortcuts import get_object_or_404

from .models import User as UserModel

api = NinjaAPI(version="2.0.0")

class UserIn(Schema):

email: str

name: str

class UserOut(Schema):

id: int

email: str

name: str

@api.post("/users", response={201: UserOut})

def create_user(request, payload: UserIn):

user = UserModel.objects.create(email=payload.email, name=payload.name)

return 201, user

@api.get("/users/{user_id}", response=UserOut)

def get_user(request, user_id: int):

return get_object_or_404(UserModel, pk=user_id)

Django REST Framework (DRF) 3.16 (2025) is still powerful, and it especially shines in well-structured projects built around its "enterprise features" like ViewSet, Serializer, and Permission. For new APIs go with Django Ninja, while keeping existing DRF codebases as-is is the common recommendation in 2026.

11. Robyn — A Python Framework with a Rust Core

Robyn (Sanskar Jethi, 2021~) is a hybrid framework where you write handlers in Python while the router, server, and HTTP parsing run in Rust (Actix-based). As of May 2026 it has more than 4K GitHub stars and has stabilized at version 0.65.

Robyn — Python handler + Rust server

from robyn import Robyn

app = Robyn(__file__)

@app.get("/")

async def hello():

return "Hello, Robyn!"

@app.post("/users")

async def create_user(request):

body = request.json()

return {"id": 1, **body}

app.start(port=8080)

Robyn shows 2 to 3 times the throughput of FastAPI on microbenchmarks like TechEmpower, but its small ecosystem is its weakness. You can still use standard libraries like SQLAlchemy, Redis, and Celery as-is, but the volume of middleware and authentication plugins is roughly one-tenth of FastAPI/Litestar.

12. BlackSheep — An ASGI Influenced by .NET

BlackSheep (Roberto Prevato, 2018~) is a Python ASGI framework influenced by ASP.NET Core. Its controller, DI, filter, and middleware structure is very similar to ASP.NET, and OpenAPI, OAuth2, and JWT integration is included out of the box. With more than 1.9K GitHub stars it is relatively small, but it has a steady fan base among developers from a Microsoft background.

BlackSheep — DI and controllers

from blacksheep import Application, get, post

from blacksheep.server.controllers import Controller, ApiController

from pydantic import BaseModel

class UserCreate(BaseModel):

email: str

name: str

class UsersController(ApiController):

@classmethod

def route(cls) -> str:

return "/users"

@post()

async def create(self, payload: UserCreate, repo: UserRepo) -> dict:

user_id = await repo.create(payload)

return {"id": user_id, "email": payload.email}

app = Application()

app.services.add_scoped(UserRepo)

13. Falcon 4 — Minimal and High-Performance

Falcon (2013~) started out as "the fastest WSGI framework" and gained first-class ASGI support in 4.x (2024). With its minimal structure of just middleware and resource classes, it is popular for microservices and API gateways. It has more than 9.6K GitHub stars and is used in parts of the backends of companies like LinkedIn and Cronitor.

14. Tornado / Bottle / CherryPy / Pyramid — The Legacy Tier

Tornado (2009~) was the pre-ASGI-era async framework, created at Facebook and later open-sourced. As of 2026 it lives on in Jupyter, IPython, and some financial systems, but new adoptions are rare.

Bottle (a single-file WSGI), CherryPy (a classic), and Pyramid (mid-sized) all still exist as packages, but the typical context is "maintaining a legacy project."

15. FastHTML / HTMX — The HTML-First Renaissance

FastHTML (Jeremy Howard, fast.ai, 2024) is a new framework that aims at "full-stack with Python, no JavaScript build." Combined with HTMX, it returns HTML fragments from the server and sidesteps the complexity of SPAs. As of May 2026 it has more than 6K GitHub stars and is growing fast.

FastHTML — HTMX-friendly full-stack

from fasthtml.common import *

app, rt = fast_app()

@rt("/")

def get():

return Titled("Users",

Form(hx_post="/users", hx_target="#list")(

Input(name="name", placeholder="name"),

Button("Add"),

),

Ul(id="list"),

)

@rt("/users")

def post(name: str):

return Li(name)

serve()

There are also full-stack frameworks like emmett, Masonite, and Reflex (formerly Pynecone), but adoption is lower than FastHTML.

16. ASGI Servers — Uvicorn · Hypercorn · Granian · Daphne

ASGI frameworks do not run themselves and have to be hosted on top of an ASGI server. The main choices in 2026 are:

| Server | Traits | Performance Tier |

|---|---|---|

| Uvicorn | Standard, uvloop + httptools | Baseline |

| Hypercorn | HTTP/2 and HTTP/3 support | Similar |

| Granian | Rust-based, gunicorn workers built in | 1.5 to 2x faster |

| Daphne | For Django Channels | Strong WebSocket support |

**Granian** (by Giovanni Barillari, the author of Emmett, 2022~) is the most interesting server. With its Rust-based core it shows 1.5 to 2x the throughput of uvicorn while supporting WSGI, ASGI, and RSGI (Rust Server Gateway Interface) all at once. Since 2025 it has become one of the officially recommended servers on PaaS platforms like fly.io, Render, and Railway.

Run FastAPI with Granian

granian --interface asgi --workers 4 --host 0.0.0.0 --port 8000 main:app

Classic Uvicorn

uvicorn main:app --workers 4 --host 0.0.0.0 --port 8000

Hypercorn (HTTP/2)

hypercorn -k uvloop --workers 4 -b 0.0.0.0:8000 main:app

On the WSGI side, **Gunicorn** (2010~) is still standard, and uWSGI is in maintenance-only mode.

17. Pydantic 2 · msgspec · attrs — Validation and Serialization

Pydantic 2 (2023) rewrote its core in Rust (`pydantic-core`), making it 5 to 50 times faster than Pydantic 1. FastAPI switched to Pydantic-2-only starting with 0.100, and Litestar, Django Ninja, and BlackSheep all support Pydantic 2 as first-class.

**msgspec** (Jim Crist-Harif, 2022~) is a strong rival to Pydantic. Based on a C extension, it is even faster than Pydantic 2 and handles MessagePack, JSON, YAML, and TOML. Litestar adopted msgspec as its default serialization engine.

Pydantic 2 vs msgspec — the same data model

from pydantic import BaseModel, EmailStr

class UserP(BaseModel):

id: int

email: EmailStr

name: str

class UserM(msgspec.Struct):

id: int

email: str

name: str

Serialization performance (1M req, M1 Pro)

Pydantic 2: ~1.2s

msgspec: ~0.4s

stdlib json: ~0.6s

attrs (2015~) is the spiritual ancestor of dataclass and is still widely used for validation-free data classes. marshmallow still hangs on in the Flask/Django context.

18. uv · Poetry · Hatch · PDM · Pixi — A New Package Management Landscape

Astral's **uv** (0.5+, 2024) has become the de facto standard in 2026. Rust-based, it is 10 to 100 times faster than pip and combines the roles of pip, pip-tools, virtualenv, pyenv, and poetry into a single binary.

Start a new project with uv

uv init my-api

cd my-api

Add dependencies

uv add fastapi uvicorn[standard] sqlalchemy pydantic

Install a Python version + create venv

uv python install 3.13

uv venv --python 3.13

Lock + sync dependencies

uv lock

uv sync

Run a script

uv run uvicorn main:app --reload

Install a tool (global)

uv tool install ruff

Poetry 1.8 (2024) is still strong, but uv's speed and simplicity are quickly eating into it. PDM, Hatch, and Rye each have their own fan bases, while Pixi (prefix.dev) is the conda-ecosystem-compatible alternative that is popular in data and ML contexts.

19. ORMs — SQLAlchemy 2 · SQLModel · Tortoise · Piccolo · Beanie

| ORM | Notes | Recommended Context |

|---|---|---|

| SQLAlchemy 2 | Standard, first-class async support | All serious SQL workloads |

| SQLModel | FastAPI author, Pydantic + SQLAlchemy | Quick start for FastAPI + SQL |

| Tortoise ORM | async-first, Django-like | Sanic/Quart contexts |

| Piccolo ORM | async, strong typing | Postgres-only |

| Beanie | MongoDB ODM | Non-RDB workloads |

| Peewee | Lightweight, synchronous | Small scripts and CLIs |

| Edgy | async, based on Tortoise | Brand new, experimental |

SQLAlchemy 2.x (2023~) has first-class async support, and its new `select()`-based API plays very well with mypy and Pyright. SQLModel lets you use the same class as both an ORM and a Pydantic model, which feels natural to FastAPI users, though complex queries eventually drop back into SQLAlchemy core.

SQLAlchemy 2 async pattern

from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine

from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column

from sqlalchemy import select

class Base(DeclarativeBase):

pass

class User(Base):

__tablename__ = "users"

id: Mapped[int] = mapped_column(primary_key=True)

email: Mapped[str]

name: Mapped[str]

engine = create_async_engine("postgresql+asyncpg://...")

async def find_by_email(db: AsyncSession, email: str) -> User | None:

stmt = select(User).where(User.email == email)

result = await db.execute(stmt)

return result.scalar_one_or_none()

20. Type Checkers and Linters — mypy · Pyright · Ruff · Pyrefly

Type checkers are at the heart of backend code quality. As of May 2026, the choices boil down to four.

- **mypy 1.13+** — PEP 484 based, the standard and the oldest tool

- **Pyright 1.1+** — Microsoft, the core of VS Code Pylance, very fast

- **Pyrefly** — Open-sourced by Meta in 2025, mypy-compatible and Rust-based

- **Ruff 0.7+** — Astral, a Rust-based linter + formatter + import-organizer in one

Ruff replaces about 90% of the features of flake8, black, isort, pyupgrade, and bandit in a single binary and runs close to 100 times faster. The standard 2026 combo is "dependency management with uv + lint and format with Ruff + type checking with Pyright."

pyproject.toml — the standard 2026 combo

[project]

name = "users-api"

requires-python = ">=3.13"

dependencies = [

"fastapi>=0.115",

"uvicorn[standard]>=0.32",

"pydantic>=2.9",

"sqlalchemy>=2.0",

]

[tool.ruff]

line-length = 100

target-version = "py313"

[tool.ruff.lint]

select = ["E", "F", "I", "B", "UP", "ASYNC"]

[tool.pyright]

pythonVersion = "3.13"

typeCheckingMode = "strict"

21. Testing — pytest 8 · pytest-asyncio · hypothesis · Locust

pytest 8 (2024) is still the standard for Python testing, and `pytest-asyncio` 0.23+ makes ASGI-app testing concise. FastAPI, Starlette, and Litestar all expose a `TestClient` (built on httpx) so you can run in-process tests.

FastAPI + pytest-asyncio + httpx TestClient

from httpx import AsyncClient, ASGITransport

from main import app

@pytest.mark.asyncio

async def test_create_user():

async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as ac:

r = await ac.post("/users", json={"email": "a@b.com", "name": "alice"})

assert r.status_code == 201

assert r.json()["email"] == "a@b.com"

**Hypothesis** is the standard for property-based testing, and **Locust** is the standard for load testing. For small scenarios, `httpx + asyncio` alone is enough.

22. Auth — Authlib · python-jose · PyJWT · Authentik · Logto

Authentication in Python backends usually splits into two layers. **Token validation libraries** (PyJWT, python-jose, Authlib) handle JWT decoding and OIDC flows, while **external identity providers** (Authentik, Authelia, Logto, Auth0, Cognito) manage users and sessions.

The standard combo for new projects in 2026 looks like this.

- **JWT validation**: PyJWT (simplest) or Authlib (when you need OIDC)

- **Session management**: Redis-backed sessions (the Starlette/Litestar middleware)

- **Identity provider**: Authentik or Logto for self-hosted, Auth0 or Clerk for SaaS

- **Authorization**: simple RBAC by hand, or OPA (Open Policy Agent) or Permit.io when it gets complex

23. Deployment — Docker · Granian · Lambda · Modal · Vercel

| Deployment Style | Recommended Stack | Notes |

|---|---|---|

| Container | Docker + Granian/Uvicorn + Gunicorn | Standard |

| Serverless | AWS Lambda + Mangum + FastAPI | Cold start around 300ms |

| AI workloads | Modal, Replicate, Beam, HF Spaces | Auto-scaling GPUs |

| Edge | Vercel Python, Cloudflare Workers Python | Beta, many constraints |

| Managed | Render, Railway, Fly.io | PaaS standard |

2026 standard FastAPI Dockerfile (uv + Granian)

FROM python:3.13-slim AS base

ENV UV_SYSTEM_PYTHON=1 PYTHONDONTWRITEBYTECODE=1

RUN pip install --no-cache-dir uv==0.5.*

WORKDIR /app

COPY pyproject.toml uv.lock ./

RUN uv sync --frozen --no-dev

COPY . .

RUN uv sync --frozen --no-dev

EXPOSE 8000

CMD ["uv", "run", "granian", "--interface", "asgi", "--workers", "4", \

"--host", "0.0.0.0", "--port", "8000", "main:app"]

Lambda deployments use the `Mangum` adapter to wrap FastAPI/Starlette as a Lambda handler. Cold start has dropped to about 0.2 to 0.4 seconds since Pydantic 2 landed, and turning on AWS SnapStart for Python (2025) can take it under 50ms.

24. Real-World Adoption — Netflix · Microsoft · NAVER · Mercari

**Netflix** has shared at the 2023 PyCon keynote that it uses FastAPI extensively for internal ML serving and orchestration. In particular, the inference gateway of the recommendation system sits on FastAPI + Pydantic 2, while the GraphQL gateway is on Starlette + Strawberry.

**Microsoft** uses FastAPI in Azure ML and parts of its OpenAI-related infrastructure. Sebastián Ramírez joining Microsoft is an extension of this same trend.

The **NAVER Search team** has adopted FastAPI for parts of its ML serving and internal tooling, and some backend teams at **Coupang** and **Kakao** also use FastAPI. **Toss** runs its core payment stack on the JVM, but it uses FastAPI for internal tooling and ML services.

In Japan, **Mercari** has adopted FastAPI in some microservices, and **LINE Yahoo**, **CyberAgent**, and **DeNA** all use it extensively in their ML and data pipelines. **Instagram** is the largest case study still running Django at its core.

25. Decision Tree — Which Framework Should You Pick

The recommended decision tree as of May 2026 looks like this.

- **I just want to build a REST API fast** → FastAPI (largest ecosystem) or Litestar (preference for structure)

- **I need full-stack, admin pages, and an ORM** → Django 5.2 + Django Ninja (new) or DRF (existing)

- **Performance is the absolute value** → Litestar + Granian, or Robyn

- **Many small microservices** → Starlette or Falcon 4

- **Async single-track with Flask style** → Sanic or Quart

- **Gradually migrate a Flask codebase to async** → Quart

- **HTML-first, avoid JS builds** → FastHTML + HTMX

- **A team coming from .NET** → BlackSheep

The center of the choice always comes down to three axes: "the paradigm the team is familiar with + the validation engine preference (Pydantic vs msgspec) + the server (Granian vs Uvicorn)."

26. Migration Guide — From Flask/Django to FastAPI/Litestar

When moving existing Flask code to ASGI, the most natural path is to move to `Quart` first and then peel off route by route into FastAPI/Litestar handlers. When moving from Django to FastAPI, instead of swapping all at once, it is safer to add an `/api/v2` endpoint with Django Ninja and migrate gradually.

Pattern for using Django + Django Ninja side by side in one project

urls.py

from django.urls import path

from ninja import NinjaAPI

from .api import api as v2_api

urlpatterns = [

path("admin/", admin.site.urls),

Keep existing DRF routes

path("api/v1/", include("legacy.urls")),

New routes go through Ninja

path("api/v2/", v2_api.urls),

]

The key to migration is "do not change everything at once." If you share the authentication middleware, session store, and DB connection pool while moving routes one by one, you can flip the whole stack in 1 to 2 months without major risk.

27. Wrapping Up — Python Backends Are Still #1 in 2026

The 2026 picture of Python backends, in one sentence, is "there are now plenty of choices." FastAPI is still the standard, but Litestar, Robyn, and Django Ninja are strong in their own corners, and Rust-based tools like Granian, uv, Pydantic 2, and msgspec are flipping the old reputation of "slow language."

For a new project, "FastAPI + Pydantic 2 + SQLAlchemy 2 + Granian + uv + Ruff + Pyright" is the safest starting point, and if performance truly is an absolute value you can take it one step further with "Litestar + msgspec + Granian." In the Django ecosystem, "Django 5.2 + Django Ninja + uv" handles full-stack the most smoothly. Python backends in 2026 are no longer "the slower alternative to Java" — they are "the first choice that is as fast as Java while taking one-quarter of the code."

References

- FastAPI official docs — https://fastapi.tiangolo.com/

- Starlette official docs — https://www.starlette.io/

- Litestar official docs — https://docs.litestar.dev/2/

- Sanic official docs — https://sanic.dev/en/

- Quart official docs — https://quart.palletsprojects.com/

- Flask official docs — https://flask.palletsprojects.com/

- Django official docs — https://docs.djangoproject.com/en/5.2/

- Django Ninja official docs — https://django-ninja.dev/

- Django REST Framework — https://www.django-rest-framework.org/

- Robyn official docs — https://robyn.tech/

- BlackSheep official docs — https://www.neoteroi.dev/blacksheep/

- Falcon official docs — https://falcon.readthedocs.io/

- FastHTML official docs — https://docs.fastht.ml/

- Pydantic 2 docs — https://docs.pydantic.dev/

- msgspec docs — https://jcristharif.com/msgspec/

- SQLAlchemy 2 docs — https://docs.sqlalchemy.org/en/20/

- SQLModel docs — https://sqlmodel.tiangolo.com/

- Granian — https://github.com/emmett-framework/granian

- Uvicorn official docs — https://www.uvicorn.org/

- uv official docs — https://docs.astral.sh/uv/

- Ruff official docs — https://docs.astral.sh/ruff/

- Pyright — https://microsoft.github.io/pyright/

- TechEmpower Round 23 — https://www.techempower.com/benchmarks/

- PEP 703 (Free-Threaded CPython) — https://peps.python.org/pep-0703/

- PEP 744 (JIT Compiler) — https://peps.python.org/pep-0744/

현재 단락 (1/353)

The Python backend landscape has completely transformed seven years after FastAPI 0.1.0 went public ...

작성 글자: 0원문 글자: 25,678작성 단락: 0/353