- Hands-On Docker for Microservices with Python
- Jaime Buelta
- 608字
- 2021-06-24 12:35:45
The characteristics of a microservices approach
The monolith approach works until the point it doesn't. But, what is the alternative? That's where the microservices architecture enters into the scene.
A system following a microservices architecture is a collection of loosely coupled specialized services that work in unison to provide a comprehensive service. Let's divide the definition a bit, in more specific terms:
- A collection of specialized services, meaning that there are different, well-defined modules.
- Loosely coupled, meaning that each of the microservices can be independently deployed.
- That work in unison—each microservice is capable of communicating with others.
- To provide a comprehensive service, because our microservice system will need to replicate the same functionalities that were available using a monolith approach. There is an intent behind its design.
In contrast to the previous diagram, the microservice architecture will look like this:

Each of the external requests will be channeled to either Microservice A or Microservice B, each one specializing in a particular kind of requests. In certain cases, Microservice B communicates with Microservice C, not directly available externally. Note that there may be multiple workers per microservice.
There are several advantages and implications to this architecture:
- If the communication between microservices is done through a standard protocol, each microservice can be programmed in different languages.
This is very useful in cases where a specialized language is ideal for a specialized problem, but limiting its use so that it is contained, not requiring a drastic change in the company.
- Better resource utilization—if Microservice A requires more memory, we can reduce the number of worker copies. While on a monolith, each worker requires the maximum resource allocation, now each microservice uses only the resources required for its part of the whole system. Maybe some of them don't need to connect to the database, for example. Each individual element can be tweaked, potentially even at the hardware level.
- Each individual service is smaller and can be dealt with independently. That means fewer lines of code to maintain, faster builds, and a simpler design, with less technical debt to maintain. There are no dependency issues between services, as each can define and move them at their own pace. Performing refactors can be done in a more controlled way, as they won't affect the totality of the system. Furthermore, each microservice can change the programming language it's written in, without affecting other microservices.
- Some services can be hidden from external access. For example, Microservice C is only called by other services, not externally. In some scenarios, that can improve security, reducing the attack surface area for sensitive data or services.
- As the systems are independent, a stability problem in one won't completely stop the system. This reduces critical responses and limits the scope of a catastrophic failure.
- Each service can be maintained independently by different developers. This allows for parallel development and deployment, increasing the amount of work that can be done by the company. This requires the exposed APIs to be backward compatible, as we will describe later.
- Web安全防護(hù)指南:基礎(chǔ)篇
- Building E-commerce Sites with VirtueMart Cookbook
- GPS/GNSS原理與應(yīng)用(第3版)
- Oracle SOA Suite 11g Performance Tuning Cookbook
- 信息通信網(wǎng)絡(luò)建設(shè)安全管理概要2
- 互聯(lián)網(wǎng)安全的40個(gè)智慧洞見(jiàn):2014年中國(guó)互聯(lián)網(wǎng)安全大會(huì)文集
- Getting Started with WebRTC
- 正在爆發(fā)的互聯(lián)網(wǎng)革命
- Mastering TypeScript 3
- OMNeT++與網(wǎng)絡(luò)仿真
- 網(wǎng)絡(luò)工程實(shí)施技術(shù)與方案大全
- 物聯(lián)網(wǎng)的機(jī)遇與利用
- 商業(yè)的本質(zhì)和互聯(lián)網(wǎng)
- 一本書(shū)讀懂移動(dòng)物聯(lián)網(wǎng)
- 無(wú)線(xiàn)傳感器網(wǎng)絡(luò)定位方法及應(yīng)用