Modular Engineering Construction Series (1)

  The main problems solved in this series: For a large-scale enterprise application + application facing many customers in different regions, how to do a good job of multi-version management of the application, rapid update of online modules in each region, and system stability guarantee, can be taken The core modules of the application are managed in a modular manner.

  Background:

  In 2017, I took over an old project that has been maintained for more than 7 years. The project has undergone several waves of maintenance, mixed with various development technologies (JSP, Hibernate2.x, jdbc, spring, springmvc, Jquery1.x, Jquery2.x, bootstrap, etc.), the structure of the project is also messy, and the version of the dependency Jar is very old (mostly 7 year version). When entering the project, the main problems to be solved: the system database is often deadlocked, the client response is very slow, and the different versions of different versions are mostly hard-coded.

  Although the project has been struggling, the market prospect is very good, and it has already conquered many areas in the country for the company. In order to quickly respond to customer needs, it is necessary to have online version updates every week. The project is version controlled through GIT. GIT already has more than 50 branch versions when it takes over. My head hurts just looking at it!

  Initial solution:

  1. Database stuck problem (the project uses sqlserver)

    Optimize the SQL of key business (add WITH (NOLOCK) to the query), optimize the type of database associated fields (keep the same type and length), and upgrade the hibernate4.x version

  2. The GIT version is merged into an open version (one version is open + a test version is generated before the release)

    The differentiated functions of each version are controlled by the configuration file. The configuration file adopts one main file configuration + multi-file differential configuration. When publishing, it is controlled by modifying the difference configuration file of the main configuration file.

  3. Unified development technology

    Front-end adopts: Vue + Elment-UI, back-end adopts: Spring4.3.x + SpringMVC + Mybatis

  4. Formulate development specifications

    For team development to be efficient, everyone must follow certain rules of the game in order to solve unnecessary communication costs.

  5. Refactor key business modules through agile development methods.

  There is a problem:

  1. Because the entire project is still in one project, the version release cannot be updated based on the module version, and the pre-release test cannot be independently tested for the update module (the boundary between the update module and other modules cannot be guaranteed)

  2. The daily work of the team members has no focus, and each module is interspersed with development. The stability of the system cannot be guaranteed.

  In order to solve these problems, we try to use modularization to split the project, establish a module domain model, and divide the entire project into multiple modules. Each module completes all the business functions of this module and provides services to other modules. Modules are released externally; testers only need to test against the updated modules. Divide the team by modules to ensure the stability of core module developers.

  The main implementation of modularization :

  1. Architecture diagram:

   

   2. The modularization is mainly layered and constructed in 4 layers:

    1) Basic technology framework layer: Provide front-end and back-end development resources and their version control, and provide capabilities: cache services, system configuration services, tools (characters, dates, files, etc.);

    2) System management module layer: Based on the basic framework, realize the basic management module of each project, providing capabilities: dictionary, icon, menu, user, role, authority management, organization management, etc.;

    3) Business domain module layer: Based on the basic framework, all business functions and external services of this business module are realized;

    4) Application release layer: The modules required by the application are organized through the Maven construction method, and the application is built and released.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325097859&siteId=291194637