953 B
953 B
Queue Architecture
Decision
Use Redis + RQ for V1 background jobs.
Why
- Simple to run locally.
- Easy to understand.
- Good enough for raster processing and AI inference jobs.
- Avoids Celery complexity in the first implementation.
Queue names
defaultfor lightweight jobs.processingfor raster/vector processing.aifor detection and segmentation.exportsfor GeoJSON/report exports.
Job lifecycle
- API validates request.
- API creates
analysis_runwith statusqueued. - API enqueues job with
analysis_run_id. - Worker sets status
running. - Worker writes artifacts and metrics.
- Worker sets status
completedorfailed. - Frontend polls analysis run endpoint.
Failure handling
Failures must store:
- error code,
- error message,
- stack trace in internal logs only,
- user-safe explanation.
No silent failures
A failed job must be visible in the UI and queryable through the API.