Overview
新一代的application event drive架构方式1, 实例扩展透明.
之前的方式更多的是整包部署到instances, 然后通过proxy将其restful接口暴露以供调用.
而sl把服务分割成不同功能的functions. 每个function deploy到sl上去, 然后根据不同的event来sequence trigger, 免去了好多infra运维和桥接工作. 让client可以focus在application层面.
- 公有云: 实现其提供的function2
- 私有云: 可以base on一些open source的serverless framework来构建自己的sl服务4,5
Breakdown
openwhisk
OpenWhisk components, credit: apache
一个function的被调用过程大概是,
- query comes to nginx
- query comes to controller
- 通过db做出认证与授权, 识别action
- 通过db获取action
- load balance分发action到相应invoker
- invoker是Docker container模式
- 一个action被调用, 都会起一个container, 调用结束再destroy container(重点优化地方? 每次action-call都是container级别而不是线程/进程级别的renew, 这样会不会很heavy?)
- 执行完结果存放到db
- kafka
- 解耦query与invoker, 默认使用async方式, 一个call send query, 一个call get the result from db through
activationId
- 解耦query与invoker, 默认使用async方式, 一个call send query, 一个call get the result from db through
- db
- 存放action, auth等metadata
- 存放query的返回result
kubeless
- Kubeless uses a Custom Resource Definition to be able to create functions as custom kubernetes resources
- It then runs an in-cluster controller that watches these custom resources and launches runtimes on-demand
- The controller dynamically injects the functions code into the runtimes and make them available over HTTP or via a PubSub mechanism
Reference
PREVIOUS卡梅拉架构一体化
NEXTdatalake关注点