micro-analytics / micro-analytics/micro-analytics-cli
atomicity and db operation concerns
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 732
- 派生
- 39
- PR 合并指标
- 30 天内没有已合并 PR
描述
So as a few people have brought up, we are mimicking locking in our pushView util function which seems to be doing the db adapter's job. For example, if a db solution supports a "add or increment" function or handles atomicity cross process, then we are introducing a performance bottleneck by having all adapters use our locks logic and 2-3 transaction inserts. For the record, I think it was a really good starting point but we should take it to the next level.
So, I think that the next phase of our adaptors, while there are only two, need to support the API that we provided but the put needs to be changed. If they need to manually call their this.has() and this.get() to reconcile what they need to do, then go for it, but we shouldn't force that. So we should change put (or possibly rename it) but we should give them the key and they need to resolve a promise with the count value.
What do you think?
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
先阅读 pushView 工具和两个数据库适配器,然后跟踪它们当前的 put 操作如何执行 has/get 检查、锁定和事务插入。确定面向适配器的 put 契约,包括它如何接收 key 以及如何解析 count,同时在需要时保留现有 API。完成的标准是两个适配器都支持约定的原子操作行为,且无需强制共享锁。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, node.js
- 领域
- backend, databases
- Issue 类型
- 重构
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100