什么是微服务(James Lewis原文翻译)

  • “Microservices” – yet another new term on the crowded streets of software architecture.

    “微服务”——软件架构拥挤的街道上的又一个新词。

  • Although our natural inclination is to pass such things by with a contemptuous glance, this bit of terminology describes a style of software systems that we are finding more and more appealing.

    虽然我们自然倾向于轻蔑地忽略这些东西,但这个术语描述了一种我们发现越来越吸引人的软件系统风格。

  • We’ve seen many projects use this style in the last few years, and results so far have been positive, so much so that for many of our colleagues this is becoming the default style for building enterprise applications.

    在过去的几年中,我们已经看到许多项目使用了这种风格,到目前为止,结果是积极的,以至于对于我们的许多同事来说,这已经成为构建企业应用程序的默认风格。

  • Sadly, however, there’s not much information that outlines what the microservice style is and how to do it.

    然而,遗憾的是,并没有太多的信息来概括什么是微服务风格以及如何去做。

  • In short, the microservice architectural style [1] is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API.

  • 简而言之,[1]微服务架构风格是一种将单个应用程序作为一组小服务来开发的方法,每个小服务都在自己的进程中运行,并使用轻量级机制(通常是HTTP资源API)进行通信。

  • These services are built around business capabilities and independently deployable by fully automated deployment machinery.

    这些服务是围绕业务功能构建的,可以通过完全自动化的部署机制独立部署。

  • There is a bare minimum of centralized management of these services, which may be written in different programming languages and use different data storage technologies.

    这些服务的集中管理是最低限度的,可以用不同的编程语言编写,并使用不同的数据存储技术。

  • My Microservices Resource Guide provides links to the best articles, videos, books, and podcasts about microservices.

  • 我的微服务资源指南提供了关于微服务的最好的文章、视频、书籍和播客的链接。

  • To start explaining the microservice style it’s useful to compare it to the monolithic style: a monolithic application built as a single unit.

  • 要开始解释微服务风格,将其与单片风格进行比较是很有用的:单片应用程序构建为单个单元。

  • Enterprise Applications are often built in three main parts: a client-side user interface (consisting of HTML pages and javascript running in a browser on the user’s machine) a database (consisting of many tables inserted into a common, and usually relational, database management system), and a server-side application.

    企业应用程序通常由三个主要部分组成:客户端用户界面(由运行在用户机器上的浏览器中的HTML页面和javascript组成)、数据库(由插入到公共的、通常是关系型的数据库管理系统中的许多表组成)和服务器端应用程序。

  • The server-side application will handle HTTP requests, execute domain logic, retrieve and update data from the database, and select and populate HTML views to be sent to the browser.

    服务器端应用程序将处理HTTP请求、执行域逻辑、从数据库检索和更新数据,并选择和填充要发送到浏览器的HTML视图。

  • This server-side application is a monolith – a single logical executable[2].

    这个服务器端应用程序是一个整体—一个逻辑可执行的[2]。

  • Any changes to the system involve building and deploying a new version of the server-side application.

    对系统的任何更改都涉及构建和部署服务器端应用程序的新版本。

  • Such a monolithic server is a natural way to approach building such a system.

  • 这样一个单片服务器是构建这样一个系统的自然方法。

  • All your logic for handling a request runs in a single process, allowing you to use the basic features of your language to divide up the application into classes, functions, and namespaces.

    处理请求的所有逻辑都在单个进程中运行,允许使用语言的基本特性将应用程序划分为类、函数和名称空间。

  • With some care, you can run and test the application on a developer’s laptop, and use a deployment pipeline to ensure that changes are properly tested and deployed into production.

    您可以谨慎地在开发人员的笔记本电脑上运行和测试应用程序,并使用部署管道来确保正确地测试更改并将其部署到生产环境中。

  • You can horizontally scale the monolith by running many instances behind a load-balancer.

    您可以通过在负载平衡器后面运行多个实例来水平扩展整个整体。

  • Monolithic applications can be successful, but increasingly people are feeling frustrations with them – especially as more applications are being deployed to the cloud .

  • 单片应用程序可以获得成功,但越来越多的人对它们感到失望——特别是随着越来越多的应用程序部署到云上。

  • Change cycles are tied together – a change made to a small part of the application, requires the entire monolith to be rebuilt and deployed.

    更改周期是紧密联系在一起的——对应用程序的一小部分所做的更改,需要重新构建和部署整个整体。

  • Over time it’s often hard to keep a good modular structure, making it harder to keep changes that ought to only affect one module within that module.

    随着时间的推移,通常很难保持良好的模块结构,使保持应该只影响该模块中的一个模块的更改变得更加困难。

  • Scaling requires scaling of the entire application rather than parts of it that require greater resource.

    扩展需要扩展整个应用程序,而不是需要更多资源的部分。

  • 什么是微服务(James Lewis原文翻译)

     

  • These frustrations have led to the microservice architectural style: building applications as suites of services.

    这些挫折导致了微服务体系结构风格:将应用程序构建为服务套件。

  • As well as the fact that services are independently deployable and scalable, each service also provides a firm module boundary, even allowing for different services to be written in different programming languages.

    除了服务是独立部署和可伸缩的这一事实之外,每个服务还提供了一个牢固的模块边界,甚至允许用不同的编程语言编写不同的服务。

  • They can also be managed by different teams .

    它们也可以由不同的团队管理。

  • We do not claim that the microservice style is novel or innovative, its roots go back at least to the design principles of Unix.

    我们并不是说微服务风格是新颖或创新的,它的根源至少可以追溯到Unix的设计原则。

  • But we do think that not enough people consider a microservice architecture and that many software developments would be better off if they used it.

    但我们确实认为,考虑微服务架构的人还不够多,如果他们使用它,许多软件开发将会更好。

  • 总结:

  • 微服务就是将一个单体架构的应用按业务划分为一个个的独立运行的程序即服务,它们之间通过HTTP协议进行通信(也可以采用消息队列来通信,如RoocketMQ,Kafaka等),可以采用不同的编程语言,使用不同的存储技术,自动化部署(如Jenkins)减少人为控制,降低出错概率。服务数量越多,管理起来越复杂,因此采用集中化管理。例如Eureka,Zookeeper等都是比较常见的服务集中化管理框架。

文章知识点与官方知识档案匹配,可进一步学习相关知识Java技能树首页概览92637 人正在系统学习中

来源:qq_1757537040

声明:本站部分文章及图片转载于互联网,内容版权归原作者所有,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2021年10月3日
下一篇 2021年10月3日

相关推荐