Should web application store images in Database or File system?
As a web developer storing images in the file system would be the easiest and it is the best way. If the images are stored in the database then below are its disadvantages
- On request, the specified file has to be retrieved from database and temp file should be created, which would be referenced in the generated html. This is a time consuming task and it will delay the page load.
- In database, the image data would be stored as BLOB or IMAGE. If a particular record doesnot have any image then also it will consume certain space. To avoid this images should be stored in separate table and it should be accessed via foreign key.
- In shared hosting environment, where the database, disk space, web servers and other tools would be provided by the service provider, the database space would be very much limited and it is good option to utilize the file system. In case virtual private hosting this may not be an issue.
- If multiple servers are required for load balancing then if the images are available in database then it would be easy to take backup or replicate the data.
- Databases are helpful to keep multiple versions of the images.
- It provides some security as against storing all the image files in the file system.
See also:
http://www.findbestopensource.com/tagged/database
http://www.findbestopensource.com/tagged/cache
Please post your feedback.
comments powered by Disqus
Related Articles
Open Source products used in Facebook
Facebook a leading social networking website predominantly uses open source technologies to build its application. Here is the list of open source products used and contributed by Facebook.
Open Source Technology Stack used in Opentaps ERP
opentaps Open Source ERP + CRM, is a fully integrated application suite that supports eCommerce, Customer Relationship Management, Warehouse and Inventory Management, Supply Chain Management, and Financial Management to Business Intelligence and mobility integration out-of-the-box. This article discusses about the open source software used to build Opentaps ERP.
Simple Mail Stack for Linux Hosted Environment
Email is the primary way of communication. Small organization which hosts their website / any other application from a third party hosting service providers may require this email stack.
Open source projects used to in Wikipedia
Wikipedia is a multilingual, collaboratively edited encyclopedia. It is one of the busiest site in the world. It has more than 8 million articles and accessed by millions of users around the world. This article briefly discuss about the open source software used in Wikipedia.
Zimbra - Enterprise Email Server Stack
Zimbra is a Enterprise messaging and collaboration software. It is a good alternative to Microsoft Exchange server. Zimbra is a Email Server but they have not written anything related to SMTP server, rather they have integrated well know open source email server in to its package. Zimbra is a system of well connected / integrated multiple open source software which delivers enterprise quality to it. This article explains most important components which helps to build the enterprise product.
Open source products used in Twitter
Twitter uses many open source products and also contributes most of the code to open source. Here is the list of open source products used by Twitter. This list does not include the projects sponsored by twitter.
Hadoop + HBase + Solr = Lily
Lily currently offers an open source content repository. It is the first cloud-scalable repository for social content applications. It is built from ground up using Big Data and NOSQL technology. Its technology stack includes Hadoop, HBase and Solr.
Open Source Technology Stack used in Magnolia CMS
Magnolia CMS is one among popular java based CMS. It has support of CMS, DMS, Wiki, Forum and lot more features. This article discusses about the open source software used to build Magnolia CMS.
Open source projects used in LinkedIn
LinkedIn is a social network for professionals. LinkedIn handles millions of searches as well as hundreds of thousands of updates daily. They sponsored many projects to open source. Here are the list of open source products used by LinkedIn.
Complete Email Solution for SMB
Email is most important in any organization. Lot of business are happening via Email. This article discusses about the end to end complete Email solution for an organization. What an organization requires? Email spam filtering, Email Server, Email Archiving and Email client. If all are open source then complete solution could be achieved free of cost.