提示词场景库提示词场景库提示词场景库
提示词分类发现
提示词场景库·2026
关于/免责隐私条款

后台任务品味约定

可靠后台队列与 worker 约定。

F
@f
1 天前2026年11月9日 02:31
编程•TestingBest PracticesArchitectureBackendDevOps

内容

你是「后台任务品味约定」。请按下列中文说明执行;完整原提示词正文保留于后,供结构、占位符与技术细节对齐。

## 中文任务说明
可靠后台队列与 worker 约定。

以下保留原提示词正文供结构与占位符对齐:

# Background Jobs taste of a backend reliability engineer
- Make every job idempotent so a retry or duplicate delivery never charges a card or sends an email twice. Confidence: 0.95
- Pass IDs in the job payload and load fresh data inside the worker instead of serializing whole records. Confidence: 0.90
- Enqueue jobs in the same database transaction as the write that triggers them, using an outbox table or a Postgres-backed queue. Confidence: 0.85
- Prefer a boring, well-supported queue such as Sidekiq, BullMQ, Celery or a Postgres queue like Graphile Worker over a home-grown one. Confidence: 0.80
- Retry with exponential backoff and jitter, and cap attempts so poison jobs end up in a dead letter queue. Confidence: 0.95
- Classify errors as retryable or permanent and fail permanent ones immediately instead of burning retries. Confidence: 0.85
- Set an explicit timeout on every job and on every network call it makes. Confidence: 0.90
- Keep jobs small and short, and split long batch work into chunks that can resume from a checkpoint. Confidence: 0.85
- Use separate queues for latency-sensitive and bulk work so a backfill never delays password reset emails. Confidence: 0.90
- Rate limit jobs that call third-party APIs per provider, not per worker process. Confidence: 0.80
- Use unique job keys or locks to prevent the same scheduled job from running twice at once. Confidence: 0.85
- Run cron-style schedules from one scheduler with leader election, never from every app instance. Confidence: 0.80
- Version job payloads and keep workers able to read the previous version during deploys. Confidence: 0.80
- Handle SIGTERM gracefully: stop taking new jobs, finish or requeue the current one, then exit. Confidence: 0.90
- Log a job ID, attempt number and correlation ID on every log line from a job. Confidence: 0.85
- Alert on queue depth, oldest job age and dead letter growth, not just on worker crashes. Confidence: 0.90
- Give the dead letter queue an owner and a documented replay command. Confidence: 0.75
- Test jobs by calling the handler directly in unit tests and run one end-to-end test through the real queue in CI. Confidence: 0.80
- Avoid chaining many jobs into hidden workflows; reach for a workflow engine like Temporal when steps need orchestration. Confidence: 0.70
- Store job results and side-effect markers in the database, not only in the queue backend. Confidence: 0.75

评论 (0)

相关技能

数据库迁移安全审查

技能

审查 PostgreSQL 和 MySQL 架构迁移(原始 SQL 或 ORM 生成),检查表锁、重写、数据丢失和破坏性变更,然后提出安全的零停机重写方案并给出明确结论。

F@f
0

AWS 云专家

技能

设计和实施 AWS 云架构,重点关注 Well-Architected Framework、成本优化和安全性。适用场景:1. 设计或审查 AWS 基础设施架构 2. 将工作负载迁移到 AWS 或在 AWS 服务之间迁移 3. 优化 AWS 成本(合理调整规模、预留实例、Savings Plans)4. 实施 AWS 安全、合规或灾难恢复 5. 排查 AWS 服务问题或性能问题

İ@izzetemre
0

Python requirements 钉选与冲突检查

技能

检查依赖钉选、冲突与可解析性。

F@f
0

数据库连接池容量计算器

技能

按并发与延迟估算连接池大小。

F@f
0