Springcloud Learning-micro-service architecture

Source: Internet
Author: User
Tags continuous integration tools

Directory

    Micro-Service Architecture Quick Guide

    Soa

    Dubbo

    Spring Cloud

    Comparison of Dubbo and Springcloud

Micro-Service (Microservice) Architecture Quick Guide

What is software architecture?
A software architecture is a system organization that contains a variety of organizations, including Web servers, application servers, databases, storage, and communication layers, which have relationships with each other or with the environment.

What is a microservices architecture?
MicroServices are the development of a single, small, but business-capable service, each with its own processing and lightweight communication mechanisms that can be deployed on a single or multiple servers.

MicroServices also refer to a kind of loosely-coupled, service-oriented architecture with a certain bounded context. That is, if each service is to be modified at the same time, then they are not microservices because they are tightly coupled, and if you need to master a service with too many context scenarios, then it is a service with a context boundary, which is defined by the DDD domain-driven design.

What are the advantages and disadvantages of microservices architecture?

    Advantages

    • Each micro-service is small enough to focus on a specific business function or business requirement.
    • Micro-services can be developed by small teams, a small team of 2 to 5 developers.
    • MicroServices are loosely coupled and functional services that are independent both during the development phase and at the deployment stage.
    • MicroServices can be developed using different languages.
    • MicroServices allow for easy and flexible integration of automated deployments through continuous integration tools such as Jenkins, Hudson, bamboo.
    • New members of a team can be put into production faster.
    • MicroServices are easily understood, modified, and maintained by a developer, so small teams can focus more on their work outcomes. There is no need for cooperation to embody value.
    • MicroServices allow you to leverage the latest technologies for integration.
    • MicroServices are just code for business logic and do not mix with html,css or other interface components.
    • MicroServices can be expanded on demand immediately.
    • MicroServices can be deployed on servers with low-end configurations.
    • Easy integration with third parties.
    • Each micro-service has its own storage capacity and can have its own database. You can also have a consolidated database.

    Disadvantages

    • MicroServices architectures can lead to excessive operations.
    • Requires DevOps skills (HTTP://EN.WIKIPEDIA.ORG/WIKI/DEVOPS).
    • Probably double the effort.
    • Distributed systems can be complex and difficult to manage.
    • Because the distribution deployment tracking problem is difficult.
    • As the number of services increases, management complexity increases.
SOA (service-oriented architecture)

SOA is a component model that links different functional units (called services) of an application through well-defined interfaces and contracts between these services. A service-oriented architecture that enables distributed deployment, composition, and use of loosely coupled coarse-grained application components over a network based on demand.

SOA Basic Architecture Diagram

1. Registry: Save service provider exposed service information, common Registry has zookeeper Eureka also available redis default Eureka

2. Service Provider: Service Provider

3. Service consumer: When a remote service interface needs to be invoked, the service provider must be found in the Registry Discovery service for Remote method tuning

Dubbo implementation of micro-services

Dubbo is Ali Open source SOA service Governance solution, the document is rich in the domestic use is very high. Dubbo

    • Calling the middle tier becomes an optional component that consumers can access directly to the service provider.

    • Service information is centralized into registry, which forms the central component of service governance.

    • The monitor monitoring system provides a visual representation of the service invocation statistics.

    • The consumer can be used for load balancing and service downgrade options.

But for the microservices architecture, Dubbo is not perfect either:

    • Registry relies heavily on third-party components (zookeeper or Redis), and service calls are quickly interrupted when there are problems with those components.

    • Dubbo only supports RPC calls. Makes the service provider and the caller strongly dependent on the code, and the service provider needs to constantly package the jar package containing the common code for consumer use. Once a problem is packaged, a service call error occurs.

    • Most importantly, Dubbo is now discontinued, and new requirements for technology development need to be developed and upgraded by developers themselves. This is obviously not appropriate for many small and medium-sized software organizations that want to adopt a microservices architecture.

New Choice Springcloud

In contrast to Dubbo, Spring Cloud is implemented with the following components:

                      

The Chinese document from Springcloud includes all the components that spring cloud now has, as well as the role of each component.

The following will explain the common components (such as configuration management, service discovery, circuit breakers, intelligent routing, micro-agents, control Bus) Here first do not explain.

Comparison of Springcloud and Dubbo
Features required by microservices Dubbo Springcloud
Service Registration and Discovery Zookeeper Eureka
Service invocation Mode Rpc Restful API
Service Routing and Filtering Yes Zuul
Load Balancing Yes Ribbon
Circuit Breaker Yes Hystrix
Distributed configuration No Spring Cloud Config
Distributed messaging No Spring Cloud Bus
Cluster Selection Master No Spring Cloud Cluster
Bulk tasks No Spring Cloud Task
Service tracking No Sleuth&zipkin
...... ...... ......
It's clear that Springcloud's features are more powerful than Dubbo, are more extensive, and can be seamlessly integrated with the spring Framework, Spring Boot, Spring Data, Spring batch and other spring projects. These are essential for microservices.

Document comparison

Dubbo documents can be said in the domestic open source framework is first-class, very full, and the explanation is very deep, because the version has been stable no longer updated, so there is not very inconsistent situation, in addition to provide both Chinese and English versions, for domestic developers, reading more easy to get started,  This is also Dubbo in the domestic more fire some reason it. Spring Cloud integrates a large number of components, the document is much more natural in volume than Dubbo, the content of the document is concise and clear, but more of a preference for integration, more in-depth use of the method or need to see the detailed documentation of its integrated components. In addition, because spring Cloud is based on spring Boot, many examples are much simpler than traditional spring applications (because the automation configuration, a lot of content is the default configuration of the contract), which may be a little different for the developers who have just contacted, it is recommended to understand and learn spring   Use spring Cloud after boot, or there may be a lot of smattering. Although the volume of documentation for spring cloud is large, if you use Dubbo to integrate other third-party components, you actually have to read a large number of third-party component documentation, so I don't think there is much difference in the amount of documentation. For the quality of the document, I think Dubbo is better at quality because of the fact that the spring cloud iterations are very fast and there are inevitably inconsistencies.        For document languages, Dubbo naturally has an advantage over domestic development teams. Follow the bloggers continue to bring spring Cloud series of articles, but also welcome friends to communicate together and progress together.

Springcloud Learning-micro-service architecture

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.