Spring Cloud与Dubbo
什么是微服务
微服务就是将项目的各个模块拆分为可独立运行、部署、测试的架构设计风格。
什么是Spring Cloud
Spring Cloud是一系列框架的有序集合,Spring公司将其他公司中微服务架构常用的组件集合起来,并使用SpringBoot简化开发、配置,称为Spring Cloud。
Spring Cloud 与 Dubbo对比
Dubbo | Spring Cloud | |
---|---|---|
服务注册中心 | Zookeeper | Spring Cloud Netflix Eureka |
服务调用方式 | RPC | REST API |
服务监控 | Dubbo-monitor | Spring Boot Admin |
断路器 | 不完善 | Spring Cloud Netflix Hystrix |
服务网关 | 无 | Spring Cloud Gatewav |
分布式配置 | 无 | Spring Cloud Config |
服务跟踪 | 无 | Spring Cloud Sleuth |
消息总线 | 无 | Spring Cloud Bus |
数据流 | 无 | Spring Cloud Stream |
批量任务 | 无 | Spring Cloud Task |
- Spring Cloud与Dubbo都是实现微服务有效的工具
- Dubbo只是实现了服务治理,而Spring Cloud子项目分别覆盖了微服务架构下的众多部件
- Dubbo使用了RPC通讯协议,Spring Cloud使用RESTful完成通信,Dubbo效率略高于Spring Cloud
- Dubbo性能更好,而Spring Cloud功能更全面