Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

A course on micro-service and agile development practice method of large-scale e-commerce system architecture

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

The micro-service and agile development practice method course of large-scale e-commerce system architecture, aiming at this problem, this article introduces the corresponding analysis and solution in detail. I hope it can help more partners who want to solve this problem to find a more simple and feasible method.

The architecture of Java e-commerce system was dominated by SSH 10 years ago, when it was basically built using the most popular technologies at that time, such as Strurt + Spring + Hibernate/Mybatis. But there is nothing new in this world. The development of IT technology is faster than other industries, and the iteration of new and old knowledge is particularly fast. Many popular technologies are just popular for a period of time and rapidly wither, resulting in the system to constantly update its technical system to ensure its advanced technology. As the old knowledge will soon pass its expiration date, many IT personnel will continue to accumulate and learn new knowledge. If they relax a little, they will encounter a midlife crisis. The essence of midlife crisis is that the speed and willingness to learn new knowledge have declined due to physical and family reasons, and the speed and scope of knowledge accumulation can not keep up with the development of the times, so many IT employees will be forced to leave the industry at the age of 35-40. This is a very cruel topic, but it is precisely because the industry is developing rapidly that it brings all kinds of opportunities to newcomers and brings opportunities for small companies to overtake and succeed. As long as they seize a point of continuous effort to polish, even large companies can not cope with any amount of capital, because there are so many breakthroughs that it is impossible to cover every point. How resources are invested in that direction and execution determines the height of a company.

The above shows that in the information technology industry, change is the only constant truth. All we can do is to keep embracing change, and we still don't want to get rich once and for all.

Back to the point, today, with the rapid change of the Internet industry, the architecture of the system needs to be constantly developed in order to play a better development efficiency. The general system will go through the following stages of architectural changes.

The standard single application of SSH is dominated by war, and all the functions are placed in one application, which is easy to deploy and cluster deployment, and the cost is low.

Multiple sub-applications vertically divided by function, and multiple war packages deployed together to form a complete system. This approach has improved flexibility, and development teams can be divided by function.

At present, the popular micro-service system is to use spring cloud/dubbo as the front-end and back-end separate development mode. Horizontal separation of the front-end and back-end from the personnel structure, used to reduce the overall quality requirements of personnel. Now that the front-end technology is changing with each passing day, it is difficult for a person to achieve the front-end take all. The front-end includes IOS, Android, WAP, various Mini Program, and so on. All the front-end developers share the same set of background interfaces. The back-end development colleagues only need to provide RESTFUL-style interfaces and expose the interfaces to the front-end calls through swagger and other technical means.

Is it more appropriate for spring cloud or dubbo to upgrade from a normal SSH/SSM architecture? Because dubbo has stopped updating for a period of time, the feedback received now is that most companies will give priority to spring cloud, but in practice, it is found that if you upgrade on the original system, it will be easier to modify using dubbo, but the new system will give priority to using spring cloud, because the ecology of spring cloud is more perfect. But Ali has recently re-maintained dubbo and opened up a new open source micro-service product called spring cloud alibaba. What is the relationship between Spring Cloud Alibaba and Spring Cloud? Spring Cloud Alibaba (hereinafter referred to as SCA), like Spring Cloud Netflix (hereinafter referred to as SCN), is a set of implementation of Spring Cloud specification. Look at the differences between them:

It can be seen that the principles of these two systems are the same. Alibaba's version wants to use the ecology of spring cloud to woo spring cloud programmers. This version provides an easy-to-use configuration center, registry Nacos and fuse Sentinel, these components are compatible with both spring cloud and dubbo, provide convenience for the integration and simultaneous use of spring cloud and dubbo, and are more powerful and easier to use than previous components.

System structure

To sum up the above analysis, the following is the technology sharing brought by he Wenqiang, the architect of Langzun Software. Take the LegendShop e-commerce system as an example, take a look at the overall solution:

Combined with the figure, the following is the main technology stack of the technology used in this e-commerce system.

Through the design decoupling of API, the whole system is divided into several subsystems or micro services according to the business.

The client accesses the internal application through API gateway, and realizes the blacklist and whitelist, routing control, authority control and so on through gateway. A background can support multiple clients at the same time.

two。 Multiple applications can be deployed per subsystem, and load balancing is used among multiple applications.

Each service occupies a port, and the same service can start multiple instances.

3. Both the service registry and configuration center use Nacos, and all services are registered in the registry. Load balancer is also implemented by using certain policies for services registered in the registry. The following is a screenshot of Nacos.

4. Using OAuth3 authentication to improve the security mechanism of external interaction

The client needs system authorization when calling gateway or internal API, otherwise the system security cannot be guaranteed. In this scheme, Oauth3 is used for authority verification, and each caller will assign an appId and secretKey. Before calling API, users need to use appId and secretKey to exchange for legitimate token, and then access the functions of the system through token. OAuth3 is a secure, open and simple standard protocol for the authorization of user resources. The authorization of OAuth3 does not allow third parties to access the user's account information, which is very secure. And any third party can use OAuth3 authentication service, in this architecture, every request for micro-service from the outside has to be verified by the OAuth3 server. OAuth3 unifies the security mechanisms of many micro-services here, and achieves security at the micro-service level rather than the gateway level.

two。 Agile development

About agile development, I have to mention DevOps (a combination of Development and Operations). From Baidu's definition, DevOps is a group of processes, methods and systems that facilitate communication, collaboration and integration among development (application / software engineering), technology operations and quality assurance (QA) departments. It is a culture, sport, or practice that emphasizes communication and cooperation between "software developers (Dev)" and "IT operation and maintenance technicians (Ops)". Build, test, and release software more quickly, frequently, and reliably by automating the process of "software delivery" and "architecture change". Its emergence is due to the increasingly clear recognition in the software industry that in order to deliver software products and services on time, development and operation and maintenance work must work closely together.

2.1 version Control

This piece is currently developed using git for version control, and the basic usage of git is tailored according to the following principles.

Master and develop branches are long-standing branches. If there is a bug, it will be modified from hitting the bug branch and then merged into the develop branch. Then merge the develop branch into the master branch, and the final version can get the code from the master version.

2.2 continuous integration

Another continuous integration tool gives priority to Jenkins. The screenshot is as follows:

Jenkins is a powerful application that allows continuous integration and continuous delivery of projects, regardless of platform. This is a free source code that can handle any type of build or continuous integration. Integrated Jenkins can be used for some testing and deployment technologies. Jenkins is a piece of software that allows continuous integration.

Code management tools such as Jenkins and git/svn work closely to facilitate overall development and deployment.

2.3 Docker deployment

As micro-services will be divided into more independent systems, if all are deployed manually, it will be more cumbersome. Therefore, it is not conducive to the long-term and stable development of the system. Using Docker installation will simplify the whole deployment steps and improve the security of the system. The structure of the system deployment is as follows:

Each microservice is a subsystem that runs independently.

According to Baidu, Docker is an open source application container engine that allows developers to package their applications and dependency packages into a portable image, publish them to any popular Linux or Windows machine, and virtualize them. Containers are fully sandboxed and will not have any interface with each other. In practice, we will find that it is not enough to use a single Docker node in the production environment, and it is imperative to build a Docker cluster. However, in the face of many container cluster systems such as Kubernetes, Mesos, Swarm and so on, how should we choose? Among them, Swarm is native to Docker, and it is also the simplest, easiest to learn and most resource-saving, so Swarm is used as a solution for cluster deployment of the system.

The development and operation of Docker container applications cannot be separated from reliable image management. Although Docker officially provides a public image repository, it is also necessary to deploy Registry in our private environment in terms of security and efficiency. Harbor is an enterprise-level Docker Registry management project open source by VMware, which includes functions such as rights management (RBAC), LDAP, log audit, management interface, self-registration, image replication and Chinese support.

Using Docker to deploy a variety of regular applications is very simple, as long as a command or a yml file. Since this article does not focus on how to use Docker, please refer to the author's other articles on how to install Docker,Docker-compose and Docker-swarm.

Summary

The upgrade and optimization of the system are endless, and can only be constantly adjusted and optimized according to the actual situation. The advantage of micro-service is that the system can be subdivided into different sub-modules, which is suitable for medium and large-scale system development. Because the e-commerce system is a sales system dealing with customers, the nature of this industry is different from the system used within the enterprise, which determines that if the e-commerce system is to become stronger and bigger, the number of customers will be different by several orders of magnitude. And customers will put forward a variety of requirements, functions and interfaces should also change with the festival or trend. Therefore, this micro-service version is more appropriate for multi-cash customers, with more server and manpower consumption. Some customers said that I want to do a Taobao, do a JD.com, I want to sub-table sub-library. Come on, you'd better be reasonable. But the micro-service version of the e-commerce system also gives customers a basis for dreaming.

The next 10 years will be an era in which traditional offline industries will infiltrate online. The cluster version is fine for general small and medium-sized customers. A little younger, I just need to do business and sell goods. I don't have any special needs, so I just use the SAAS version. SAAS + PASS is the way to develop in the future. After all, there are people who specialize in it.

This is the answer to the question about the micro-service and agile development practice method tutorial of large-scale e-commerce system architecture. I hope the above content can be of some help to you, if you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report