Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is Microservices?

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Today, I would like to talk to you about what Microservices is, many people may not know much about it. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something from this article.

What is Microservices?

The birth of microservices is no accident: domain-driven design guides us in how to analyze and model complex businesses; agile methodology helps us eliminate waste and rapid feedback; continuous delivery enables us to build faster, more reliable and more frequent software deployment and delivery capabilities; virtualization and infrastructure automation (Infrastructure As Code) help us simplify the creation and installation of environments The popularity of DevOps culture and the emergence of feature teams make small teams more functional. These are all important factors that promote the birth of micro-services.

In fact, the industry does not have a strict definition of micro-service itself. James Lewis and Martin Fowler define the Microservices architecture as follows:

In short, the Microservices architecture style is like developing a small service into a single application, running in its own process, and communicating with a lightweight mechanism (usually HTTP resource API). These services are built around business capabilities and are deployed independently through fully automated deployment tools. These services can use different programming languages and different data storage technologies and keep centralized management to a minimum.

Microservices contains the following characteristics:

Components are provided in the form of services: as the name suggests, microservices are also service-oriented.

Organize around business functions: micro-services tend to divide and disassemble the service structure around business functions. Such a service is software that has a complete implementation for the business domain, including the use of interfaces, persistent storage, and ten-day interactions. So the team should be cross-functional and include complete development technologies: user experience, database, and project management.

A product is not a project: the traditional development model is focused on providing software that is considered complete. Once the development is completed, the software will be handed over to the maintenance or implementation department, and then the development team can be disbanded. Microservices require the development team to be responsible for the entire lifecycle of the software product. This requires developers to pay attention to the operation of software products every day, and contact users more closely, while undertaking some after-sales support. The smaller the service granularity, the easier it is to promote the previous relationship between the user and the service provider. The idea of Amazon is "You build, you run it", which is also the cultural concept of DevOps.

Enhanced terminals and weakened channels: microservice applications focus on loose coupling and high cohesion, preferring simple REST styles to complex protocols (such as WS or BPEL or centralized frameworks). Or use a lightweight message bus (such as RabbitMQ or ZeroMQ) to publish messages.

Decentralized governance: this is very different from the traditional centralized management. Microservices split the components of a holistic framework into different services, and there will be more choices when building them.

Decentralized data management: when monolithic applications use a single logical database to persist data, enterprises usually choose to use a database within the scope of the application. Microservices let each service manage its own database: whether it's a different instance of the same database or a different database system.

Infrastructure automation: the development of cloud computing, especially AWS, reduces the complexity of building, publishing, operating and maintaining micro services. The team of microservices is more dependent on the automation of the infrastructure, after all, the release work is quite boring. Docker, which has become popular in recent years, is also a good choice (see "brief Docker").

Fault-tolerant design: task services may fail because of the unreliability of the supplier. Microservices should provide daily fault detection and recovery for each application's service and data center.

Improved design: because the design is constantly changing, the services provided by microservices should be able to be replaced or scrapped, rather than long-term development.

MSA vs. SOA

Microservice architecture (MSA) is similar to service-oriented architecture (SOA), for example, both are service-oriented. Usually SOA means a large, holistic, centralized solution. This makes it more difficult to design, develop, test, and release, and any small code changes will lead to the need for retesting and deployment of the entire system. On the other hand, the micro-service architecture breaks up all services, sets reasonable granularity, maintains low coupling between services, and each service survives in its complete life cycle, and the mutual influence is reduced to a minimum.

SOA needs to standardize the whole system, and each service of MSA can have its own development language and development method, and its flexibility is greatly improved.

When to adopt Microservices

For distributed design, the first law of distribution is "try not to use distribution". Because the distribution of the system will certainly bring performance overhead.

Microservices make development easier and faster. In the past, developers spent time building the environment and familiarizing themselves with code structure, which would be much easier in the world of microservices. However, microservices bring a series of non-functional requirements, such as transactions, service governance (registration, discovery, load, routing, authentication authorization, isolation), monitoring (logging, performance monitoring, alarms, calling links), deployment, testing, etc. Microservices rely on "infrastructure automation".

Micro-service is not a "silver bullet", when to adopt micro-service also needs to consider the needs of the enterprise itself.

After reading the above, do you have any further understanding of what Microservices is? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report