Serverless Profile

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 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 partially unfolded:

Serverless concept, history and current situation and think about the future introduction.

The concept and the status quo Serverless Container.

First, talk Serverless

Previously mentioned serverless 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 products introduced by Amazon in 2014, but the earliest Serverless concept is not made by Amazon, let's talk about simple Serverless history.

Serverless history

 

 

 
 

Beginning of the beginning

In 2012 the future president of cloud infrastructure service provider Iron.io of Ken made 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.

The fledgling

AWS Lambda publishing products can be considered Serverless milestone before then Serverless almost at the concept stage, Lambda released until 14 years, so "Serverless" increase this paradigm to a whole new level, for applications running in the cloud provide a new system architecture, Serverless officially to the arena of cloud computing.

Coming

After AWS release Lambda, many manufacturers competing Pass and IaaS market, Google Cloud Functions, Azure Funcions, IBM OpenWhisk, Ali cloud computing function, just a few years Serverless products have been everywhere.

Future has come

With the rapid development of container technology, IoT, 5G, block chain technology, technology for decentralized, lightweight virtualization, fine-grained computing technology increasingly strong demand, and Serverless will take this chance to rapid development, the future Serverless will shine in the cloud computing arena!

Development of cloud computing see Serverless

First, throw a summary view: from the development of cloud computing IaaS, PaaS, SaaS, to the latest BaaS, FasS, this trend serverless (servers go of) more and more obvious, and Serveless the perfect cloud computing will bring It would be a perfect evolution!

 
 

As we know, cloud computing has gone from IDC -> IaaS -> PaaS -> development Serverless / FaaS, here to do some basic introduction to these concepts.

IaaS

 
 

__IaaS (Infrastructure as a Service) infrastructure as a service, the service provider to provide the underlying __ / physical layer infrastructure resources (servers, data centers, environmental control, power supply, server room), you need to provide IaaS service platform to purchase virtual resources , select the operating system, software installation, deployment, monitoring applications.

Currently known IaaS platform AWS, Azure, Google Cloud Plantform, Ali cloud and open source OpenStack and so on.

Close

 
 

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等,客户不需考虑任何形式的专业技术知识,只需要通过服务商平台获取软件使用即可。

 
 

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

 
 

大致流程如下:

UI驱动,通过模拟鼠标点击触发事件

当触发事件增多时lambda实例自动扩容

当触发事件减少时lambda实例自动缩容

阿里云函数计算

 
 

流程大致如下:

UI/Event/Message Driven触发事件

用户Function会package为一个docker镜像

事件调度系统配合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 提供了更细粒度的的能力,比如微核粒度的CPU资源和MB粒度的内存资源

Serverless Container 提供了将容器作为基础计算单元的思路

Serverless Container VS kubernets

kuberntes(k8s) 是谷歌开源的容器管理系统,类似的产品还有Docker Swarm, Apache Mesos以及集团内的产品Sigma。无疑这些优秀的集群管理系统尤其是k8s已经在生成得到了充分验证,从使用角度来说k8s需要用户具备容器及容器编排,集群管理等多方面的专业知识,而Serverless Container对用户屏蔽了容器集群管理,用户使用起来将更简单!

结论:Serverless Container在容器产品形态上是高于kubernetes的,事实上大部分的Serverless Container产品都基于或者兼容kubernetes。

Serverless Container VS Serverless/FaaS

根据上文的分析Serverless Container对用户提供的是一种容器计算资源,用户不需要关心容器集群,只需要定制vCpu,mem及Docker Image;而Serverless/FaaS 提供的是一种服务化的计算能力,用户同样不用关心计算集群,只需指定vCpu,mem及Code。

结论:FaaS及Serverless Container的底层计算资源都是Docker容器!



Author: Ali cloud Yunqi community
link: https: //www.jianshu.com/p/c847bc77e027
Source: Jane book
Jane book copyright reserved by the authors, are reproduced in any form, please contact the author to obtain authorization and indicate the source.

Guess you like

Origin www.cnblogs.com/Bkxk/p/11139928.html