00 Introduction

00 Introduction #

Hello, I’m Madwen Qiang. With 12 years of software development management experience, I worked as a senior system architect at Zhi Shi Information Technology Co., Ltd. in Hangzhou before starting my own business. I led a team to develop a SaaS product called Zishi Finance and its related supporting products, which are suitable for the automotive circulation industry and provide online support services to dozens of institutions in the industry.

Do you have the following confusions?

  • You know that microservice development is popular, but you don’t know the specific content inside.
  • You have an understanding of Spring Cloud microservice development theory, but you lack practical experience.
  • You know the application of individual technical points, but you are a bit fuzzy on how to integrate these technologies.

Why learn microservices? #

1. Enhance technical confidence in job hunting. Microservices is a very hot topic, and more and more enterprises require microservice development and architectural capabilities in their recruitment. Without mastering some microservice skills, there is a lack of highlights when looking for a job. It can be said that microservice architecture has become a necessary skill for mid to senior backend developers and architects.

2. Enhance technical strength and increase the possibility of career transformation. Long-term involvement in partial function development can lead to a lack of overall control. Software systems are complex projects. Only by taking a higher-level perspective and considering all aspects of the business and possible future directions can one gain a deep understanding of the inherent meaning of a product or project. This authority is often held by developers, designers, and architects at higher ranks. If you master a set of microservices architecture and development concepts, it increases the possibility of promotion to higher ranks.

3. Solve software development challenges at work. With the increase in software complexity and the refinement of social division of labor, monolithic applications or extensive software services with a large amount of functional code piled together become bloated and complex, resulting in high development and maintenance costs. This is very inconvenient in daily operations, upgrades, and maintenance. A small change in functionality may cause the entire project to have problems or even crash. If a production environment crashes, the economic losses or negative social impact caused by it are immeasurable. Introducing microservices can better solve this series of problems.

4. Maintain the foresight of technology. Development technologies are rapidly evolving, and new concepts and applications emerge in an endless stream. Cloud-native architecture, containerized operations and maintenance, and platformization are all closely related to microservices. Only by maintaining the continuity of technology can we better learn new technologies. Otherwise, it will be unfavorable for the practical application of new technologies.

What is the use of microservices? What problems can it solve in practical business scenarios? #

Splitting monolithic applications into multiple small, highly cohesive and loosely coupled software services allows different software languages and data storage methods to be used. Each small service can be deployed and run independently. Lightweight communication mechanisms are used between services, and different teams develop and maintain them, greatly improving the maintainability and scalability of the software.

Using microservices architecture can help us solve problems in practical business scenarios:

  • From an organizational level, the system’s division of labor becomes clearer and responsibilities become more defined.
  • Services are divided according to business, and individual services have smaller code bases and single business focus, making them easier to maintain.
  • Services have more specialized capabilities, reduced code duplication, and higher reusability, making service calls simpler.
  • Services have low coupling, and new services can be added and outdated services can be removed at any time.
  • Individual services can also be elastically scaled and have stronger fault tolerance.
  • It suits the software development and operation environment of the cloud era, with efficient and automated build and deployment processes.
  • Data storage is decoupled, and not all data needs to be concentrated in a single large database, making it easier to split and scale.

Why choose Spring Cloud? #

The core features of Spring Cloud are as follows:

img

Spring Cloud has many advantages, as can be seen from the following points:

  • Originating from Spring, it has an active community, rich ecology, stable functionality, abundant resources, and it is easy to find solutions to problems.
  • Based on Spring Boot, it has rich components and out-of-the-box usability, which is more suitable for business implementation.
  • Compared to other frameworks, Spring Cloud has greater support for the microservices ecosystem.
  • There is a large base of developers, making it easier for small and medium-sized enterprises to use.
  • A considerable number of enterprise products have already used Spring Cloud as their technical choice for practical application and support for actual business scenarios.

Now let’s take a look at the ecosystem components of Spring Cloud and how they can help us quickly establish a microservices architecture system. img

Spring Cloud appeared in the form of a suite, proposing a comprehensive set of solutions for microservices, covering all components in the microservices system. Each component is based on the Spring Boot technology system, providing a development solution that is ready to use out of the box and is convention over configuration. This allows developers to bypass the tedious process of component integration and environment configuration, enabling them to quickly get started with microservices. Additionally, Spring Cloud’s stability is guaranteed by extensive compatibility testing from the Spring community. With Spring Cloud, developers do not need to struggle with building microservices from scratch, and it may not necessarily be better than it.

Chinese developers have been debating between using Dubbo or Spring Cloud. While some of Spring Cloud’s functional components have stopped being updated and its environment setup is complicated, Alibaba’s Spring Cloud Alibaba components have emerged in recent years, making it easier to get started and with a lower learning curve. They can be better integrated with the Spring Cloud ecosystem, forming a strong alliance and further enhancing Spring Cloud’s advantage in Java microservices development.

Choosing Spring Cloud is a good choice for microservices architecture in terms of developer skills, community activity, vendor friendliness, and ecosystem stability.

Column Content #

This column will guide you in integrating Spring Cloud technologies into a practical project called “Shopping Mall Parking.” We will connect the technical points step-by-step, including service registration, service discovery, service interface management, configuration center, distributed transactions, unified gateway, service rate limiting and fallback, etc. By gradually studying each point, we will see how to connect the dots, forming lines and shapes. At the end of the column, we will look back and realize that developing microservices with Spring Cloud is not as difficult as we imagined. The main content is divided into three major modules: the preliminary preparation phase, the system implementation phase, and advanced application.

  • In the first part, the preparatory phase, we will follow the software development process to perform early requirements analysis, system design, storage design, architecture design, and build an architecture prototype. We will also introduce relevant development components to lay a solid foundation for future development.
  • In the second part, the system implementation phase, we will gradually complete the required features under the microservices scenario, in line with actual business functionality. This includes service registration and discovery, service invocation, fast failure/fallback during service invocation, configuration center, distributed caching, client-side service adaptation, message push, gateway routing, traffic control, unified authentication, etc.
  • In the third part, the advanced development phase, we will elevate the previous development work by aggregating API interfaces to provide a unified entry point, introducing distributed transactions to ensure data integrity, implementing distributed locks to prevent overselling in limited products, providing application monitoring to observe the health status of various application instances, and introducing middleware for distributed tracing to monitor the efficiency of system calls, providing a basis for later system optimization and service availability degradation.

What Will You Get? #

What problems can this column course help you solve? #

  • Knowledge points are scattered all over the internet, and it takes a lot of time and effort to find and organize them.
  • There is a lack of opportunities to participate in a complete microservices development project, which makes it difficult to grasp new opportunities.
  • Self-learning Spring Cloud can be challenging, and the learning progress can be slow, making it difficult to deeply understand how the components are integrated into a project.
  • Although there are some example codes available, there is no corresponding documentation, making it difficult to fully understand them.

What will you gain from this course? #

  • You will be able to connect the Spring Cloud microservices architecture development system and become familiar with the use of each component and how they can be integrated together to achieve a specific functionality.
  • You will be able to systematically create a product from 0 to 1, which can be applied in job interviews or in actual product development, giving you confidence in facing challenges.
  • You will master the application of Scrum agile development methodology in actual development projects.
  • You will learn some development techniques used in project processes that can be fully applied to your own work.

Target Audience #

  • Java junior to intermediate backend developers
  • Developers who aspire to become architects
  • Developers who want to understand the microservices architecture system

Prerequisite Skills #

  • Proficiency in Java basics and experience using Maven
  • Experience in Spring MVC, Spring Boot, and MyBatis development