自己挖坑自己埋

Java85

谨用于记录自己在设计时由于考虑不周导致的隐患,阿门。

2021-07-19

新近上线了《智能串接》功能,该功能类似于各种工程项目中的quickStart功能,在该模块设计时留下了两个弊端。

一是部分无效数据被持久化了。

创建考试/每日学练时,用户还未最终确认,但是已经将其所选内容写入mysql数据库,导致部分数据可能是无效数据。

这些可能是本可以保存在缓存中的临时数据的内容,但当时考虑到缓存的到期时间和访问数据的便利性,我们还是选择了持久化。

[En]

These may be the contents of temporary data that could have been saved in the cache, but at that time, considering the expiration time of the cache and the convenience of accessing the data, we still chose to persist it.

此处尚可待商榷,因为这部分数据由于可以被多次部分修改,若将其置于redis中,则对其进行部分更新时比较棘手。

二是性能无法预估与限制

由于可以选择高级模块[任务],并且任务中包含多少个基本模块没有限制,因此在选择主题时无法预测性能压力或限制用户操作。

[En]

Because the advanced module [task] can be selected, and there is no limit on how many basic modules are contained in the task, it is impossible to predict the performance pressure or restrict the user operation when selecting the topic.

目前仅对有超过300条考试结果的【考试】做了并发处理,包括任务中的这种考试。
然而,这种两层线程池方案只能缓解用户操作后的部分压力,但仍然无法提前约束用户的操作。

[En]

However, this two-tier thread pool scheme can only relieve some of the pressure after the user's operation, but it is still unable to restrict the user's operation in advance.

输入验证码查看隐藏内容

扫描二维码关注本站微信公众号 Johngo学长
或者在微信里搜索 Johngo学长
回复 svip 获取验证码
wechat Johngo学长