Summary of processing strategies for pictures and long texts in Web applications

Source: Internet
Author: User
Tags file system html page sql mysql root directory tomcat
Web| strategy It is not difficult to recognize that image/multimedia and long style processing strategies in Web applications largely determine the performance and load capacity of one system.
    these days in the processing of pictures upload, but also consider the most reasonable for the picture and long text storage. Years ago, I like to put pictures and long text into Oracle, the purpose is to backup convenient, only need exp can be combined with the picture, do not take care of the directory. But the drawbacks also show up as the traffic increases: one is greatly aggravating the burden on the database server; Secondly, using blog/clog is not a standard SQL supported by SQL92, which complicates the development of persistent objects; Third, Oracle is not a database for storing files. Like his varchar2 can only support 4,000 characters, and the use of CLOB can not directly use the SQL display; it is clear that MySQL is a more appropriate file database; its text seems to have not found storage limits yet, and it is perfectly possible to use standard SQL reads and searches. For graphic data, the transaction is not important, convenient query and speed (meaning low load) more important, but it is to upgrade the use of Berklneydb, add transaction rollback and so on, become a painting tiger is not an anti-class dog. Oracle, however, should focus on the business-oriented situation where the reliability requirements of the transaction are high.     friends think that long text and pictures should be placed outside the database, through the connection reference, I think for MySQL, it is basically a document system, with a SQL interface, so the text is not necessary to save to the outside, In MySQL is the most appropriate. But the picture, needs the Special blog processing, cannot use the standard SQL, should put in the database outside, reduces the system the burden.      today's database usage and development paradigm is actually a step-by-step approach to object-oriented storage and processing, especially in Java (the main working language of middleware), whether it's hibernate or EE, Or my own dao/processor, are the Java object pool as a database object to the language platform extension, direct object-oriented storage instead of accessing specific data through SQL. Although the data object itself exists as a relational structure in the database, its details are hidden by the automatic initialization of the Java object. As a result, standardizing storage as much as possible (not with unique storage) can dramatically improve performance and simplify data-object programming, effectively improving its reliability. For this reason, it is a more reasonable choice to store pictures in a file system rather than in a binary database.       now my web platform is mainly using Apache_catalina, a platform that was used a few years ago, for a long timeNot used, in fact, it is not only changeable, but the document is extremely scarce--even I can not find the definition of the context object properties in Server.xml now. It was said that Apache's ability to handle static files is much stronger than Tomcat, but I've never understood how it identifies what files that Apache, what file that Tomcat is? Actually, I think the most important document is Worker.properties

INFO=AJP13 forwarding over sockettomcatid=localhost:8009[uri:/jsp-examples/*][shm:]disabled=1

If uri:/jsp-examples/*, like the above, believe that Apache does not use, basically is Tomcat bear all the burden. Obviously, if this is the case, the system is burdened, I mean the Java server, and it will be much more than it should be. The above configuration should be modified so that Apache, primarily HTML and graphics as well as multimedia downloads, rather than Tomcat, is expected to provide the load capability of this collocation system greatly.

...... Write here the day before yesterday, suddenly feel this configuration quite familiar, quickly go to check, sure enough now the project in the setting is this appearance, but further test let me a bit astray, for a while proved to be so, a moment to show that is the case. Software this thing if the lack of logical inevitable connection, people are nothing good to do. In any case, continue to the above ideas, like the configuration above, that all the/jsp-examples/* subordinate directory is to Tomcat processing, Apache does not work accordingly. The correct configuration should be: [uri:/jsp-examples/*.jsp][uri:/jsp-examples/servlet/*]

If you use struts like this, you probably need to add a suffix like *.action. This way, files that are not of this type will be handed to Apache. This setting: [uri:/*] is extremely risky, which means that all requests are responded to by Tomcat; however, it seems that Ajp13 has done preventative measures, in fact, Hou AJP13 put all the requests into the sewer, do nothing. The negative effect is the root directory of the virtual host I can not at any rate be able to directly identify index.jsp guidance. can only use HTML instead, but this is not a big deal, if it is a small home, you can turn on the spot, and if it is a large home page, itself will be converted to the regular output HTML page.

Obviously, using wildcards in this structure is the easiest to match, but it's also wrong.


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.