service mesh和spring cloud的优缺点?

参与9

2同行回答

GaryyGaryy  系统工程师 , 某保险
请参考:https://developers.redhat.com/blog/2016/12/09/spring-cloud-for-microservices-compared-to-kubernetes/这里面说明了spring cloud以及k8s的优缺点,希望对你有帮助。Since both platforms are not directly comparable feature by feature, rather than digging ...显示全部

请参考:https://developers.redhat.com/blog/2016/12/09/spring-cloud-for-microservices-compared-to-kubernetes/
这里面说明了spring cloud以及k8s的优缺点,希望对你有帮助。
Since both platforms are not directly comparable feature by feature, rather than digging into each item, here are the advantages and disadvantages of each platform summarised.

Spring Cloud

Spring Cloud provides tools for developers to quickly build some of the common patterns in distributed systems such as configuration management, service discovery, circuit breakers, routing, etc. It is build on top of Netflix OSS libraries, written in Java, for Java developers.

Strengths

The unified programing model offered by the Spring Platform itself, and rapid application creation abilities of Spring Boot, give developers a great Microservice development experience. For example, with few annotations you can create a Config Server, and few more annotation you can get the client libraries configure your services.
There is a rich selection of libraries covering the majority of runtime concerns. And since all libraries are written in Java, it offers a multiple features, greater control and fine tuning options.
The different Spring Cloud libraries are well integrated with one another. For example a Feign client will also use Hystrix for Circuit Breaking, and Ribbon for load balancing the requests. Everything is annotation driven, easy to develop and feels like a heaven for Java developers.
Weaknesses

One of the major advantages of the Spring Cloud is also its drawback – it is limited to Java only. A strong motivation for the MSA is the ability to change technology stacks, libraries and even languages when required. That is not possible with Spring Cloud. If you want to consume Spring Cloud/Netflix OSS infrastructure services such as configuration management, service discovery, load balancing, the solution is not elegant. The Netflix Prana project implements the sidecar pattern to exposes Java based client libraries over HTTP to make it possible for applications written in Non-JVM languages exist in the NetflixOSS eco-system, but it is not very elegant. In addition, since I have written this article, Pivotal has announced a new cool project called SteelToe, which allows consuming Service Discovery and Config Server services from .Net clients too.
There is too much responsibility for Java developers to care about and the Java applications to handle. Each Microservice needs to run various clients for configuration retrieval, service discovery and load balancing. It is easy to set those up, but that doesn’t hide the build time a runtime dependencies to the environment. For example, I can create a Config Server with @EnableConfigServer annotation easily, but that is only the happy path. Every time I want to run a single Microservice, I need to have the Config Server up and running. For a controlled environment I have to think about making the Config Server highly available and since it can be backed by Git or Svn, I need shared file system for it. Similarly for service discovery I need to start Eureka Server first. For a controlled environment, I need to cluster it with multiple instances on each AZ, etc. It feels like as a Java developer I have to build and manage a not trivial Microservices platform in addition to implementing all the functional services.
Spring Cloud alone has a shorter scope in the Microservices journey, and you will also need to consider automated deployments, scheduling, resource management, process isolation, self healing, build pipelines, etc. for a complete Microservices experience. For this point, I think it is not fair to compare Spring Cloud alone to Kubernetes, and a more fair comparison would be between Spring Cloud + Cloud Foundry (or Docker Swarm) and Kubernetes. But that also means that for a complete end-to-end Microservices experience, Spring Cloud must be supplemented with something like Kubernetes itself.
Kubernetes

Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications. It is polyglot and provides primitives for provisioning, running, scaling and managing distributed systems.

Strengths

Kubernetes is a polyglot and generic container management platform that is capable of running both cloud native and traditional containerised applications. The services it provides such as configuration management, service discovery, load balancing, metrics collection, log aggregation are consumable by variety of languages. This allows having one platform in the organisation that can be used by multiple teams (including Java developers using Spring framework) and serve multiple purposes: application development, testing environments, build environments (to run source control system, build server, artifact repositories), etc.
When compared to Spring Cloud, Kubernetes addresses a wider set of MSA concerns. In addition to providing runtime services, Kubernetes also lets you provision environments, set resource constraints, RBAC, manage application lifecycle, enable autoscaling and self healing (behaving almost like an antifragile platform).
I cannot resist myself to mention that Kubernetes technology is based on Google’s 15 years of R&D and experience of managing containers. In addition, with close to 1000 committers, it is one of the most active Open Source communities on Github.
Weaknesses

Kubernetes is polyglot and as such its services and primitives are generic and not optimised for different platforms such as Spring Cloud for JVM. For example configurations are passed to applications as environment variables or amounted file system. It doesn’t have the fancy configuration updating capabilities offered by Spring Cloud Config.
Kubernetes is not a developer focused platform. It is intended to be used by DevOps minded IT personnel. As such, Java developers need to learn some new concepts and be open for learning new ways of solving problems. Despite it being super easy to start a developer instance of Kubernetes using MiniKube, there is a significant operation overhead to install a highly available Kubernetes cluster manually.
Kubernetes is still a relatively new platform (2 years old) and it is still actively developed and growing. Therefore there are many new features added with every release which may be difficult to keep up with. The good news is that, this has been envisaged, and the API is extensible and backward compatible.

收起
保险 · 2018-07-13
浏览10665
ynwssjxynwssjx  系统架构师 , CMB
2018年以前,扛起微服务大旗的,可能是Spring Cloud。Service Mesh作为一种非侵入式API的框架。比侵入式的Spring Cloud,虽然还在处于成长期,但是应该更有前景。关于service mesh的定义,通常以Buoyant 公司的 CEO Willian Morgan 在其文章 WHAT’S A SERVICE MESH? AND WHY DO I...显示全部

2018年以前,扛起微服务大旗的,可能是Spring Cloud。Service Mesh作为一种非侵入式API的框架。比侵入式的Spring Cloud,虽然还在处于成长期,但是应该更有前景。

关于service mesh的定义,通常以Buoyant 公司的 CEO Willian Morgan 在其文章 WHAT’S A SERVICE MESH? AND WHY DO I NEED ONE? 中对 Service Mesh的定义为参考:
A service mesh is a dedicated infrastructure layer for handling service-to-service communication. It’s responsible for the reliable delivery of requests through the complex topology of services that comprise a modern, cloud native application. In practice, the service mesh is typically implemented as an array of lightweight network proxies that are deployed alongside application code, without the application needing to be aware.

就行业而言,Docker和Kubernetes解决的了服务部署的问题,但是运行时的问题还未解决,而这正是Service Mesh的用武之地。Service Mesh的核心是提供统一的、全局的方法来控制和测量应用程序或服务之间的所有请求流量(用数据中心的话说,就是“east-west”流量)。对于采用了微服务的公司来说,这种请求流量在运行时行为中扮演着关键角色。因为服务通过响应传入请求和发出传出请求来工作,所以请求流成为应用程序在运行时行为的关键决定因素。因此,标准化流量管理成为标准化应用程序运行时的工具。
通过提供api来分析和操作此流量,Service Mesh为跨组织的运行时操作提供了标准化的机制——包括确保可靠性、安全性和可见性的方法。与任何好的基础架构层一样,Service Mesh采用的是独立于服务的构建方式。

收起
银行 · 2018-07-13
浏览9068

提问者

jianglj
其它SNB
擅长领域: 云计算云原生容器

问题来自

相关问题

相关资料

相关文章

问题状态

  • 发布时间:2018-07-12
  • 关注会员:3 人
  • 问题浏览:12065
  • 最近回答:2018-07-13
  • X社区推广