当前位置:网站首页>Workflow番外篇
Workflow番外篇
2022-07-31 04:55:00 【話吥哆先森丶】
举个栗子
一个用户注册了一个试用期的订阅,超过试用期未取消则需要收费,最多收X个月,且需要发送邮件告诉用户收费标准及随时取消订阅。
分析
业务不难,但必须确保业务流程具有容错性和可伸缩性
解决办法
1、定期轮询数据库,执行必要操作,更新状态
- 下游系统不可用时,变更状态频繁
- 产品收费失败
- 邮件失败
- 失败后重试时间过长
- 需要有逻辑来处理损坏的客户记录,以避免阻塞整个流程
- 数据库有性能和可伸缩性限制(最终需要分片),对于需要不断轮询的场景来说效率不高
2、排队系统(计时器+队列)有更新,则推送到队列中
- 计时器和队列见无事务,模型复杂
3、Temporal
- Temporal封装了整个业务逻辑,无第三方系统即可保证持久性及容错性
边栏推荐
- 30 Years of Open Source Community | 2022 Open Atom Global Open Source Summit 30 Years of Open Source Community Special Event Held Successfully
- Mysql application cannot find my.ini file after installation
- 【ORACLE Explain 详解】
- Error EPERM operation not permitted, mkdir 'Dsoftwarenodejsnode_cache_cacach Two solutions
- [debug highlights] Expected input batch_size (1) to match target batch_size (0)
- Centos7 install mysql5.7 steps (graphical version)
- input输入框展示两位小数之precision
- 矩池云快速安装torch-sparse、torch-geometric等包
- npm、nrm两种方式查看源和切换镜像
- MySQL数据库增删改查(基础操作命令详解)
猜你喜欢
PWN ROP
MySQL数据库增删改查(基础操作命令详解)
Unity框架设计系列:Unity 如何设计网络框架
mysql uses on duplicate key update to update data in batches
Mysql application cannot find my.ini file after installation
Minesweeper game - C language
聚变云原生,赋能新里程 | 2022开放原子全球开源峰会云原生分论坛圆满召开
Unity手机游戏性能优化系列:针对CPU端的性能调优
Error EPERM operation not permitted, mkdir ‘Dsoftwarenodejsnode_cache_cacach两种解决办法
行业落地呈现新进展 | 2022开放原子全球开源峰会OpenAtom OpenHarmony分论坛圆满召开
随机推荐
What are the advantages and disadvantages of Unity shader forge and the built-in shader graph?
ERP Production Operation Control Kingdee
ENSP, VLAN division, static routing, comprehensive configuration of Layer 3 switches
The 15th day of the special assault version of the sword offer
【C语言】操作符详解
SQL row-column conversion
Three oj questions on leetcode
简易网络文件拷贝的C实现
[Detailed explanation of ORACLE Explain]
prompt.ml/15中<svg>标签使用解释
MySQL forgot password
C Implementation of Simple Network File Copy
sql statement - how to query data in another table based on the data in one table
MySQL数据库增删改查(基础操作命令详解)
【wpf】wpf中的那些模板之深度解析
Unity URP渲染管线摄像机核心机制剖析
MySQL常见面试题汇总(建议收藏!!!)
mysql使用on duplicate key update批量更新数据
MySQL optimization slow log query
Visual studio shortcuts that improve efficiency, summary (updated from time to time)