Write-Buffering to the Database
summary
A system replaces frequent per-stage PostgreSQL updates with local Redis buffering to batch-write work: either Redis hashes (one key per stage) or Redis lists (one list per indexing job) collect updates, a periodic Celery worker aggregates them and performs atomic DB updates, and housekeeping removes stale keys. This reduces about four writes per stage to roughly one, raising throughput for millions/tens of millions of indexing tasks, at the cost of eventual consistency, possible key bloat, and rare data loss.
AI-written summary · about
