You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
buffer_platform/openspec/changes/config-to-mysql/.comet/handoff/brainstorm-summary.md

932 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

Brainstorm Summary

确认的技术方案

采用方案:单表键值对 + 统一配置模块 + JSON fallback

组件 说明
app/models.py 新增 AppConfig 模型
app/config_store.py 统一配置读写入口
app/config_migration.py JSON → MySQL 迁移脚本
JSON 文件 降级方案,保留原路径

关键取舍与风险

取舍 决策
单表 vs 多表 单表,通过 config_key 区分,未来扩展无需改表
是否使用 Redis 不使用,按用户要求仅 MySQL
是否保留文件 保留,作为 MySQL 不可用时的降级
写入策略 双写MySQL 可用时写数据库 + 写文件MySQL 不可用时只写文件

测试策略

  • 单元测试:tests/test_config_store.py 覆盖读取、写入、降级
  • 迁移测试:验证幂等性
  • 回归测试:全部测试套件

Spec Patch