Guide ref
References
Curated links for the FastAPI production checklist and guides. Prefer official docs over random blog posts when implementing.
FastAPI and Python
- FastAPI documentation
- FastAPI Advanced Middleware
- FastAPI Background Tasks
- Pydantic Settings
- SQLAlchemy 2.0 asyncio
- Alembic
ASGI and deploy
Brokers
Job and messaging frameworks
Patterns
Security and ops
This repository (in-app)
| Guide | Path |
|---|---|
| Async vs jobs | /docs/01-async-vs-jobs |
| Brokers | /docs/02-brokers-celery-redis-rabbitmq-kafka |
| Job lifecycle | /docs/03-job-lifecycle-and-schema |
| Outbox / inbox | /docs/04-outbox-inbox-idempotency |
| Celery example | /docs/05-celery-rabbitmq-example |
| Taskiq example | /docs/06-taskiq-rabbitmq-example |
| Dramatiq example | /docs/07-dramatiq-rabbitmq-example |
| FastStream / Kafka | /docs/08-faststream-kafka-example |
| Errors / DLQ | /docs/09-error-taxonomy-retries-dlq |
| Testing | /docs/10-testing-workers |
| Event-driven design | /docs/11-event-driven-system-design |
| DDD with FastAPI | /docs/12-ddd-with-fastapi |
| Laravel queues → FastAPI | /docs/13-laravel-queues-to-fastapi |
| Celery Beat scheduling | /docs/14-celery-beat-scheduling |
| Observability & Flower | /docs/15-observability-metrics-flower |
| Locks & rate limits | /docs/16-locks-and-rate-limits |
| Celery RL + lock pipeline | /docs/17-celery-rate-limit-lock-pipeline |
| Monitoring Celery with Flower | /docs/18-monitoring-celery-flower |
| Flower + Prometheus | /docs/19-flower-prometheus |
Creator
Implementation recipes
Celery pipeline (API RL → enqueue → RabbitMQ → job RL + lock → side effect)
| Step | Implementation |
|---|---|
| API rate limit | FastAPI dependency + Redis fixed window / token bucket → HTTP 429 |
| Enqueue | Insert jobs row → task.apply_async(..., queue="jobs.io") (Celery → RabbitMQ) |
| Job rate limit | Redis token bucket at start of Celery task; self.retry(countdown=…) if empty |
| Entity lock | Redis SET key token NX EX ttl; work; Lua release if token matches |
| Side effect | Vendor/DB call inside lock; mark job succeeded/failed in DB |
| Product status | GET /jobs/{id} from DB : not Flower |
Full walkthrough with code: Celery RL + lock pipeline
text
API rate limit → enqueue → RabbitMQ
↓
job rate limit + entity lock → side effectConcepts: Locks and rate limits Celery wiring: Celery + RabbitMQ example Retries / DLQ: Error taxonomy
Official Celery references
- Celery tasks
- Retrying
- Task.rate_limit (per-worker; prefer Redis for multi-worker fairness)
- Routing
- Monitoring
- Flower
Flower and Celery monitoring
| Resource | Use |
|---|---|
| Monitoring Celery with Flower | Run Flower, events (-E), security, what to watch |
| Observability & metrics | Health, JSON logs, SLOs, alert severities |
| Flower docs | Upstream project |
| Celery monitoring | Events, inspect, dumps |
Reminder: Flower = ops UI only. User-facing job status = application jobs table.
Prometheus
- Prometheus configuration
- Prometheus basic auth scrape
- RabbitMQ Prometheus
- In-app: Flower + Prometheus integration
Architecture diagrams
In-app SVG diagrams use CSS variables and work in light and dark themes:
| Diagram id | Topic |
|---|---|
system-overview | API, workers, Beat, Flower, brokers |
celery-pipeline | API RL → enqueue → RMQ → job RL + lock |
locks-rate-limits | Redis locks and rate limits |
outbox | Transactional outbox |
observability | Flower + Prometheus |
Embed in guides as:
`markdown
Browse all on /docs.
Sitemap
Canonical index: `/sitemap.xml`. Declared in `/robots.txt`.
| Path | Priority | Change frequency | Last modified |
|---|---|---|---|
/ | 1.00 | weekly | 2026-08-05 |
/docs | 0.95 | weekly | 2026-08-05 |
/docs/01-async-vs-jobs | 0.80 | weekly | 2026-08-05 |
/docs/02-brokers-celery-redis-rabbitmq-kafka | 0.80 | weekly | 2026-08-05 |
/docs/03-job-lifecycle-and-schema | 0.80 | weekly | 2026-08-05 |
/docs/04-outbox-inbox-idempotency | 0.80 | weekly | 2026-08-05 |
/docs/05-celery-rabbitmq-example | 0.80 | weekly | 2026-08-05 |
/docs/06-taskiq-rabbitmq-example | 0.80 | weekly | 2026-08-05 |
/docs/07-dramatiq-rabbitmq-example | 0.80 | weekly | 2026-08-05 |
/docs/08-faststream-kafka-example | 0.80 | weekly | 2026-08-05 |
/docs/09-error-taxonomy-retries-dlq | 0.80 | weekly | 2026-08-05 |
/docs/10-testing-workers | 0.80 | weekly | 2026-08-05 |
/docs/11-event-driven-system-design | 0.80 | weekly | 2026-08-05 |
/docs/12-ddd-with-fastapi | 0.80 | weekly | 2026-08-05 |
/docs/13-laravel-queues-to-fastapi | 0.80 | weekly | 2026-08-05 |
/docs/14-celery-beat-scheduling | 0.80 | weekly | 2026-08-05 |
/docs/15-observability-metrics-flower | 0.80 | weekly | 2026-08-05 |
/docs/16-locks-and-rate-limits | 0.80 | weekly | 2026-08-05 |
/docs/17-celery-rate-limit-lock-pipeline | 0.80 | weekly | 2026-08-05 |
/docs/18-monitoring-celery-flower | 0.80 | weekly | 2026-08-05 |
/docs/19-flower-prometheus | 0.80 | weekly | 2026-08-05 |
/docs/REFERENCES | 0.75 | weekly | 2026-08-05 |
/llms.txt | 0.70 | weekly | 2026-08-05 |
/llms-full.txt | 0.85 | weekly | 2026-08-05 |
Priority guide
| Priority | Meaning |
|---|---|
| 1.00 | Home (primary entry) |
| 0.95 | Docs hub |
| 0.80 | Numbered production guides |
| 0.75 | References index |
| 0.85 | Full LLM corpus (llms-full.txt) |
| 0.70 | Short LLM index (llms.txt) |
Not listed: /login (noindex), /api/*, /auth/*.
Regenerate: node scripts/generate-sitemap.mjs