我的 Serverless 实战 — 理解Serverless概念、和传统开发模式区别以及优缺点

【本文正在参与“100%有奖|我的Serverless 实战”征稿活动】

页面活动链接 https://marketing.csdn.net/p/15940c87f66c68188cfe5228cf4a0c3f

前言

Serverless并不是说没有服务,而是作为开发者不需要去管服务器相关的东西,比如配置、带宽、负载。

开发者只需要关注功能实现,把服务托管出去,按使用量支付服务相关费用,做到Serverless。

什么是Serverless

关于最早概念的起源,建议阅读这篇文章

https://martinfowler.com/articles/serverless.html

Serverless architectures are application designs that incorporate third-party “Backend as a Service” (BaaS) services, and/or that include custom code run in managed, ephemeral containers on a “Functions as a Service” (FaaS) platform. By using these ideas, and related ones like single-page applications, such architectures remove much of the need for a traditional always-on server component. Serverless architectures may benefit from significantly reduced operational cost, complexity, and engineering lead time, at a cost of increased reliance on vendor dependencies and comparatively immature supporting services.

这篇文章详细讲了Serverless的概念和优缺点,我下面通过自己的理解描述下,如果想要更完整地理解,还是推荐阅读原文。

概念

服务器的管理交给第三方平台,开发者不维护服务器。

后端即服务(Baas) + 函数即服务(Faas)

优点

  • 专注业务开发
  • 服务器费用避免闲时浪费

缺点

  • 更加依赖服务提供商
  • 安全问题
  • 迁移到其他服务提供商成本大幅度增加
  • 增加了测试难度

与传统互联网公司开发模式的区别

目前现代互联网公司也在广泛使用Baas模式的服务,比如CDN、防火墙等,所以Serverless的区别还是在Faas的方面。

传统互联网模式

  • 服务器运行项目,比如 nginx 。
  • 代码托管代码库,比如 gitlab 。
  • 使用第三方服务,比如 COS文件存储、CDN 。

Serverless模式

  • 使用第三方服务,比如 COS文件存储、CDN 。
  • 使用Faas服务,托管业务相关代码
  • 使用并依赖网关服务,分发请求
  • 使用并依赖监控服务,监控运行状况和日志

现有的Faas函数即服务

腾讯云 云函数 SCF

在这里插入图片描述

腾讯云的SCF就是Faas的核心部分,实现了云函数的运行部署。

再结合腾讯云的其他服务,我们就能构建出一套Serverless的架构。

阿里云 FC

在这里插入图片描述

亚马逊 AWS Lambda

在这里插入图片描述

openfaas/faas

和上面不同的是,openfaas是开源项目。
在这里插入图片描述

总结

本文主要是认识Serverless,理解必要性和重要性,并列出几个现有的Faas服务提供商。

本系列持续更新,后续会更新

  • Faas项目的完整部署

参考资料

  • https://github.com/openfaas/faas
  • https://martinfowler.com/articles/serverless.html
  • https://aws.amazon.com/cn/lambda/
  • https://serverless.cloud.tencent.com/
  • https://github.com/openfaas/faas
  • https://www.openfaas.com/
  • https://www.aliyun.com/product/fc
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小雨青年

程序员可以把咖啡转化成代码~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值