Database Research & Development

  • Home
  • NoSQL
    • NoSQL
    • Cassandra
  • Databases
    • Database Theory
    • Database Designing
    • SQL Server Coding Standards
    • SQL Server
    • PostgreSQL
    • MySQL
    • Greenplum
    • Linux
  • Interviews
    • SQL Server Interviews
    • MySQL Interviews
    • SQL Puzzles
  • DBA Scripts
    • SQL Server DBA Scripts
    • PostgreSQL DBA Scripts
    • MySQL DBA Scripts
    • Greenplum DBA Scripts
  • Home
  • Blog Archives !
  • (: Laugh@dbrnd :)
  • Contact Me !
sqlserverinterviews
Home 2015 September The truth about to store images into the Database System or into the File System

The truth about to store images into the Database System or into the File System

This article is half-done without your Comment! *** Please share your thoughts via Comment ***

As a Database Architecture, this is my responsibility to write and share my knowledge on which one is best option to store images either into the Database System or into the File System?

I found this is most asking questions by Database Professional.
Let me discuss the all truth about these both option so Database Professional can take the right decision.

” The truth about to store images into the File System “

Store image into the File System and store the only path of that image into the Database System.

You can serve this images or pictures as static files across the network.

The Operating System can easily cache the image data for better access performance.

The management of files in the File System is very important, You have to manage proper folder structure, different schedule for taking the backup of all files.

If you are planning to migrate your application from one server to another at that time you also have to take the backup of not only image files, but you have to also maintain the same folder structure and path structure.

This is not advisable to store more than 3000 files into one folder, after some number of limit you should create a new folder for further files and this is advisable for performance aspect.

You can write an automated program to create the new folder structure.

The thumb rule of RDBMS is data integrity, If you are storing images in the file system, the image data disconnects with a database system.

You should also take care about a security of file directory, if someone deletes your image files, your application should throw an error like “Image is not found”.

” The truth about to store images into the Database System “

You can create a separate table or column for BLOB data type in which you can store images.

You can manage proper data integrity within the database system.

You need only one system to manage and perform any action like migration, replication.

You can take a full database backup with included all the image data, but this will take more time depends on the size of image data.

You can also commit image data like any other data.

The storing images into database system are very resource consuming.

Imagine, If you stored millions of images in the database and each size is around 60 KB, you have to use your SELECT statement properly otherwise this will create performance issues. You cannot put SELECT * in such a condition.

The image data is more secure in the database system because you can easily manage different privileges for users.

You can also create a dedicated server, database, schema for image data just like any other file server system.

If you are using SQL Server 2008, one new FileStream data type gives a very good optimized approach for storing files in a database system.

” Conclusion… “

You should take decision basis on your system complexity and scalability. I would suggest you go with File System. The Database Storage is not advisable, but still, people are using it.

Above are my views and concerns, but you should take a decision base on all the above facts.

Sep 5, 2015Anvesh Patel
Difference between datetime and timestamp in MySQLImportant MySQL and Ubuntu Console Commands
Comments: 2
  1. maryann
    January 18, 2016 at 5:29 pm

    Hi there! This post could not be written much better! Looking through this article reminds me
    of my previous roommate! He continually kept preaching about this.
    I most certainly will send this post to him.
    Fairly certain he will have a good read. Many thanks for sharing!

  2. Lassy
    February 13, 2016 at 7:56 pm

    I got what you intend,bookmarked, very nice website .

Anvesh Patel
Anvesh Patel

Database Engineer

September 5, 2015 Database DesigningAnvesh Patel, blob, database, database concept, Database Design, database research and development, database standards, Database Theory, database topic, dbrnd, FileStream, Image, RDBMS
About Me!

I'm Anvesh Patel, a Database Engineer certified by Oracle and IBM. I'm working as a Database Architect, Database Optimizer, Database Administrator, Database Developer. Providing the best articles and solutions for different problems in the best manner through my blogs is my passion. I have more than six years of experience with various RDBMS products like MSSQL Server, PostgreSQL, MySQL, Greenplum and currently learning and doing research on BIGData and NoSQL technology. -- Hyderabad, India.

About DBRND !

dbrnd

This is a personal blog (www.dbrnd.com).

Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity, unless explicitly stated.

Feel free to challenge me, disagree with me, or tell me I’m completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or anonymous comments) - so keep it polite.

The content of this website is protected by copyright. No portion of this website may be copied or replicated in any form without the written consent of the website owner.

Recent Comments !
  • Anvesh Patel { Sure will do... } – May 27, 12:43 PM
  • Anvesh Patel { Great... } – May 27, 12:41 PM
  • Anvesh Patel { Great... } – May 27, 12:39 PM
  • Anvesh Patel { Great... } – May 27, 12:36 PM
  • Anvesh Patel { Great... } – May 27, 12:28 PM
  • Anvesh Patel { Great... } – May 27, 12:27 PM
  • Anvesh Patel { Great... } – May 27, 12:16 PM
  • Older »
Follow Me !
  • facebook
  • linkedin
  • twitter
  • youtube
  • google
  • flickr
© 2015 – 2019 All rights reserved. Database Research & Development (dbrnd.com)
Posting....