What exactly is the relationship between SOA and microservices?
To tell you the truth, I really don't understand the fundamental difference between SOA and microservices, both of which are ultimately an architectural design approach to providing interfaces externally. I think the micro-service is actually with the development of the Internet, complex platform, business, resulting in the SOA architecture to a more granular, more adoption of the development of the so-called micro-services. Based on this statement, I think the difference between SOA and MicroServices lies in the following areas:
- MicroServices are more granular than SOA, and microservices exist in an independent process, with no impact on each other;
- MicroServices provide a more general interface, such as HTTP restful way, all kinds of terminals can be called, irrelevant language, platform restrictions;
- MicroServices prefer distributed decentralized deployment, which is more suitable for Internet business scenarios.
Why use MicroServices?
Technology is for business, architecture is for business, and SOA and microservices are also the result of business development. The advent of SOA and microservices frameworks and business development, platform expansion is inseparable, the following borrowing Dubbo's website architecture Development Diagram and Description:
- Single Application Architecture
- When site traffic is small, you need only one app to deploy all the features together to reduce deployment nodes and costs.
- At this point, the data Access Framework (ORM) is the key to simplifying the effort of adding and deleting changes.
- Vertical Application Architecture
- As traffic increases, a single application increases the acceleration of the machine, and the application is split into several unrelated applications to improve efficiency.
- At this point, the Web Framework (MVC) used to accelerate the development of front-end pages is critical.
- Distributed Service Architecture
- When the vertical application is more and more, the interaction between applications inevitably, the core business extracted, as a separate service, gradually formed a stable service center, so that the front-end application can be more rapid response to changing market demand.
- At this point, the Distributed Service Framework (RPC) that is used to improve business reuse and consolidation is critical.
- Flow Computing Architecture
- When the service is more and more, the evaluation of capacity, and the waste of small service resources appear gradually, it is necessary to add a dispatch center to manage cluster capacity and improve cluster utilization based on access pressure.
- At this point, the resource Scheduling and Governance Center (SOA) that is used to improve machine utilization is critical.
With the development of the business from all in one environment can meet the business requirements (in Java, it may only be one or two war packages to solve), to the need to split multiple applications, and the use of MVC to separate the front and back, to accelerate development efficiency, in the development to the service more and more, Have to split some core or shared services, in fact, to this stage, if the service is split sufficiently fine, and run independently, I think it can be understood as a micro-service.
The ideal micro-service architecture
Nothing is perfect, the site architecture is the same, only "better than before" the architecture or "the best way to achieve the present", there is no ideal architecture, then the ideal micro-service architecture should be how, I think at least there are several features:
- Can support the current business needs, of course, this is only the most basic conditions;
- Every micro-service is to be centralized, there is no single point of failure;
- Each micro-service to achieve high availability, high load, not because a service is not available to affect the entire business flow;
- Each micro-service should be highly generalized, that is, a variety of terminals can be called, no language and platform;
- Service deployment or upgrade is simple, does not consume a lot of manpower and the deployment process is not easy to human error;
- MicroServices have fast registration and auto-discovery capabilities (e.g. Dubbo framework)
Of course, this is only a few of the things that can be thought of, the micro-service framework used in the actual environment may be able to optimize for the actual business needs of more personalized functionality, or some features are not required. Or that sentence, the architecture is to serve the business, can quickly and easily meet the business needs of the architecture is a good architecture, is a good micro-service architecture.
The above is just a personal understanding, write your own understanding, in case you look.
Maybe I'm right, maybe I said it's all wrong.
SOA and microservices that I understand