最近由于一些原因,一直在研究serverless及相关的技术实现和原理。
从传统SOA架构到容器架构,再到serverless,里面的架构演进历史对于一个亲历者来说感触颇多,下面我们就来简单聊聊传统SOA和面向服务的架构演进,帮助大家更好的理解其中的概念,本人水平有限,如有错误烦请各位大佬指正。
当我们提到SOA(Service-Oriented Architecture)架构的时候想到的是什么?松耦合(Loosely Coupled)?服务拆解?面向服务?
其实个人觉得相对于单机架构来讲,SOA架构解决的是业务可用性,相关服务的水平扩展,以及资源再利用,管制,流程审核等等等。这点其实和当今很火的微服务概念很像,都是以服务作为单位,都比较在意服务的治理和服务复用,微服务其实也是在SOA上做的改进,当然微服务更多强调的是“业务需要彻底的组件化和服务化”,其实本人多Spring Cloud等一些JAVA系的产物并没有什么好感,如果希望拿到一个高性能的RPC框架,可以尝试 TARS 。
那么一个完整的SOA架构体系是怎么样的呢?
如上图所示,SOA架构就是这样的,通过各个服务模块,将较为复杂的业务拆分治理,它的特点是服务是无状态的,即服务在被调用前后本身没有变化,且同一个服务允许同时在多台计算机上运行。那么正是因为如此,就诞生了一系列的中间件产品比如服务总线(service bus),API 网关(API Gateway),消息队列(MQ/kafka)
消息队列在SOA/微服务架构的示意图
这就是传统SOA和中间件的相关说明。
那么我们再来聊聊容器把,众所周知,容器这个概念也是最近才火起来的,依赖与Kubernetes (K8s)的容器编排工具,容器由于其低廉的使用成本,高可用的扩展性,持续交付能力等等,越来越多的企业开始使用并大规模部署容器,最典型的应该是斗鱼,虎牙等一些系列老SOA架构上容器的业务改造。
但是大多数的企业其实对容器的玩法是有误解的,容器单位其实本质是为了方便单个服务的拆解, 看到有很多企业拿容器当KVM那种虚拟化的主机使用,所以吐槽下。
容器和普通KVM,Xen等虚拟化的区别我想大家应该都差不多略有了解,这块就不在展开叙述了。我们来重点说说Kubernetes容器编排对于传统SOA架构的意义和价值。
Kubernetes属于主从分布式架构,主要由Master Node和Worker Node组成,以及包括客户端命令行工具kubectl和其它附加项。Master Node:作为控制节点,对集群进行调度管理;Master Node由API Server、Scheduler、Cluster State Store和Controller-Manger Server所组成;
Worker Node:作为真正的工作节点,运行业务应用的容器;Worker Node包含kubelet、kube proxy和Container Runtime;kubectl:用于通过命令行与API Server进行交互,而对Kubernetes进行操作,实现在集群中进行各种资源的增删改查等操作;
Add-on:是对Kubernetes核心功能的扩展,例如增加网络和网络策略等能力。
那么从上面可知,Kubernetes更多的意义在于对传统SOA的服务器层级做改造,实现自动化部署容器,水平扩容,负载均衡等等分布式的部署环境,这样一方面实现了所谓的“高内聚,松耦合”,另一方面简化了传统SOA的服务器层级的管理。由于集群的特性,可以将业务模型拆分为更细颗粒度的面向服务。
总的来说,不论是Docker,Dubbo还是上升到Kubernetes,他们实现的更多替代的是对服务器层级的集群调度,分布式方面的改造,更多的意义是基于传统SOA做的优化和改进。
那么我们再来看看今天的重头戏,Serverless 。
AWS 的 AWS Lambda 在 Serverless 界是有统治地位的,但是由于各种原因,AWS Lambda 在中国国内鲜为人知,它的理念更多是提倡弱后端,弱运维,以最小的成本来实现业务功能。来用一个很短的视频看下把
它所提倡的更多是函数的概念,可以理解为将K8S的Worker Node封装成简一的单个函数,从而实现单任务,无状态的函数工作流。当然,每家的Serverless架构实现都不尽相同,所以不太可能都依赖于K8s实现,但是不论BaaS或者FaaS基础能力和特性都是一样的。
除了AWS Lambda 还有腾讯云的 SCF,阿里云的函数计算等等,其实Serverless更多看的还是基于Serverless所做的产品附加功能,比如 AWS DynamoDB,AWS API Gateway等等一系列的附加功能,来实现Serverless的易用化与独立性。最近腾讯云出了 SCF (HTTP)版的云函数,可以直接通过HTTP访问请求,感兴趣的童鞋可以去看看。
所以 Serverless 相对于容器,传统SOA不论从设计架构,纬度,和应用方法上都不尽相同,Serverless将SOA的服务概念,容器的工作节点概念,拆分到函数,这就代表如果使用Serverless必须实现业务的云原生,最简单的例子就是如果要把一个单体应用拆分成10个容器,100个函数,并且每个都具有独立的部署周期以及复杂的依赖图,配合成熟健壮的CI/CD以及自动化的系统。把这些和Serverlss一起使用的时候,将会大幅提升敏捷性和创新性,但是如果仅仅只有其中一个,那么带来的损失远大于收益。
Serverless 的使用是有门槛的,尤其对于一些现在还在沿用单体架构的企业来说,如果没有任何Docker/Kubernetes的实施经历。那么就不该从Serverless开始。
如上,就是我对SOA,容器,Serverless的一些思考,最后的最后,如果自己想架构一个独立的Serverless框架应该如何实现呢?
给大家介绍一个Serverless开源框架——Fission
它的架构如下:
简单来说就是一个Web应用,Go语言编写,使用gorilla框架。不过它的模板引擎替换成了Kubernetes中的Service。使用k8s.io/client-go/kubernetes接口来操控。
感谢大佬们来看我的长篇大论,本人水平有限,如有错误,烦请务必指正~~
Attractive section of content. I just stumbled upon your weblog and in accession capital to assert that I get in fact enjoyed account your blog posts. Any way I will be subscribing to your augment and even I achievement you access consistently quickly.
One more issue is that video games usually are serious naturally with the major focus on learning rather than fun. Although, we have an entertainment feature to keep your children engaged, each and every game is usually designed to improve a specific group of skills or curriculum, such as mathmatical or scientific research. Thanks for your posting.
I’ve observed that in the world these days, video games include the latest popularity with kids of all ages. Many times it may be difficult to drag young kids away from the activities. If you want the very best of both worlds, there are numerous educational games for kids. Thanks for your post.
stromectol online canada [url=https://stromectolhub.com]ivermectin lice[/url] ivermectin 12
[url=http://ventolin.fun/]generic for combivent[/url]
[url=https://adiflucan.com/]how can i get diflucan over the counter[/url]
[url=https://tizanidinetab.monster/]tizanidine pills 4 mg[/url]
[url=http://amitriptylineelavil.shop/]endep tablets 25mg[/url]
[url=http://adrugstore.monster/]pharmacy store[/url]
[url=https://lasixztab.online/]lasix 40mg tablet price[/url]
Bu kadar spor başa bela.
“Keep your eyes on the stars, and your feet on the ground.”
Full Apk İndir, Son Sürüm Apk
[url=https://azithromycin.email/]zithromax 500 mg cheap[/url]
[url=https://buyxenical.life/]xenical 120mg orlistat[/url]
[url=http://bactrimtab.online/]bactrim 960 mg[/url]
[url=https://inderal.life/]inderal 60 mg capsule[/url] [url=https://toradol.icu/]toradol pill prices[/url] [url=https://buylevaquin.life/]buy levaquin online[/url] [url=https://suhagratab.online/]suhagra 100[/url] [url=https://azithromycin.agency/]azithromycin where can i buy[/url] [url=https://zithromax.life/]azithromycin otc uk[/url] [url=https://buychloroquine.life/]aralen mexico[/url] [url=https://tadacip.sbs/]canadian pharmacy 20 mg tadacip[/url]
[url=https://zoviraxtab.online/]acyclovir 1000 mg[/url]
[url=https://buycanadianpharmacy.quest/]canadian pharmacy in canada[/url]
[url=http://bactrim.sale/]buy bactrim without prescription[/url]
[url=https://buypropecia.life/]buy propecia online australia[/url]
[url=https://prednisone.wiki/]how to get prednisone[/url]
[url=http://atenolol.fun/]atenolol chlorthalidone[/url] [url=http://avodart.click/]avodart 0.5 mg capsule[/url] [url=http://buyonlinepharmacy.quest/]online pharmacy[/url] [url=http://amoxicilin.online/]augmentin 800[/url] [url=http://vardenafil.sale/]levitra buy australia[/url]
[url=http://atenolol.life/]tenormin buy[/url]
[url=https://buynexium.life/]generic nexium canada[/url]
You can�t imagine where our problems come from!
I read this post your post so nice and very informative post thanks for sharing this post
[url=https://bactrimds.online/]bactrim 800 160 mg[/url]
história da prostituição
bahis siteleri güvenilirdi
The desired locale has been saved to your browser. To change the locale in this browser again, select another locale on this screen.
The desired locale has been saved to your browser. To change the locale in this browser again, select another locale on this screen.
The desired locale has been saved to your browser. To change the locale in this browser again, select another locale on this screen.
Hi admin, I am reporting you a fake ball site, please google it will ruin this site.
Viagra satın almak için tercih edebileceğiniz birçok alternatif satış kanalı vardır. Bu kanallardan en çok tercih edileni ise Viagra satın almak için kullanabileceğiniz online Viagra satış siteleridir.
Hi admin, I’m reporting you a fake animal porn site, please google it will destroy this site.
Gösterdiği etkiden dolayı yurtdışında Weekend Pill olarak da adlandırılan viagra satış ve etki anlamında benzer özelliklere sahip olduğunu belirten ilaçlara oranla çok daha büyük etkilerin meydana çıkmasını sağlamaktadır.
hello admin whats this child porn tube payday child porn free.
hello childporn this sites. payday çocuk pornosu.
Mp3Video.org’u tercih etmelisiniz çünkü Youtube Mp3 ve Youtube Video İndir alanında lider teknoloji sağlayıcılarındandır. Hızlı altyapısı güvenilir sistemi, reklamsız ara yüzü ile kalite odaklı bir hizmet sunmaktadır, pişman olmama garantili bir servistir.
Download And Share MP4 Video MP3 Music! You will be able to download mp3 and video in the quality you want from our website, and it is always completely free.
DonghuaTR Türkçe Anime ve Donghua izleme adresi. Bir çok çeşit Animeyi sitemizde HD kalitede izleyebilirsiniz. Anime bölümleri her zaman güncel olarak sitemizde yayınlanır. Aradığınız tüm animeleri DonghuaTR’de bulabilir ve izleyebilirsiniz. Anime izle.
Okumak istediğiniz tüm Manga, Manhwa ve Webtoonları Manga Oku TR’de bulabilirsiniz. Ekibimiz büyük bir gayret ve heves ile tüm güncel bölümleri ışık hızında okuyucularımza ulaştırır. Manga Oku TR kullanıcılarına değer veren bir sitedir.
5 dias em buzios
I have recently started a blog, the info you provide on this site has helped me greatly. Thanks for all of your time & work.
Sitene Eczane Ekle ile dilediğin il, ilçeye ait nöbetçi eczaneleri kendi kişisel/resmi web sitelerinde ücretsiz bir şekilde ekleyebilirsiniz.
tarot harry potter
Türkiye’nin en güncel nöbetçi eczane listesine sitemiz üzerinden anında ulaşabilirsiniz…
free mod apk download sites
I’ve been absent for some time, but now I remember why I used to love this website. Thank you, I’ll try and check back more often. How frequently you update your site?