Online Upgrade of BS website (server communication)

Source: Internet
Author: User

Background: The company needs to add the online upgrade function to the customer Enterprise station. That is, customer login to their own site management background, the request to my company portal site, if there is a new version prompts the user to update. Customers from our company to buy the space, database, and website code can be directly based on smart prompts to complete the Webconfig configuration, later customers can purchase the template from our own website to achieve personalized style theme site settings. The website structure of all our clients is identical. Because the pages that the foreground customer browses are static pages that are automatically generated by the code, the update process does not affect guest browsing.

Analysis: The BS Architecture project differs from the CS architecture-the update package is returned after the request detects the version update, and the overwrite update is done based on the local installation directory, which I would call "a round-trip communication between the server and the client." The actual completion of the Web site update under the BS schema is to send the installation package of the server (my company's server) to the client server for overwriting updates, which I call "server-to-server communication".

Process and Summary:

At first, I thought of an opportunistic approach to this subject.

(1) Virtual directory

The site update is based on the premise that we know where our resource bundle (Bin folder and Web page folder) is located, and we know the installation directory under the customer's website. Map a virtual directory directly on the client server, point multiple sites to the same directory, and then update all sites indirectly by implementing a single site publication. Such a method is undoubtedly very deadly, and does not say that the customer's website is on the same server, only one main program crashes can cause all customer sites to be paralyzed.

Secondly, from the reality, I think of three solutions.

(2) File local physical files operation method

If the client server is on the same computer as our server, then the essence of the website update is to move the bin folder from the directory of our website to the customer's website directory to cover it. This method of copying files in batches is theoretically and technically feasible. It's worth mentioning that you have read and write access to the target folder. However, it also has a fatal flaw, that is, the client server and our server are not on the same host, we will be powerless.

(3) FTP upload method.

Users send an upgrade request containing their own identity information to our server, we resolve the recognition by FTP silently sent to the client server, to achieve coverage upgrade. The question to consider here is to get the user's FTP information, which is a trade-off through the needs of crossing. However, this approach was not accepted by the manager because some of the client sites chose the managed way and their sites were not assigned FTP.

(4) WebService and WCF

This is the way I finally chose and successfully implemented. Through the installation of Web services, physical file transfer, because each upgrade of the resource files within 30 trillion, so do not need to consider the large file transfer caused by the width of the occupation or file loss and other hidden dangers (simple to find information, large file transfer technology has matured).

function just implemented, related code post-collation. If necessary, we can share it with you.

Thank you very much for your love friends such as coding and cats, so I threw away some ideas and made some suggestions. The hard part of the process, the first manager denied me the solution, not to think that is not OK is considered too complex. The advice given is to refer to the CS application online upgrade, using a few lines of code found on the web to enable me to implement the function, but also let me refer to the common. NET FileUpload upload control principle. So far, I have no idea what can be referred to between the two places (crossing you need to know kneeling to tell me).

All of the above comments, welcome friends treatise. The next phase of the project will consider and resolve the "online upgrade failure processing".

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.