This article has applied for nuggets peripheral gifts, nuggets badge *2 for the comment area lucky draw, through the way of comments to participateSee here for details

📖 preface

Lucky draw at the end of this article: welcome to discuss in the comments section, the top two winners will be awarded nuggets peripheral gifts ~

This is my piece of old article lightly spray, welcome to compare the present with the recent discussion ~ leave a question: everyone think it will beDubboreplaceSpringCloudOr will there be some interesting future?

Yu Guangzhong once said:

Next time you pass by, there will be no me.

The relationship between people, reflected incisively and vividly.

People this life, how many lives can live? It takes only a few decades to calculate, adding up to more than 30,000 days, which is really not long.

Along the way, how many people and we brush shoulders, and then completely stay in memory, clearly is the same city, but never met for decades.

The most regrettable thing is not that we are strange at the beginning, but that we are very familiar with each other and gradually become strangers.

The names in my address book are dusty, the updates in my moments, never checked.

Microservices SpringCloud project

The blogger would like to write a series of articles about the Micro service SpringCloud project from today. This article is an old article with a certain history, and will be updated steadily (maybe each article will be a long interval, I hope you have a little patience). If you are interested, please remember to pay attention to it!

About Microservices

This is my 19 years in an article, we have a look, since to make sure to be relatively stable relatively new version to do ~

Spring Cloud is not well known in China, and some architects, interviewers or Ctos of Internet companies did not even know the existence of the project when I communicated with them during the job hunting process. This may also be related to Dubbo, alibaba’s open source service governance framework in China. In addition to Dubbo’s relatively complete Chinese documents, architects of many technology companies are from Ali Department. Therefore, in the short term, China is still dominated by Dubbo.

So which infrastructure should we choose when implementing a microservices architecture for the first time?

The following contents are the author's personal views, knowledge is limited, if there is anything wrong, it is normal, do not like spray.

Brief discussion on the cognition of micro-service framework

There is a difference between enterprise-level SOA development and microservices development in The mind of the blogger. Of course, you want to say that there is also a Dubbo, may continue to pay attention to partners will know that Dubbo was maintained by Ali before, gave up the maintenance for a period of time, is also a good framework. In November 2018, Spring officials and Alibaba announced the open source SpringCloud-Alibba project, claiming to create a path suitable for China’s national conditions, and bloggers believe Alibaba has the ability to do so. Of course, SpringCloud-Alibaba, who is his benchmark? Yes, it is the SpringCloud framework, the blogger from Cloud1.0 to 2.0 experienced the change of Cloud one year to two years old, below come up with a little of their own opinions to explain to you! Of course I chose SpringCloud!

Introduction toSOASpringCloud

1) The difference between SOA and SpringCloud lies in the division of business. 2) SOA pays more attention to the integration of enterprise business and the division of granularity is rough. 3) Service Oriented Architecture (SOA) : it is a design method that contains multiple services. Services ultimately provide a set of functions through mutual dependency. A service usually exists in a separate form from the operating system process. Services are invoked over the network. 4) SpringCloud is more focused on expanding business division, which is more fine-grained but not conducive to management. 5) Differences between SpringCloud and Dubbo To sum up the whole machine of SpringCloud, Dubbo needs to assemble by itself. 6) Microservice architecture (SpringCloud) = 80% SOA service architecture thought + 100% componentized architecture thought + 80% domain modeling thought 7) Microservice is sublimation on SOA, 8) That is, the original single business system will be split into several small applications that can be independently developed, designed and operated. These small applications interact and integrate with each other through services. (Communication calls between services were made using the SpringCloud-Fegin component, as it still is)Copy the code
The characteristics of SOA
  1. System integration: from the perspective of the system, to solve the communication problems between enterprise systems, the original scattered and unplanned network structure between systems, combing into a regular and governable inter-system star structure, this step often needs to introduce some products, such as ESB, as well as technical specifications, service management specifications; The core problem solved in this step is order.

  2. Servitization of the system: from the perspective of functions, the business logic is abstracted into reusable and assemblable services, and the rapid regeneration of business is realized through the orchestration of services. The purpose is to transform the original inherent business functions into general business services and realize the rapid reuse of business logic. The core problem that this step addresses is reuse.

  3. Servitization of business: from the perspective of enterprises, the functions of enterprises are abstracted into reusable and assemblable services. Transform the former functional enterprise architecture into a service-oriented enterprise architecture to further enhance the external service capabilities of enterprises; “The first two steps are from the technical level to solve the problem of system call, system function reuse”. The third step is to encapsulate a business unit into a service with a business driver. The core problem that this step addresses is efficiency.

Features of microservices
  1. Componentization through services

    Developers no longer need to coordinate the impact of other service deployments on this service.Copy the code
  2. Divide the service and development teams by business capabilities

    Developers are free to choose their own development technologies and provide API servicesCopy the code
  3. decentralized

    Each microservice has its own private database to persist service data. Each microservice can only access its own database, but cannot access the databases of other services. In some service scenarios, multiple databases need to be updated in a transaction. In this case, there is no direct access to other microservices' databases, but rather through operations on microservices. Data decentralization further reduces the degree of coupling between microservices, and different services can use different database technologies (SQL, NoSQL, etc.). In complex business scenarios, if multiple microservices are involved, they are typically handled on the client side or in the middle tier (gateway).Copy the code
  4. Infrastructure automation (DevOPS, automated deployment)

    In Java EE deployment architecture, the WARs are packaged by the presentation layer, the business layer is divided into JARs and the EAR is deployed as a big package, while the microservices open up the black box and break the application into individual services one by one. Using Docker technology, it is not dependent on any server or data model, and it is a full stack application. They can be deployed autonomously, with each service running in its own process, connected through lightweight communication mechanisms, often based on HTTP resource apis, and built on business capabilities that can be centrally managed (because there are so many services that DevOps cannot be managed without them).Copy the code

Let’s draw another chart:


project SOA SpringCloud
Component size Bulk business logic Individual tasks or small chunks of business logic
coupling Normal loose coupling Always loose coupling
The company structure Any type Small, cross-functional teams
management Focus on central management Focus on decentralized management
The target Make sure your application can interoperate Implement new features and rapidly expand the development team

SpringCloudDubboThe advantages and disadvantages of

background

Dubbo is the core framework of Alibaba’s servitization governance and is widely used in all member sites of Alibaba Group. Alibaba’s contribution to the open source community in recent years is eye-catching both at home and abroad. For example, JStorm donated to Apache and joined the Apache Foundation, which won face for Chinese Internet people and upgraded Alibaba from an e-commerce company to a technology company in the eyes of Chinese people.

Spring Cloud, as the name suggests, is an outgrowth of Spring Source, the powerful Spring community that is arguably the most influential organization in the Java business world. Pivotal and Netfix are its powerful backing and technical output. The core of Spring Cloud is the full set of open source micro-service architecture suite of Netflix.

Summary: Comparing Dubbo with Netflix suite, Dubbo has a lot of influence at home and Netflix suite has a lot of influence abroad. I think it’s a draw in terms of background. If you want to compare it to Spring Cloud, Spring Cloud is a bit better in the background thanks to the addition of Spring Source. However, the hero does not care about provenance, and the context is not the main factor in choosing a frame of reference when you are at your wit’s end (it is hard to say at this point).

Architectural integrity

Many would argue that the comparison between Spring Cloud and Dubbo is a bit unfair in terms of overall architectural integrity. Dubbo only implements service governance, while Spring Cloud has 17 sub-projects (and may add more now, Dubbo covers all aspects of the microservices architecture, and service governance is just one aspect. To some extent, Dubbo is just a subset of Spring Cloud’s Netflix. However, in the selection framework, program integrity is exactly a content that needs to be focused on.

According to Martin Fowler’s description of microservice architecture, although this architecture has many advantages, such as module decoupling, independent deployment and technical diversity, compared with single architecture, decoupling in distributed environment also brings about a lot of testing and operation complexity.

Take a look at what Spring Cloud and Dubbo offer in terms of the various elements of microservices architecture.


The project framework Dubbo SpringCloud Dubbo SpringCloud and SPringCloudAlibaba will write about it later
Community activity Dubbo (less active on GitHub) SpringCloud (extremely active on GitHub)
The update frequency Very low Phase of high-speed iteration
Architectural integrity low high
Service Registry Zookeeper Spring Cloud Netflix Eureka
Service invocation mode RPC REST APIS (Restful style)
The service gateway There is no Spring Cloud Netflix Zuul
The circuit breaker imperfect Spring Cloud Netflix Hystrix
Distributed configuration There is no Spring Cloud Config
Service tracking There is no Spring Cloud Sleuth
The message bus There is no Spring Cloud Bus
The data flow There is no Spring Cloud Stream
The batch task There is no Spring Cloud Task

Note:

1) Dubbo takes up less bandwidth because it is binary transmission.

2) Note that SpringCloud uses HTTP protocol for transmission, so the bandwidth will be large. At the same time, HTTP protocol generally uses JSON packets, which will consume more.

3) Dubbo framework only focuses on governance between services. If we need to use configuration center and distributed tracking, we need to integrate them by ourselves, which makes it more difficult to use Dubbo virtually.

4) The most amazing thing is that Spring Cloud considers almost all aspects of service governance and is supported by Spring Boot, making it very convenient and simple to develop.

  • DubboI mean, it was awesome, butSpring CloudIt is developed on the basis of recent technological developments, so it is more technologically representative. useDubboBuilding a microservice architecture is like building a computer. We have a lot of freedom in the process, but the end result is likely to be a bad memory, but if you’re an expert, that’s not a problem. whileSpring CloudJust likeName-brand computerIn theSpring SourceA lot of compatibility tests have been done to ensure that the machine has a higher stability. However, if you want to use something other than the original components, you need to have a sufficient understanding of its foundation.

From the previous SSM to Springboot+ Maven + Mybatis (SpringDataJpa, Hibernate), from SQL Server to MySql (bloggers have been using MySql), Redis and Mongodb do the caching. From single database to database Cluster (Mycat+mysql) read-write separation sub-database sub-table master-slave replication, to Redis Cluster Cluster mode of high scalability, and finally to use SpringCloud microservice architecture to develop Cluster projects.

✨ about the raffle

  • Comment area draw requirements:

    • By September 10th, more than 10 people will interact in the comments section (not including the author), and we will send out the super cute gold nuggets badge as mentioned above2.
  • A gift to send

    • No later than 12 noon on September 13th, I willAward-winning users in the comments sectionThe receiving information was filled into the mining recovery questionnaire
    • The nuggets operation students (a group of cute little sisters ha ha ha ~) are expected to complete the mailing of all gifts within this week
  • Verify information:

    • Swiping comments (such as "tread on", "support", "welcome back to tread on" or similar comments) are not allowed to participate in the lottery, the comment area should mainly discuss the content of the article, thank you for your cooperation

🎉 To sum up


  • I’ll use it in a future postSpringCloudAlibaba combining DubboI believe thatSpringCloudAlibabaIt’s going to be a really cool thing, so I’ll explain it later.

  • Of course, THE pit I dug for myself will be slowly filled, we do not mind the update may be relatively slow, but absolutely ensure the quality.

  • For more references, see here:The Blog of Chan Wing Kai

  • Like the small partner of the blogger can add a concern, a thumbs-up oh, continue to update hey hey!