目錄
前言
一、Spring Cloud Alibaba 是什么?
二、Spring Cloud Alibaba 版本依賴
前言
????????Spring Cloud 本身并不是一個拿來即可用的框架,它是一套微服務規(guī)范,這套規(guī)范共有兩代實現(xiàn)。
(子項目):
● 第一代實現(xiàn): Spring Cloud Netflix,
● 第二代實現(xiàn): Spring Cloud Alibaba。
2018 年 12 月12 日,Netflix 公司宣布 Spring Cloud Netflix 系列大部分組件都進入維護模式,不再添加新特性。這嚴重地限制了 Spring Cloud 的高速發(fā)展,于是各大互聯(lián)網(wǎng)公司和組織開始把目光轉向 Spring Cloud 的第二代實現(xiàn):Spring Cloud Alibaba。
由于Alibaba的一些組件性能等更勝與Netflix,而市面上大多都在使用Alibaba的解決方案,所以后面都是環(huán)繞Alibaba進行講解
一、Spring Cloud Alibaba 是什么?
????????Spring Cloud Alibaba 是阿里巴巴結合自身豐富的微服務實踐而推出的微服務開發(fā)的一站式解決方案,是 Spring Cloud 第二代實現(xiàn)的主要組成部分。
????????Spring Cloud Alibaba 吸收了 Spring Cloud Netflix 的核心架構思想,并進行了高性能改進。自 Spring Cloud Netflix 進入停更維護后,Spring Cloud Alibaba 逐漸代替它成為主流的微服務框架。
Netflix是一家美國公司,在美國、加拿大提供互聯(lián)網(wǎng)隨選流媒體播放,定制DVD、藍光光碟在線出租業(yè)務。該公司成立于1997年,總部位于加利福尼亞州洛斯蓋圖,1999年開始訂閱服務。2009年,該公司可提供多達10萬部DVD電影,并有1千萬的訂戶。2007年2月25日,Netflix宣布已經售出第10億份DVD。HIS一份報告中表示,2011年Netflix網(wǎng)絡電影銷量占據(jù)美國用戶在線電影總銷量的45%。
????????Spring Cloud Alibaba 是國內首個進入 Spring 社區(qū)的開源項目。2018 年 7 月,Spring Cloud Alibaba 正式開源,并進入 Spring Cloud 孵化器中孵化;2019 年 7 月,Spring Cloud 官方宣布 Spring Cloud Alibaba 畢業(yè),并將倉庫遷移到 Alibaba Github OSS 下。
雖然 Spring Cloud Alibaba 誕生時間不久,但俗話說的好“大樹底下好乘涼”,依賴于阿里巴巴強大的技術影響力,Spring Cloud Alibaba 在業(yè)界得到了廣泛的使用,成功案例也越來越多。
?
Spring Cloud Alibaba 組件
Spring Cloud Alibaba 包含了多種開發(fā)分布式微服務系統(tǒng)的必需組件
- Nacos:阿里巴巴開源產品,一個更易于構建云原生應用的動態(tài)服務發(fā)現(xiàn),配置管理和服務管理平臺。
- Sentinel:阿里巴巴開源產品,把流量作為切入點,從流量控制,熔斷降級,系統(tǒng)負載保護等多個維度保護服務的穩(wěn)定性。
- RocketMQ:Apache RocketMQ 是一款基于Java 的高性能、高吞吐量的分布式消息和流計算平臺。
- Dubbo:Apache Dubbo 是一款高性能的 Java RPC 框架。
- Seata:阿里巴巴開源產品,一個易于使用的高性能微服務分布式事務解決方案。
- Alibaba Cloud OSS:阿里云對象存儲服務器(Object Storage Service,簡稱OSS),是阿里云提供的海量、安全、低成本、高可靠的云存儲服務。
- Alibaba Cloud Schedulerx:阿里中間件團隊開發(fā)的一款分布式調度產品,支持周期性的任務與固定時間點觸發(fā)任務。
????????通過 Spring Cloud Alibaba 的這些組件,我們只需要添加一些注解和少量配置,就可以將 Spring Cloud 應用接入阿里微服務解決方案,通過阿里中間件來迅速搭建分布式應用系統(tǒng)。
Spring Cloud 兩代實現(xiàn)組件對比
Spring Cloud 第一代實現(xiàn)(Netflix) | 狀態(tài) | Spring Cloud 第二代實現(xiàn)(Alibaba) | 狀態(tài) |
Ereka | 2.0 孵化失敗 | Nacos Discovery | 性能更好,感知力更強 |
Ribbon | 停更進維 | Spring Cloud Loadbalancer | Spring Cloud 原生組件,用于代替 Ribbon |
Hystrix | 停更進維 | Sentinel | 可視化配置,上手簡單 |
Zuul | 停更進維 | Spring Cloud Gateway | 性能為 Zuul 的 1.6 倍 |
Spring Cloud Config | 搭建過程復雜,約定過多,無可視化界面,上手難點大 | Nacos Config | 搭建過程簡單,有可視化界面,配置管理更簡單,容易上手 |
Spring Cloud Alibaba 的應用場景
● Spring Cloud Alibaba 的應用場景如下:大型復雜的系統(tǒng),例如大型電商系統(tǒng)。
● 高并發(fā)系統(tǒng),例如大型門戶網(wǎng)站、商品秒殺系統(tǒng)。
● 需求不明確,且變更很快的系統(tǒng),例如創(chuàng)業(yè)公司業(yè)務系統(tǒng)。
二、Spring Cloud Alibaba 版本依賴
? ? ? ? 由于Spring Cloud Alibaba 是基于Spring Cloud做的,而Spring Cloud又是基于Spring Boot做的,所以三者之間存在一個版本兼容的映射關系。
????????Spring Cloud的版本命名遵循倫敦地鐵站的名字,按字母順序排列。例如Angel、Brixton、Camden、Dalston、Edgware、Finchley、Greenwich、Hoxton等。每個版本下面還有細分的SR(Service Release)和RELEASE版本。
Spring Cloud Alibaba的版本命名比較直接,主要是數(shù)字和RELEASE組合
????????版本號如2.1.0.RELEASE或2.1.1.RELEASE,通常遵循語義化版本控制(Semantic Versioning)的原則。在這種版本命名方式中,每個數(shù)字和術語都有特定的含義:
-
主版本號(Major Version)?- 這是版本號的第一個數(shù)字,在這個例子中是“2”。主版本號的改變通常表示有重大更新,可能包含不兼容的API變更,需要開發(fā)者更加謹慎地升級。
-
次版本號(Minor Version)?- 這是版本號的第二個數(shù)字,在這個例子中是“1”。次版本號的變化通常表示添加了新的功能,但是向后兼容,即新版本應該能與舊版本的API兼容。
-
修訂號(Patch Version)?- 這是版本號的第三個數(shù)字,在這個例子中是“0”或“1”。修訂號的變化通常指修復了現(xiàn)有功能的bug,不引入新功能,保持向后兼容。
-
RELEASE?- 這個術語通常出現(xiàn)在版本號的最后,表示這是一個穩(wěn)定版本,適合廣泛使用。與之相對的可能是BETA(測試版)或SNAPSHOT(快照版),這些版本可能還在開發(fā)中,不夠穩(wěn)定。
?Spring Cloud 、Spring Cloud Alibaba 、Spring Boot三者版本關系
Spring Cloud 版本 | Spring Cloud Alibaba 版本 | Spring Boot 版本 |
Spring Cloud 2020.0.1 | 2021.1 | 2.4.2 |
Spring Cloud Hoxton.SR12 | 2.2.7.RELEASE | 2.3.12.RELEASE |
Spring Cloud Hoxton.SR9 | 2.2.6.RELEASE | 2.3.2.RELEASE |
Spring Cloud Greenwich.SR6 | 2.1.4.RELEASE | 2.1.13.RELEASE |
Spring Cloud Hoxton.SR3 | 2.2.1.RELEASE | 2.2.5.RELEASE |
Spring Cloud Hoxton.RELEASE | 2.2.0.RELEASE | 2.2.X.RELEASE |
Spring Cloud Greenwich | 2.1.2.RELEASE | 2.1.X.RELEASE |
Spring Cloud Finchley | 2.0.4.RELEASE(停止維護,建議升級) | 2.0.X.RELEASE |
Spring Cloud Edgware | 1.5.1.RELEASE(停止維護,建議升級) | 1.5.X.RELEASE |
Spring Cloud Alibaba 組件版本關系
Spring Cloud Alibaba 版本 | Sentinel 版本 | Nacos 版本 | RocketMQ 版本 | Dubbo 版本 | Seata 版本 |
2.2.7.RELEASE | 1.8.1 | 2.0.3 | 4.6.1 | 2.7.13 | 1.3.0 |
2.2.6.RELEASE | 1.8.1 | 1.4.2 | 4.4.0 | 2.7.8 | 1.3.0 |
2021.1 or 2.2.5.RELEASE or 2.1.4.RELEASE or 2.0.4.RELEASE | 1.8.0 | 1.4.1 | 4.4.0 | 2.7.8 | 1.3.0 |
2.2.3.RELEASE or 2.1.3.RELEASE or 2.0.3.RELEASE | 1.8.0 | 1.3.3 | 4.4.0 | 2.7.8 | 1.3.0 |
2.2.1.RELEASE or 2.1.2.RELEASE or 2.0.2.RELEASE | 1.7.1 | 1.2.1 | 4.4.0 | 2.7.6 | 1.2.0 |
2.2.0.RELEASE | 1.7.1 | 1.1.4 | 4.4.0 | 2.7.4.1 | 1.0.0 |
2.1.1.RELEASE or 2.0.1.RELEASE or 1.5.1.RELEASE | 1.7.0 | 1.1.4 | 4.4.0 | 2.7.3 | 0.9.0 |
2.1.0.RELEASE or 2.0.0.RELEASE or 1.5.0.RELEASE | 1.6.3 | 1.1.1 | 4.4.0 | 2.7.3 | 0.7.1 |
????????版本兼容是非常重要的,如果版本不兼容可能會出行各種各樣的問題。我們不僅要學會版本依賴關系還要學會如何查詢,因為以后它還會出現(xiàn)新的版本,我們要知道在哪里查。文章來源:http://www.zghlxwxcb.cn/news/detail-778130.html
?? 版本發(fā)布說明 | Spring Cloud Alibaba文章來源地址http://www.zghlxwxcb.cn/news/detail-778130.html
到了這里,關于Spring Cloud Alibaba 介紹與版本映射關系的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!