modular development: "updating some versions and modules (online)", modular Development

Source: Internet
Author: User modular development: "updating some versions and modules (online)", modular Development

Project development is never a simple problem. The more difficult problem is to maintain projects developed by others and modify bugs. Reconstruction is required if the original system has major problems.

How to reconstruct the system is not discussed in this article, but how to deploy the system online after reconstruction is closely related to this article. You may be interested in this.

Now, let's take a look at how to update some versions and modules. modular Development Series directory

1. modular development-Mvc partition extension framework (source code)

2. modular development: "opening a simple and pleasant journey to sub-module development"

3. "reuse of logic (Project)" In modular Development"

3.1 logic (Project) Reuse of different roles or permissions (Application of partition filters)

3.2. Reuse of different business logic (projects) (DI (dependency injection) applications)

4. modular development: "project (partition) splitting"

5. modular development: "updating some versions and modules (going online )"


I. Assume a system architecture

The preceding figure shows the architecture of a simple website.
Three projects are actually developed: blog, news, and comments)
Two projects are deployed in this project (partition),/Blog/Coment/AND/News/Coment/


2. Now we have new requirements to upgrade the comment function.

1. We split the version of the comment function

Original version: \ Branchs \ Coment_V1.0

New Version: \ Branchs \ Coment_V1.1

2. Fortunately, the efficiency of our great programmers is high. The new version is complete, and we have to deploy it.

However, for various reasons, the leader updates the blog comment (/blog/Coment/) and then updates the News comment after the blog comment goes online for a period of time. What should we do?

We also want to provide a quick rollback plan if there is a problem with the new comment feature)


3. Well, although the demand is a little "abnormal", we can't say we can't do it.

Here is an aside. programmers, a paranoid group, are the least tolerable to others who question their abilities. In fact, programmers are also human beings, and they are not omnipotent. If not, No or No.


1. Add a site ( to the backend)

A partition/blog/Coment/is deployed in it/

2. configure a rewrite rule for the front-end (Ngnix) to point to the partition of the new site.

In this way, the new functions will be available smoothly, and the access path will not change. Other modules that are directly connected do not need to be modified. It has no impact on search engines such as du Niang.

We didn't make any changes to the old site (IIS). It turned out to be normal, but now it is less likely to be abnormal, reducing the risk of going online.

Some may say that the new comment function modifies the table structure. Even if the source IIS Site is not updated, the old comment site may also be suspended. I can only say that I can't do anything if you want to do this.

This requires written modular code. Before upgrading, consider compatibility with the original data structure and try to split tables for different businesses. If you can, do not modify the structure of the original table during the upgrade. Instead, create a new table, import historical data to the new table before going online, and then repeat the incremental data after going online. What can be done based on the technical strength and product requirements of your team.

3. What should I do with rollback? (Rollback solution)

Haha, this is simpler. You only need to delete the newly added rewrite rule from ngnix.

4. Some people may say that you are not scientific. You may need to modify the blog comment module as well.

Indeed, you may need to modify the blog comment module to go online.


This figure shows a local image. The deployment of the original IIS Site remains unchanged.

5. Some people say that our company does not need Ngnix. You have a high requirement.

In fact, other front-ends have rewrite functions, such as Apache.

Some are not easy to handle without a front-end. However, the front-end is the standard for Web sites, and logs, cache, compression, and protection are performed on the front end. To make the web site run better and faster, you need to let it do as little as possible (essential business processing.

6. Some people say that this is not scientific enough. We can split it into four independent IIS sites.

Splitting to 4 IIS sites is a solution that can better isolate and reduce mutual impact.

However, this premise is worth splitting. For example, if the performance reaches the bottleneck, the traffic for a single business (partition) is too large, and different teams maintain different businesses (partitions ).

You need to know that maintaining one person to maintain one site is different from maintaining four sites. You need to deploy the same code to four different sites. In reality, we will develop countless products (businesses). Some products have very small access volumes, but cannot be deprecated. The reason why low-traffic products cannot be deprecated is not the scope of this article.

7. Some people will say that the tmp site you added is a ghost. Is it permanent?

Here, tmp is just an example. In reality, it is also possible to use other names. After all the temporary versions are merged, you can update all the latest versions to this site or return to the original site.

This method can be called "AB". Sometimes it uses version A and sometimes B, sometimes the AB version coexist (you need to note in the maintenance document which functions are on which version site ).

If the demand conflict is particularly serious, what's wrong with a temporary site of Version C or version D? Solving practical problems is the most important thing. We can't always wait for everyone to merge the versions and launch them together. Is it more efficient for many updates to have multiple versions?


Related Article

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: 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.