gorse v0.4.0 版本更新介绍
发布日期: 2022-04-10
版本号: v0.4.0
本次更新新增对MongoDB、MySQL和PostgreSQL作为缓存存储的支持。修复了Swagger文档拼写错误、统一ClickHouse时区设置、解决PostgreSQL重复缓存行插入及时间戳修改问题。性能方面大幅优化用户/项目/反馈数据插入速度,经测试MySQL环境下插入千条用户数据耗时从75ms降至38ms,项目数据从324ms缩短至32ms,反馈数据从248ms减少到42ms。注意事项包含采用新版配置文件规范,原无时间单位的"write-back-delay"参数现需添加时间单位(如10m表示十分钟),相关API调用需相应调整参数格式。
更新内容 (中文)
新功能
- 支持将 MongoDB 作为
cache_store
使用(#406) - 支持将 MySQL 作为
cache_store
使用(#415) - 支持将 PostgreSQL 作为
cache_store
使用(#414)
修复
- 修复 Swagger 规范中的拼写错误(#405)由 @europaer 贡献
- 统一 ClickHouse 时区设置(#417)
- 修复 PostgreSQL 中插入重复缓存行的问题(#417)
- 修复项目时间戳修改问题(#417)
性能优化
- 优化用户/项目/反馈的插入性能(#411)
操作 | 缓存 | 数据库 | 优化前 | 优化后 |
---|---|---|---|---|
插入 1000 个用户 | Redis | MySQL | 75ms | 38ms |
插入 1000 个项目 | Redis | MySQL | 324ms | 32ms |
插入 1000 条反馈 | Redis | MySQL | 248ms | 42ms |
重大变更
- 新版配置文件规范 及默认值已在 v0.4.0 引入(#418)
GET /api/recommend/{user-id}
的write-back-delay
参数现在需要明确时间单位,例如:
curl -X GET "http://172.18.0.3:8087/api/recommend/zhenghaoz?write-back-type=read&write-back-delay=10m&n=10" \
-H "accept: application/json" \
-H "X-API-Key: 19260817"
更新内容 (原始)
Features
- Support MongoDB as
cache_store
(#406). - Support MySQL as
cache_store
(#415). - Support PostgresSQL as
cache_store
(#414).
Fix
- Fix typos in Swagger spec (#405) by @europaer.
- Unify timezone in ClickHouse (#417).
- Fix inserting duplicate cache rows in Postgres (#417).
- Fix item timestamp modification (#417).
Performance
- Optimize inserting users/items/feedbacks (#411).
Action | Cache | Data | Before | After |
---|---|---|---|---|
Insert 1,000 users | Redis | MySQL | 75ms | 38ms |
Insert 1,000 items | Redis | MySQL | 324ms | 32ms |
Insert 1,000 feedbacks | Redis | MySQL | 248ms | 42ms |
BREAK CHANGES
- New config file specification and default values are introduced in v0.4.0 (#418).
- The
write-back-delay
parameter ofGET /api/recommend/{user-id}
requires time unit now. For example:
curl -X GET "http://172.18.0.3:8087/api/recommend/zhenghaoz?write-back-type=read&write-back-delay=10m&n=10" \
-H "accept: application/json" \
-H "X-API-Key: 19260817"