>_devkit
fastapi-backend
skills/fastapi-backend/

references/sources.md

Sources and further reading

Practices in this skill were cross-checked against the following, plus the official documentation. Where guidance conflicted, the official docs and the concurrency material won.

Concurrency (the async rules)

The async def versus def guidance, the threadpool default of roughly 40, and the "one blocking call collapses concurrency" failure mode come from:

Structure and layering

The router / service / repository split and feature-first grouping:

Testing

ASGITransport, dependency overrides, containerised databases, and the testcontainers alternative:

Observability

Request ids, JSON logs, the adoption order, and OpenTelemetry:

Deployment

A note on the guidance that is not from these

Several specifics here come from operating services rather than from the articles above, and are the parts most worth arguing with:

  • Migrations must not run in lifespan. Widely done, and it is a race as

soon as there is more than one replica.

  • Liveness must not check the database. Conflating the two probes turns a

brief database blip into a full restart storm.

  • Integration-heavy rather than unit-heavy. This inverts the usual pyramid.

It is right for services that are mostly HTTP-to-database glue, and wrong for a library or a computation-heavy domain.

  • Authorization tests for every endpoint. Rarely mentioned in structure

guides; consistently the gap that matters.