Should web application store images in Database or File system?

  •        0
  

We aggregate and tag open source projects. We have collections of more than one million projects. Check out the projects section.



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
  1. 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.
  2. 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.
  3. 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.
There are also some advantages to store the images in Database.
  1. 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.
  2. Databases are helpful to keep multiple versions of the images.
  3. It provides some security as against storing all the image files in the file system.
What is the best solution? You need to pick based on your requirement. If it is a single server then I would recommend to store images in file system. If you scale then store the images in database but cache it in file system. For first time the images will be loaded from database and after that the images are loaded from file system. This would be difficult as to ensure both database and cache are in sync.

See also:
http://www.findbestopensource.com/tagged/database
http://www.findbestopensource.com/tagged/cache

Please post your feedback.

Sponsored:
To find embedded technology information about MCU, IoT, AI etc Check out embedkari.com.


   


Subscribe to our newsletter.

We will send mail once in a week about latest updates on open source tools and technologies. subscribe our newsletter



Related Articles

Uber's open source technology stack

  • uber open-source stack technology-stack

Uber, a taxi aggregation platform operates around the globe. It was started as monolith application and later re-architected as bunch of microservices, which gives them scalability. Uber uses lot of open source tools and they have contributed quite a lot projects back to the community. This article is about analyzing Uber's open source technology stack.

Read More


Open source software used in SourceForge.NET

  • software-used sourceforge python

SourceForge.NET is most popular and widely used Forge. It helps to host software projects. It has integrated support for Wiki, Forum, Tracker and Full text search. The code base named allura, is completely built on open source stack. This article explains few important one used to build SourceForge.NET.

Read More


Open Source Products used in Tumbler

  • tumbler blog-stack software-used stack microblogging

Tumblr is a microblogging platform that allows users to effortlessly share anything. Tumblr now hosts over 70 million blogs with over 34 billion posts to date. Below is the list of open source used in Tumbler.

Read More


Open Source products used in Facebook

  • facebook opensource software-used technology-stack

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.

Read More


Simple Mail Stack for Linux Hosted Environment

  • email email-solution mail-stack mail

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.

Read More



Stackoverflow Open Source Technology Stack

  • stack software-used stackoverflow-architecture stackoverflow-stack

Stackoverflow is one of most widely used Q&A platform. It is the default choice of developers. It has over 100 million page views in a month and its Google page rank is 60. Check out its open source technology stack, the tools used to build such a popular website. Stackoverflow uses open source projects and also contributes to it.

Read More


Open Source Products used in Pinterest

  • opensource software-used stack

Pinterest is a tool for collecting and organizing things you love. It is a social networking site where users could pin images and write a note for that. It is now currently serving billions of pages every month. Check out the open source products used in Pinterest.

Read More


Open source projects used to in Wikipedia

  • wikipedia wikimedia opensource software-used

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.

Read More


Open source projects used in LinkedIn

  • linkedin opensource software-used technology-stack

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.

Read More


Open source products used in Twitter

  • twitter opensource software-used technology-stack

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.

Read More


Open Source Technology Stack used in Opentaps ERP

  • erp stack opentaps

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.

Read More


Zimbra - Enterprise Email Server Stack

  • software-used stack mail-server

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.

Read More


Open Source Technology Stack used in WhatsApp

  • whatsapp chat messaging-app

WhatsApp is a most widely used cross-platform mobile messaging app for iPhone, BlackBerry, Android, Windows Phone and Nokia. Users can send text, images videos, audio for free. It almost replaced SMS. It changed the way people interact with each other. Lets check out the technology behind WhatsApp

Read More


Open Source Technology Stack used in Magnolia CMS

  • cms software-used magnolia-cms technology-stack

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.

Read More


Hadoop + HBase + Solr = Lily

  • hadoop hbase solr content-repository data repository

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.

Read More