When we talk Serverless you should know

S001

Author | Yang Zeqiang (Zhu Jian) ​​Ali cloud technology experts

Speaking of the hottest current technology, the latest addition to the block chain, AI, there is a concept I must mention the Serverless. Serverless as a new Internet architecture, directly or indirectly, to promote the development of cloud computing, Lambda from AWS to function Ali cloud computing, Serverless singing all the way, but based on lightweight Serverless calculations begin the login stage of cloud computing, this article from two expand the sections:

  1. History and circumstances Serverless introduce the concept and thinking of the future;
  2. The concept and the status quo Serverless Container.

First, talk Serverless

Serverless previously mentioned is a new Internet architecture, there is currently no authoritative definition of official can be considered:

Serverless serverless architecture is an Internet-based system, which does not use conventional application development service process. Instead, they rely solely on third-party services (such as AWS Lambda services), a combination of logic and client service hosted remote procedure calls.

AWS Lambda as a Serverless first frame product, launched in 2014 by the Amazon, but the earliest Serverless concept is not made by Amazon, let's talk about simple Serverless history.

Serverless history

S002

Beginning of the beginning

2012 Vice President cloud infrastructure service provider Iron.io of Ken made the future of software  , first proposed Serverless concept , the following is an excerpt of the original:

Even with the rise of cloud computing, the world still revolves around servers. That won’t last, though. Cloud apps are moving into a serverless world, and that will bring big implications for the creation and distribution of software and applications.

初出茅庐

AWS Lambda 产品的发布可以认为是 Serverless 的里程碑,在此之前 Serverless 几乎是停留在概念期,直到 14 年 Lambda 发布,让“Serverless”提高到一个全新的层面,为云中运行的应用程序提供了一种全新的系统体系架构,**Serverless 开始正式走向云计算的舞台。

崭露头角

在 AWS 发布 Lambda 之后,众多 IaaS 及 Pass 厂商争相入市,Google Cloud FunctionsAzure FuncionsIBM OpenWhisk阿里云函数计算短短数年时间 Serverless 产品已遍地开花。

未来已来

随着容器技术、IoT、5G、区块链等技术的快速发展, 技术上对去中心化,轻量虚拟化,细粒度计算等技术需求愈发强烈,而 Serverless 必将借势迅速发展,未来 Serverless 将在云计算的舞台上大放异彩!

云计算发展看 Serverless

首先,抛一个总结性观点:云计算的发展从IaaS、PaaS、SaaS,到最新的 BaaS、FasS,在这个趋势中 serverless (去服务器化)越来越明显,而 Serveless 的完善带给云计算将会是一次完美进化!
S003

众所周知,云计算经历了从 IDC -> IaaS -> PaaS -> Serverless/FaaS 的发展历程,下面对这些概念做一些基本介绍。

IaaS

S004

IaaS(Infrastructure as a Service) 基础设施即服务,服务商提供底层/物理层基础设施资源(服务器,数据中心,环境控制,电源,服务器机房),用户需要通过 IaaS 提供的服务平台购买虚拟资源,选择操作系统、安装软件、部署程序、监控应用。

目前知名的 IaaS 平台有 AWS、Azure、Google Cloud Plantform、阿里云以及开源的 OpenStack 等。

PaaS

S005

PaaS (Platform as a Service) 平台即服务,服务商提供基础设施底层服务,提供操作系统(Windows,Linux)、数据库服务器、Web 服务器、负载均衡器和其他中间件,相对于 IaaS 客户仅仅需要自己控制上层的应用程序部署与应用托管的环境。

目前知名的 PaaS 平台有 Amazon Elastic Beanstalk,Azure,Google App Engine,VMware Cloud Foundry 等。

SaaS

SaaS (Software as a Service) 软件即服务, 服务商提供基于软件的解决方案,如 OA、CRM、MIS、ERP、HRM、CM、Office 365、iCloud 等,客户不需考虑任何形式的专业技术知识,只需要通过服务商平台获取软件使用即可。

S006

BaaS

BaaS (Backend as a Service) 后端即服务,服务商为客户(开发者)提供整合云后端的服务,如提供文件存储、数据存储、推送服务、身份验证服务等功能,以帮助开发者快速开发应用。

FaaS

FaaS (Function as a Service) 函数即服务,服务商提供一个平台,允许客户开发、运行和管理应用程序功能,而无需构建和维护基础架构。 按照此模型构建应用程序是实现“无服务器”体系结构的一种方式,通常在构建微服务应用程序时使用。

IaaS、PaaS、FaaS 对比

举个例子,比如小明想开一个水果店:

  • IDC:如果盖房子,装修、上架水果这些工作都是小明自己来做;
  • IaaS:如果小明房子是租的,装修、上架水果是自己做;
  • PaaS: 如果小明房子是租的,可是房子已经装修好了,但是上架水果要自己来做;
  • FaaS:如果有一个商家提供装修好的水果店,小明只负责把水果送过来,其余上架工作都由商家来做。

总结

从 IDC → IaaS,用户不用关注真实的物理资源。
从 IaaS → PaaS,用户不再关注操作系统,数据库,中间件等基础软件。

从 PaaS → BaaS/FaaS, 用户可以很少甚至不用关注 backend,app 可以简化为一个单页面程序。

可以说,Serverless 是云计算发展到一定阶段的必然产物,云计算作为普惠科技,发展到最后一定是绿色科技(最大程度利用资源,减少空闲资源浪费)、大众科技(成本低,包括学习成本及使用成本)的产品,而 Serverless 将很好的诠释这些!

Serverless/FaaS 模型

Serverless 是基于事件驱动的编程范型,其底层的计算平台一般为轻量计算,比如容器计算 Docker。

针对该模型本文不再赘述, 下面以 AWS Lambda 及阿里云函数计算为例,简单介绍该模型。

AWS Lambda

S007

大致流程如下:

  1. UI 驱动,通过模拟鼠标点击触发事件;
  2. 当触发事件增多时,lambda 实例自动扩容;
  3. 当触发事件减少时,lambda 实例自动缩容。

阿里云函数计算

S008

流程大致如下:

  1. UI/Event/Message Driven 触发事件;
  2. 用户 Function 会 package 为一个 docker 镜像;
  3. 事件调度系统配合 Docker 集群运行 Docker 容器来执行 Function 

Serverless 价值与影响

低成本

  • 运营成本,Serverless 将用户的服务器、数据库、中间件委托于 BaaS/FaaS,用户将不再参与基础设施及软件的维护,尤其在大规模的集群运营上成本大幅度降低;
  • 开发成本,对比 IaaS 或者 PaaS 平台的服务器或者操作系统,Serverless 的架构中,用户操作的是服务化的组件比如存储服务,授权服务等,可以缩短开发周期,降低开发难度。

真正的按需计费

Serverless/FaaS 区别于 IaaS/PaaS 预先分配计算资源的计费方式,其计费方式通常是按请求次数及运行时间,一方面可以最大程度利用资源,另一方面真正的按需计费降低用户的资源成本。

高扩展

Serverless 架构一个显而易见的优点即“横向扩展是完全自动的、有弹性的、且由服务提供者所管理”。

“绿色”计算

据统计,商业和企业数据中心的典型服务器仅提供 5%~15% 的平均最大处理能力的输出,本质上这是对社会资源的一种浪费。而在 Serverless 架构下,提供商将提供更细力度的计算能力,最大限度满足实时需求,资源利用率将大幅度提升,可以认为相对 IaaS 与 PaaS,Serverless/FaaS 是一种 “绿色” 计算。

NoOps

运维的发展经历了人肉运维、自动化运维、DevOps、AiOps 等,而 Serverless 带来一种新的运维模式,这种模式下用户需要管理的只有 Code 可以认为 NoOps。

Serverless 应用场景

  • 事件驱动以及响应式架构
    • IoT 物联网场景中低频请求
    • 请求对及时响应需求不够
    • 固定时间触发计算资源利用低的业务
  • 流量突发场景
    • 比如短时间大流量视频转码
    • 短周期内的流量峰值
  • 跨云与混合云场
  • 边缘计算
  • 其它 ...

Serverless 未来的一些思考

细粒度的计算资源

目前主流的 Serverless/FaaS 技术底层的计算环境通常是容器比如 Docker,容器技术是一种比硬件虚拟化更轻量的实现,用户可以在虚拟机上运行大量的容器,可以更大程度的利用计算资源。

而Serverless 的需求可能是更细粒度的计算资源,比如最近华为发布的 CCI 产品容器的规格已经支持千分之一核,相信千分之一核只是开始,未来 Serverless 在细粒度资源使用上将发挥无限可能。

统一的容器调度模型

从当前 Serverless/FaaS 及容器生态的发展来看,容器基本都是运行在云主机之上比如 aws 的 ec2,阿里云的 ecs。
由于云厂商实现方式及不同产品的差异性,容器的调度框架选择不尽相同,比如有的厂商其 Serverless 产品是基于 Kubernetes 管理云主机集群进行容器编排及调度(比如华为的 CCI),而有的产品如阿里云的函数计算产品是基于自研的 Agent 进行容器调度。那么为什么没有一种产品可以为不同的 Serverless 服务提供通用的容器调度能力呢?

生态圈多样化

Serverless 的发展必然会带动其周边生态的完善,比如 BaaS 及 FaaS 产品的形态将多样化输出,举个例子:
Serverless 架构下用户的 Code 是没有服务端的,而这些服务将由云厂商以 BaaS 的服务形态提供,随着 Serverless 的发展,必然会催生多样化的 BaaS 服务。

产品抽象输出

Serverless 是云计算普惠科技的重磅技术!Serverless 的出现将开发者从复杂的硬件及软件环境中解脱出来,未来可以想象 Serverless 的产品将会以更加简单的方式呈现给用户。举个例子:大家熟知的乐高积木,不同的小零件按照不同的方式组装,最终得到的作品是多样化的。
而 Serverless 天生具备这种优势,可以想象如果 Function 以服务化的方式抽象,开发者开发一个 Cloud App 需要做的事情就是在无数的 Function 里面挑选自己需要的“积木”,然后通过一种可视化的工具进行"积木"组合!

二、Serverless Container

前文讲了一些 Serverless 生态的概念及现状,从当前主流的 Serverless/FaaS 框架,如 AWS Lambda、IBM OpenWhisk、Iron.io、阿里云函数计算分析来看,其底层的计算资源通常是 Docker 容器。可以认为 Serverless 构建于容器 (Docker) 之上!

什么是 Serverless Container

Serverless Container(无服务器容器),意味着用户不再需要关注容器集群和服务器,只需关注 Docker 容器或者 Docker Image 即可。

通过分析业界主流的的 Serverless Container 产品如 AWS Fargate Azure ACI, 华为 CCI,可以看出:

  • Serverless Container 提供了更为简单的体验,用户不再需要理解容器编排技术如 K8s,Swarm;
  • Serverless Container provides the capability of more granular , such as CPU resources micronucleus particle size and particle size MB memory resources;
  • Serverless Container provides a container as a basis calculation unit idea.

Serverless Container VS Kubernets

Kuberntes (K8s) is a Google open source container management system, as well as similar products Docker Swarm, Apache Mesos. These excellent cluster management system, especially K8s has been generated in a fully validated, from the use of perspective, K8s require you to have a container and choreography, cluster management and other aspects of professional knowledge, and Serverless Container shields the user container cluster management, users will be more simple to use!

Conclusion: Serverless Container in the form of container products is higher than Kubernetes, in fact most of the Serverless Container products are based on or compatible Kubernetes.

Serverless Container VS Serverless/FaaS

From the above analysis:

  • Serverless Container is a user-supplied container computing resources, users do not need to be concerned about the container cluster, only you need to customize vCpu, mem and Docker Image;
  • Serverless / FaaS offer is a service-oriented computing power, users also do not care about computing clusters, simply specify vCpu, mem and Code.

Conclusion: The underlying computing resources are FaaS and Serverless Container Docker containers!

"Alibaba Cloud native micro-channel public number (ID: Alicloudnative) focus on micro service, Serverless, container, Service Mesh and other technical fields, focusing popular technology trends in cloud native, cloud native large-scale landing practice, do most understand cloud native developers technology public number. "

Guess you like

Origin www.cnblogs.com/alisystemsoftware/p/11634480.html