Contents are as follows
- The evolution of software architecture
- Advantages and disadvantages of micro-services
- Micro-architecture service issues and bring solutions
1. The evolution of software architecture
I look at experience in architecture from roughly
monomer architecture "MVC" Micro Services
Monomers architecture
Monomers architecture is characterized by all business functions packaged in a release package is deployed in a web container, a process running in. Advantage is that the architecture monomers- Easy to develop - a person can write, but others you think this post-maintenance. . . .
- Easy to test - all functions are in a process where Well, the test is simple
- Easy deployment - such as a lost war package on the server just fine
shortcomings - Maintenance difficulties - after increasingly large amount of code, newcomers can hardly get started, do not know how many people go through modified. .
- Deployment difficulties - as the code becomes large, deployment and startup time increases
- Unstable - indeed affect the whole body, it is a mistake gg
- Extended inflexible - vertical expansion is very difficult
MVC
MVC this term has been plagued by the author for a long time, do not understand these three English words to spell, I believe that these terms come up with is to let others do not understand, do not need to think about Model, View, Controller these nouns meaning representatives, it appears to solve the code cluttered, unclear responsibilities of the problem, by defining the interface between the layers, then the separation of interface from implementation, implementation may be better to replace, and easier for others to understand the code, SSM recent common with SSH is the MVC implementation.Micro Services
What is micro-services?
In fact, the micro-service is an architectural style. Compare the official definition is taken from Uncle Martin in blogUsing a series of small service to develop a single application mode, each service runs in a separate process , the general use of lightweight communications interconnection mechanism, and can be deployed in an automated fashion .
- A series of small service
- Independent process
- Lightweight communications
- Automated Deployment
characterized- Single Responsibility - for example, only registered login can be placed in a service, goods and services do not come thrown
- Lightweight communication - language-independent, platform-independent
- Isolation - run in its own process
- Independent data sources - is to have its own independent database
- Technical diversity - across languages wailing ~~
2. The advantages and disadvantages of micro-services
Advantage
- Independence - each service received visits QPS is different, because the process independent of the cause, we can configure a single hardware environment, modify the code will not affect others
- Agility - can quickly develop, each micro service is very simple (if not split up doing)
insufficient
- How to split the service - on. . Difficult
- Data consistency - different from only a single database, there are many micro-services database (on this we can see what is meant by CAP theory)
Communication costs - that is, communication between service calls
3. The problems caused by micro-services and solutions
How communication between micro service
1.httpclient communicate
2.RPC-- remote procedure call, call the remote service and local service exactly the same, call implementation transparent to the userHow to find each other microService
Micro service discovery points the server discovery and client discovery, SpringCloud is the server discovery, Dubbo is the client found that micro-services find the need to have a service discovery and registration centers, namely SpringCloud zookeeper used eureka and Dubbo employed, after each micro services will register themselves to the registry service discovery, service discovery registry will record them, through a service registry, micro service they can find each other and call each other.
How to deploy between micro-services, expansion, updates
On this issue will be specifically addressed in later chapters, this chapter only for a brief description
in order to solve this problem, we must recognize that a term called service orchestration, service orchestration solved deploy updates and expansion problems micro service encounters, and now there many service orchestration tools such as Mesos, Docker Swarm, Kubernetes and so on.