Retreat minutes 3. C # 's structured storage capabilities and applications in web development

Source: Internet
Author: User
Tags file size zip

This time, I'm going to talk a little bit of a profound topic: structured Storage (structured Storage).

Maybe someone's going to wonder why I've been studying that thing, isn't it a handyman? Do you have to study these things? I'll tell you the reason.

The geographical Names Information system on my website contains 700,000 files, and so many documents are problematic to deal with, such as the following methods:

1. Does not have any caching processing at the service side, returns the page directly when the user accesses, in this case, the disadvantage is slow response, the Web server and database server pressure is very large, after all, map-related queries are usually more performance-intensive (as far as I know, the general map of the company's query engine is rarely based on SQL).

2. Save the cached file on the server side, in this way, the pressure of the database is small, but the cache of many files on the page maintenance is very troublesome things (the most troublesome is removed by FTP), and, in the folder too much of the file itself will have a considerable impact on the performance of the system.

Based on the above situation, My original step1.cn approach was to cache only the higher-ranking names, now the site upgrade I have 5G space can be used, so I intend to use the second set of methods, but not how long, million net actually notify me the number of documents exceeded the limit, I just know, in the file size limit incredibly only 50,000, if I change back to Ste The pattern of p1.cn, so much space is completely wasted, so I need a way to combine these files.

Here, what needs to be stated in advance is that this should be to wear down the performance of the server, I also hold a technical research ideas to play this, is still afraid to deploy it, because in the Web server on the use of this may be more strange, the performance of the server consumption, I have no bottom.

Now let's talk about structured storage, the so-called structured storage is to achieve a simple file system function, you can add deleted files or directories to the file system, and the physical file system is not very different, the main difference is that structured storage is ultimately to store all the files into a large file inside, This will enable me to achieve my needs.

With regard to structured storage, although I have gone through its use, but I am not an expert, if you want to learn more information, recommend the following articles and contact the blogger:

Structured storage based on COM + in 1.c# (Jianhua Zhang)

2. Structured Storage C # class library (BlueDog)

I was directly using the BlueDog of the library file, in the call, found a serious bug, will cause the file handle can not release the problem, the problem and the solution I will be attached at the end of this article, is currently preparing to contact BlueDog fix the problem.

With this library (to be explained, I used to be directly in the ZIP format, but later found that the zip file once generated, can not be modified, and I think zip will attach a compression and decompression process, should have a greater impact on performance, the following problem is to solve the site is how to use this library, Of course, this class cannot be used in the business because such architectures are unreasonable and seem to be from. NET architecture, you should use the VirtualPathProvider class (System.Web.Hosting) to implement (for example, write a class and inherit this VirtualPathProvider, Then register in the Web.config file, after the site used to System.IO.File place automatically by the custom class to handle, details can refer to the ASP.net 2.0 virtualpathprovider) But I studied the decision not to use, Because it's relatively cumbersome and inflexible, and I want to attach gzip directly.

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: info-contact@alibabacloud.com 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.