这是我参与「第五届青训营 」伴学笔记创作活动的第 34 天
目前函数计算在公司内涵盖了在线服务和实时数据处理服务场景,函数计算平台日均处理万亿的请求,对比业内竞品也有一定的优势。本节课将为大家重点介绍函数计算的整体概念和在字节的落地案例与应用。
Serverless

不操心扩缩容,Serverless,底层都Cover了。只用知道能够方便地使用计算资源就行了昂!!!
- Serverless是FaaS吗?区别是?
Serverless = FaaS + BaaS
- Backend As A Aervice(DB, KV微服务,统称为BaaS)
- FaaS:Function As A Service
Where is FaaS

FaaS不仅仅支持的简单的Handler,复杂的微服务也能跑的昂!!!
- Function As A Service
Evolution
IaaS -> PaaS -> FaaS

粒度不一样昂!!!
Faas Industry & Community

Comparison of FaaS Providers in 2021
x
Serverless computing history


Serverless Computing in Bytedance
Serverless能解决什么问题
- Kafka/RocketMQ/Eventbus -> FaaS -> XXX
- TLB -> FaaS (kitex, hertz)
- Mesh -> FaaS -> Mesh
- BFF/SSR -> FaaS (js, v8/wasm)
- TOS->FaaS
- Binlog -> FaaS
Bytefaas能在中间起到很多的功能处理昂!!!
- The Problem
- Building applications is hard
- Ops is painful
- Developers should focus on their business logic, with minimal ops burden
- The solution
- The next generation 1-Stop serverless computing platform
- Easy development: you only write a function, instead of the whole service
- Easy deployment: Fast build & release, in seconds
- Integration with different event source, with 1 click
- Rapidly autoscale up and down (even down to O)
- Multi language support (Go, Python, Nodejs, Java, Rust, ...
- Pay $ As You Go(按量付费,自动给你扩缩容)
Quick Demo

Service governance
- Service discovery: tlb, dns, mesh, consul
- BOE, PPE, CloudIDE, ByteFaaS CLI
- Logging, Metrics, Tracing
- Byteflow, IAM, Event Center
- SLA: BFC, Chaos, Netclass, Rhino
Bytefaas我记得我使用的时候,就是一个单独的微服务,可以自动调用去做很多事情昂!!!
字节内部Serverless的用户规模、调用情况
Current Status/Scale

Where are ByteFaaS

FaaS本质上是在TCE上跑的昂!!!
ByteFaaS Data Plane

ByteFaaS Control Plane

ByteFaaS Message Queue Triggers

Consumer和Function Instance的解耦
- Function Instance这边用户更新函数啊,上线啊,和Consumer解耦,Consumer没什么变动,用户代码上线会比较平稳昂!!!
- Consumer用比较少的计算资源,拿到了比较大的吞吐,不需要特别大的耦合。
ByteFaaS Async Mode

处求理用户的长需求昂!!!异步模式去承载长需求昂!!!
All in One -> 长任务也迁移到FaaS上面昂!!!
FaaS Native

用户可以将RPC直接跑在FaaS上。
TTHeader协议的支持 -> RPC on FaaS,Mesh的治理是成熟的昂!
FaaS Worker & Edge


轻量级的Workload,不需要关系实例,甚至不用去设置实例,就OK了hhh。边缘场景计算资源更紧张,FaaS帮助你Scalable,让你少资源。
云边一体,很好用!!!
Future Planning
-
High availability , Scalability
-
Cost optimization
-
Autoscaling intelligence
-
Best Choice for event consuming business

- PaaS -> FaaS evolution (PaaS 平稳迁移到FaaS,让用户使用体验一致)
- veFaaS

veFaaS (FaaS toB)
- FaaS worker, cloud & edge

- The Upcoming Sharing Sessions at ByteTech:
- ByteFaaS dataplane, high scalability/availability architecture, runtime standards
- ByteFaaS gateway, binary distribution system, async task, mesh ecosystem
- ByteFaaS message queue trigger, event source related topic
- veFaaS (FaaS tob at volcengine), FaaS Native
- FaaS worker, cloud and edge