Research_Department_Develop.../ADR_Template.md

25 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ADR 000X: [简短的决策标题]
* **状态**: [已提议 | 已通过 | 已废弃 | 已取代]
* **决策人**: [姓名]
* **日期**: [YYYY-MM-DD]
## 1. 背景 (Context)
*描述我们需要解决的问题是什么,以及当前的限制条件。*
*例如:当前的标书生成速度过慢(平均 5分钟因为是同步调用 LLM。并发量上来后服务器阻塞严重。*
## 2. 决策 (Decision)
*描述我们决定做什么。*
*例如:我们将引入 Celery + Redis 实现异步任务队列,将生成任务剥离出主线程。*
## 3. 备选方案 (Alternatives)
*我们还考虑了什么方案?为什么没选?*
* **方案 A**:使用 Python 原生 asyncio。
* *原因*CPU 密集型任务下 asyncio 表现不佳,且无法跨机器扩展。
* **方案 B**:使用 Kafka。
* *原因*对于当前体量Kafka 运维成本过高Redis 足够轻量。
## 4. 后果 (Consequences)
*决策带来的好处和坏处(权衡)。*
* **好**API 响应时间降至 100ms支持水平扩展 Worker 节点。
* **坏**:增加了运维 Redis 和 Celery Worker 的复杂度;调试异步任务比同步代码困难。