Microservice architecture(微服務架構)
What's Microservice architectural?
An approach to developing a single application asa suite of small services, each running in itsown processandcommunicating with lightweight mechanisms
Built around business capabilities and independently deployableby fully automated deployment machinery
There is abare minimum of centralized managementof these services, which may be written indifferent programming languagesand usedifferent data storage technologies.
Microservicev.s. Monolithic
How big is a microservice?
These modular boundaries then become excellent candidates for microservices. In general, microservices should cleanly align to Bounded Context.
Key Benefits
Technology Heterogeneity:With a system composed of multiple, collaborating services, we can decide to use different
technologies inside each one. This allows us to pick the right tool for each job,
rather than having to select a more standardized, one-size-fits-all approach that often
ends up being the lowest common denominator.
Resilience:A key concept in resilience engineering is the bulkhead. If one component of a system
fails, but that failure doesn’t cascade, you can isolate the problem and the rest of the
system can carry on working.
Scaling:With a large, monolithic service, we have to scale everything together. One small part
of our overall system is constrained in performance, but if that behavior is locked up
in a giant monolithic application, we have to handle scaling everything as a piece.
With smaller services, we can just scale those services that need scaling, allowing us
to run other parts of the system on smaller, less powerful hardware,
Ease of Deployment:With microservices, we can make a change to a single service and deploy it independently
of the rest of the system. This allows us to get our code deployed faster. If a
problem does occur, it can be isolated quickly to an individual service, making fast
rollback easy to achieve.
Organizational Alignment:Microservices allow us to better align our architecture to our organization, helping us
minimize the number of people working on any one codebase to hit the sweet spot of
team size and productivity.
Composability:One of the key promises of distributed systems and service-oriented architectures is
that we open up opportunities for reuse of functionality. With microservices, we
allow for our functionality to be consumed in different ways for different purposes.
Optimizing for Replaceability:With our individual services being small in size, the cost to replace them with a better
implementation, or even delete them altogether, is much easier to manage.