- Ambassador pattern
适合多个App共享一些网络功能或者不方便修改程序加入网络功能,将网络功能放入单独的进程中

- Anti-Corruption Layer pattern
老系统与新系统之间加一层转换层,避免老系统污染新系统

- Backends for Frontends pattern
为移动端或者web端搭建不同的后端,可以使不同的后端为不同的前端作优化

- Bulkhead pattern
将client请求service的资源分组,避免一类请求消耗掉所有的资源

- Cache-Aside pattern
读数据时,如果缓存里没有,就从data store里读取,然后放入缓存
写数据时,写进data store,然后invalidate缓存的数据

- Circuit Breaker pattern

- Command and Query Responsibility Segregation (CQRS) pattern
读取数据和写入数据的接口分开,读写数据的model也可以不同

- Compensating Transaction pattern
Eventual consistency is a consistency model used in distributed computing to achieve high availability that informally guarantees that, if no new updates are made to a given data item, eventually all accesses to that item will return the last updated value
为了应对Eventual consistency model中操作失败,记录每一步的操作和恢复这一步所需的操作,如果某一步失败,可以进行回滚

- Competing Consumers pattern
将耗时操作放到consumer中,通过发送message告知

- Compute Resource Consolidation pattern
将类似的任务放到同一运算单元中。避免运算单元资源的浪费

- Event Sourcing pattern
传统CRUD的缺点:
- 所有操作都在同一数据集上操作,会导致性能下降
- 数据更新操作有可能会冲突
- 没有历史数据
Event source 将对数据的操作记录到Event store中,然后通知订阅者去执行每个event对应的操作

- External Configuration Store pattern
多个应用实例要共享配置信息时,配置应该单独保存在配置服务器上

- Federated Identity pattern
用户系统应该使用外部提供的服务

- Gatekeeper pattern
提供公共接口的部分和访问内部资源部分要分开,提供公共接口的部分做gatekeeper

- Gateway Aggregation pattern
如果一个客户端要请求多个backend,可以每个请求合并成一个,改善请求性能

- Gateway Offloading pattern
将一些公共的服务抽取到GateWay中,统一让gateway处理

- Gateway Routing pattern
当client需要访问多个service时,让gateway充当唯一的endpoint,由gateway将请求route到对应的service

- Health Endpoint Monitoring pattern
服务应该提供一个endpoint供外部访问,提供自己的health check result

- Index Table pattern
对于no sql数据库,这种不支持index的数据库,可以自己创建index table

- Leader Election pattern
在使用分布式系统进行任务处理时,需要推选一位Leader,进行任务的协调。
- Materialized View pattern
data store中的数据可能不适合于查询,提前生成适合于查询的视图以加速查询

- Pipes and Filters pattern
将复杂任务分解成多个可以被复用的子任务。使得每个子任务可以独立的deploy和scale

- Queue-Based Load Leveling pattern
用队列作为请求和处理的缓冲,以削平请求波峰

- Retry pattern
当请求服务失败时,进行重试
- 取消重试: 如果错误是不可恢复的或者重试也不太可能成功的,取消重试
- 重试: 如果是短暂或者不常见的错误,立即重试
- 一定延迟后的重试:如果是服务繁忙,则在一定延迟后重试,重试间隔要使其他重试的client均匀分布,避免使本来繁忙的server更加繁忙
- Scheduler Agent Supervisor pattern
-
Scheduler: 协调一个task中不同step的运行,将step的状态保存到state store中。
-
Agent: 执行远程服务连接
-
Supervisor:监控各个step的运行状态,执行fail的step或者整个task的恢复

网友评论