author:QYX
Previously we used monomers architecture, multiple systems into a container group call, this simple model development for small applications but not conducive to spreading codes and coupled, and then we introduce vertical application architecture, between systems independent of each other, unified call through the front, while solving the problem of high concurrency, can also be extended for the level, but there are also inter-system independent, shortcomings and duplication of development, and now we come to know the most common mode architecture: distributed architecture and micro services architecture.
Distributed Architecture
SOA (Service Oriented Architecture)
Called the SOA Service-Oriented Architecture, i.e., service-oriented architecture, it can be distributed deployment, and use of a combination of loosely coupled coarse-grained application components (service) according to the needs through the network, a service is typically present in the form of independent operation system processes.
A functional point of standing, the abstract service logic into a reusable, assemblable service, fast reproduction service through the service orchestration, objects: the original business function into a unique common business services, business logic rapid placement multiplexing
Through the above description it can be found SOA has the following characteristics, distributed, reusable, flexible extension loosely coupled
As more and more vertical applications, the inevitable interaction between applications, will be drawn out of the core business, as an independent service, and gradually form a stable service center, the front-end applications to more quickly respond to changing market demands
SOA
advantage:
Extraction of public service functions, improve development efficiency
Different services clustered deployment solution system pressure
ESB / DUBBO reduce system based coupling
Disadvantages:
Extraction of large service granularity
Service providers and a higher degree of coupling Call Interface
SOA architecture diagram
Micro-service architecture :
advantage:
By splitting atomic services (not to split and then split up), as well as independent micro-packaged services, deployments and upgrades, small team lead time will be shortened, operation and maintenance costs will drop significantly
Micro service follows a single principle, the use of a lightweight protocol Restful and other transport services between micro
Disadvantages:
Excessive micro-services, high service cost of governance is not conducive to system maintenance
Highly distributed system development technology costs (fault-tolerant, distributed transactions, etc.)
Remote call technical analysis of system architecture
Call popular technology: RPC , HTTP
CAP principle of distributed
C 一致性(多节点下数据一致) A 可用性(保持服务可以用:多节点) P 分区容错性(是否可以将数据存到多个地方)
一个系统中不可能同时满足C、A、P
一般就是ac放弃分区容错(物理数据库) ap可以短暂允许数据的不一致(NoSQL数据库的选择,互联网中用的较多) cp 放弃可用性()