原文地址:What's a service mesh? And why do I need one? (buoyant.io)

目录

  • What is a service mesh?
  • What does a service mesh actually do?
  • Why do I need a service mesh?
  • Where did the service mesh come from?
  • What’s the future of the service mesh?
  • Conclusion

Service meshes like Linkerd and Istio are tools for adding observability, security, and reliability features to applications by inserting them at the platform layer rather than the application layer. While initially obscure, the service mesh is rapidly becoming a standard part of the cloud native stack, especially for Kubernetes adopters.

Over the past few years, the service mesh has risen from relative obscurity to become a standard component of the cloud native stack. The first service mesh project, Linkerd (“linker-dee”), was admitted to the Cloud Native Computing Foundation in early 2017, rewritten to use Rust micro-proxies in 2018, and is now in production at major organizations like Microsoft, HP, Walmart, and Nordstrom. In mid-2017, IBM and Google also announced Istio, and in the following year many other projects have cropped up.

But what is a service mesh, exactly? And why is it suddenly such a hot topic? In this article, I’ll define the service mesh and trace its lineage through shifts in application architecture over the past decade. We’ll take a quick look into how the service mesh works. Finally, I’ll describe where the service mesh is heading and what to expect as this concept evolves alongside cloud native adoption.

(You may also like: The Service Mesh: What Every Software Engineer Needs to Know about the World’s Most Over-Hyped Technology.)

What is a service mesh?

A service mesh is a tool for adding observability, security, and reliability features to applications by inserting these features at the platform layer rather than the application layer.

The service mesh is typically implemented as a scalable set of network proxies deployed alongside application code (a pattern sometimes called a sidecar). These proxies handle the communication between the microservices and also act as a point at which the service mesh features can be introduced. The proxies comprise the service mesh’s data plane, and are controlled as a whole by its control plane.

The rise of the service mesh is tied to the rise of the “cloud native” application. In the cloud native world, an application might consist of hundreds of services; each service might have thousands of instances; and each of those instances might be in a constantly-changing state as they are dynamically scheduled by an orchestrator like Kubernetes. Not only is service-to-service communication in this world incredibly complex, it’s a fundamental part of the application’s runtime behavior. Managing it is vital to ensuring end-to-end performance, reliability, and security.

What does a service mesh actually do?

At its core, a service mesh adds reliability, security, and observability features to a microservice application by managing the way that communication happens between the services.

For example, Linkerd uses a wide array of powerful techniques such as mutual TLS (mTLS), latency-aware load balancing, retries, success rate instrumentation, transparent traffic shifting, and more. A single request made through Linkerd involves many steps:

  1. Linkerd applies dynamic routing rules to determine which destination the requester actually intended. Should the call be routed to a service on the local cluster or on remote one? To the current version or to a canary one? Each of these decision points can be configured dynamically by the operator, allowing for techniques like failover and canary deploys.
  2. From the set of possible endpoints to that destination (which Linkerd keeps up to date based on Kubernetes service discovery information), Linkerd chooses the instance most likely to return a fast response based on a variety of factors, including whether it’s currently serving a request as well as its recent history of latency.
  3. Linkerd checks to see if a usable TCP connection to that destination already exists in its connection pool. If not, Linkerd creates it, transparently using mTLS to ensure both confidentiality (encryption) and authenticity (identity validation) of both sides of the connection. Even if the communication is happening over HTTP/1.1, Linkerd may automatically establish an HTTP/2 connection to the proxy on the remote side in order to multiplex requests across a single connection.
  4. Linkerd attempts to send the request over the connection, recording the latency and response type of the result. If the instance is down, unresponsive, or fails to process the request, Linkerd retries the request on another instance—but only if it knows the request is idempotent and the retry budget is available. If an instance is consistently returning errors, Linkerd evicts it from the load balancing pool, to be retried later.
  5. Linkerd captures every aspect of the request and response in the form of metrics and distributed tracing, which are emitted and stored in a centralized metrics system and reported to the operator via Linkerd’s dashboards and CLI tools.

And that’s just the simplified version!

Why do I need a service mesh?

If you are building applications on Kubernetes, then a service mesh like Linkerd provides critical observability, reliability, and security features with one big advantage: the application doesn’t need to implement these features, or even to be aware that the service mesh is there!

This is great for platform teams because it aligns their responsibilities with their ownership. It’s also great for developers, as it takes features that don’t pertain to business logic off of their plates.

If you aren’t using Kubernetes, the story becomes a little muddier. Kubernetes’ pod model and networking infrastructure allow service meshes to be implemented very easily with minimal operational burden. (Linkerd, for example, requires no configuration to install, even for mutual TLS!) Without these underlying features from Kubernetes, the cost of service mesh adoption starts increasing rapidly. While there are certainly “cross-platform” service meshes, the cost-benefit equation is very different, and care must be taken not to end up managing thousands of proxies by hand.

Where did the service mesh come from?

The origins of the service mesh model can be traced in the evolution of server-side applications over the past several decades.

Consider the typical “three-tiered” architecture of a medium-sized web application in the 2000’s. In this model, application logic, web serving logic, and storage logic are each a separate layer. The communication between layers, while complex, is limited in scope—there are only two hops, after all.

When this architectural approach was pushed to a very high scale, it started to break. Companies like Google, Netflix, and Twitter, faced with massive traffic requirements, implemented what was effectively a predecessor of the cloud native approach: the application layer was split into microservices, and the tiers became a topology. These systems solved this complexity by adopting a generalized communication layer , usually in the form of a library—Twitter’s Finagle, Netflix’s Hystrix, and Google’s Stubby being cases in point.

Fast forward to the modern service mesh. The service mesh combines this idea of explicitly handling service-to-service communication with two additional cloud native components. First, containers, which provide resource isolation and dependency management, and allow the service mesh logic to be implemented as a proxy, rather than as part of the application. Second, container orchestrators (e.g. Kubernetes), which provide ways of deploying thousands of proxies without a massive operational cost. These factors mean that we have a better alternative to the library approach: rather than binding service mesh functionality at compile time, we can bind it at runtime, allowing us to completely decouple these platform-level features from the application itself.

What’s the future of the service mesh?

The frantic pace of service mesh adoption is showing little sign of slowing down. As with most successful technology, the ultimate future of the service mesh is probably quite boring: to recede into the background, present but taken for granted and not actually given too much attention.

The exciting future of the service mesh, then, is not so much how the technology itself advances but rather in what it unlocks. What kinds of new things are we able to do, once a service mesh is in place? For example, platform tools like Dive build on top of the service mesh to provide a global view of all application components across all clusters, tied to service level objectives (SLOs). This kind of approach would never be possible without tools like Linkerd.

Conclusion

The service mesh continues its meteoric rise to becoming a widely-used and critical component of the cloud native stack. From its humble beginnings as the first service mesh project in 2017, Linkerd is now in production at organizations like Microsoft, HP, Walmart, and Nordstrom, and adoption shows no sign of slowing down. If you are using Kubernetes, Linkerd is fully open source and available to you today. You’re only minutes away from getting concrete, hands-on experience with the service mesh!

What is a service mesh? And why do I need one?相关推荐

  1. 聊聊Service Mesh:linkerd

    [编者的话]随着企业逐渐将传统的单体应用向微服务或云原生应用的转变,虽然微服务或者云原生应用能给企业带来更多的好处,但也会带来一些具有挑战的问题,如怎么管理从单体应用转向微服务所带来的服务间通讯的复杂 ...

  2. 下一代 Service Mesh -- istio 架构分析

    前面的分享中,我们讲到,出于性能和稳定的考虑,我们没有采用以 istio 为代表的第二代 service mesh技术,而是直接使用了 Envoy 搭配自己的 xDS 服务. 然而我们还是有必要去了解 ...

  3. 百度大规模Service Mesh落地实践

    导读:百度过去基于rpc框架的服务治理存在各种框架能力层次不齐.业务自身服务治理效率低.全局可观测性不足等诸多问题.本文介绍了百度内部落地service mesh的实践过程,以基础稳定性能力治理和流量 ...

  4. 基于Service Mesh构建更现代的服务架构

    点击上方蓝色字体,选择"设为星标" 优质文章,及时送达 前言 传统业务模型中,客户端和服务端之间放置一个负载均衡器,比如nginx.我们的客户端可以是移动程序或者web系统. 当服 ...

  5. 实施Service Mesh前,你需要考虑这几个问题

    随着我们需要治理的微服务数量越来越多,我们必须开始着手解决服务间通信的复杂性问题,而Service Mesh(服务网格)的出现恰逢其时,作为基础设施层,它能够以透明代理的形式提供安全.快速.可靠的服务 ...

  6. Service Mesh是大方向,那Database Mesh呢?

    在微服务和云原生大潮的卷席之下,服务化一直以来是人们关注的重点.但服务化之后,真正绕不开的数据访问却鲜有论道.尽管目前的关系型数据库远达不到云原生的要求,并且对分布式的不友好在长期以来也饱受诟病,但不 ...

  7. 十问 | 关于Service Mesh 和Kubernets的最前沿思考

    小蚂蚁说: 在7月6日ArchSummit全球架构师峰会2018深圳站上,蚂蚁金服平台数据技术部的杨冰.Service Mesh布道师敖小剑.蚂蚁金服技术专家毛小云和来自阿里大文娱UC基础部的曾彬,四 ...

  8. Service Mesh:调度千军万马微服务,2.0妥妥的

    冠望 发自 凹非寺 量子位 报道 | 公众号 QbitAI 过去一年,继Kubernetes风靡,Service Mesh已成功上位变成当之无愧的技术网红. TA不但可以极大简化用户使用体验,还将大中 ...

  9. Service Mesh — Overview

    目录 文章目录 目录 微服务的两个层面 微服务架构服务治理的难点 Service Mesh(服务网格) Service Mesh 的设计思想 Istio 的实现原理 Service Mesh 的问题 ...

  10. Service Mesh — APIGW vs ServiceMesh

    目录 文章目录 目录 APIGW vs ServiceMesh 原本清晰的界限:定位和职责 APIGW 访问内部服务,算东西向还是南北向? Sidecar:真正的重合点 如何融合东西向和南北向的通讯方 ...

最新文章

  1. mysql 网络io_分布式 | DBLE 网络模块源码解析(一):网络 IO 基础知识
  2. java实体 和 xml相互转换
  3. 让tomcat运行php
  4. mysql olap 函数_Mysql中的窗口函数
  5. OpenShift Security (9) - 用 RHACS 扫描 Log4j 安全漏洞,屏蔽不安全镜像部署
  6. c语言定义不定长数组初始化_大学C语言期末考试练习题(带详解答案)(1)
  7. 线程与进程,你真的清楚吗?
  8. aop日志(记录方法调用日志)
  9. OSGI.NET,请求因HTTP状态404 失败:Not Found
  10. pageoffice 选中部分文字 添加书签和空白处添加书签 删除空白以及内容书签
  11. c语言程序中文复制到word变乱码,怎么复制C程序代码到Word不会有乱码,不会有乱字等情况...
  12. 基于Android的防疫信息管理系统源码【包调试运行】
  13. Processing 自动贪吃蛇脚本
  14. linux安全审计和加固工具-lynis
  15. FPGA--ZCU106通过SFP+/SGMII模块传输数据-第二讲(全网唯一)
  16. 实现jquery双击图片放大
  17. 企业数字化转型思考系列文章(一)何为数字化转型?
  18. SQL基础培训25-SQL开发思路畅谈与开发规范
  19. 为什么团队分工越明确,工作效率越低?
  20. 搜索引擎优化,SEO关键词快速排名方法有哪些?

热门文章

  1. RAP 1.4的新里程碑和Apache MyFaces启动CODI
  2. 剑灵电五服务器位置,剑灵都有哪些区合区?
  3. 优莎纳见证一 usana减肥、经期综合症
  4. 模拟“永恒之蓝”攻击,实现系统提权
  5. 【Davinci开发】:MCAL模块导入(之:ICU模块)
  6. 中国美眉如何幽默地拒绝外国男人
  7. U3D中 TextMeshPro 的超链接使用笔记
  8. flock、lockf和fnctl区别
  9. 人大附国际班学长独家分享AP生存手册
  10. iPhone状态栏高度