Methods of storing images

6

I am studying how best to store some images of users that are registered to my system.

I found 3 ways to resolve this issue: Save to a local directory , Save as BLOB and Save as Base64 .

I would like to know the pros and cons of these options and which one would stand out from the others. And also if there is any other way to save those images.

    
asked by anonymous 10.11.2015 / 21:00

2 answers

1
  

Advantages of saving to a local directory: Does not use your bank's space   of data, but of the system's own storage area, this   storage is cheaper and       be simpler if you just need to save the image, just create a storage structure that fits your needs.

     

Blob storage advantages: If you have ample space   for database, this is a great method since you can   add additional columns to the saved image       containing more information about them, becomes easier to program because new programming languages bring tools that   storage and is also easier to organize because   are stacked in a DB.

     

About storage in BASE64: Not recommended by size increase   of the image by up to 25%, this method would be an alternative   transmission of the image.

    
11.11.2015 / 11:48
1

My answer is based on the following answers from dozens found in SOEN 1 2 3

Local Directory

  • Images can be easily cached when stored in the file system.

  • Keeping images in DB is more expensive than keeping it on a file system.

  • In terms of performance it is probably best to store the file in the file system and just type the file name or file path, and perhaps the mime type for the database.

  • Another reason to go to the file system is when you have to share your data (images or sounds, video, whatever) with third party access: in the case web application that uses images that have to be accessed from "outside" the local network in such a way that a database access to retrieve binary data is simply impossible.

  • You will not have problems with increasing DB load and connections that consume (which can be expensive for connections).

  • Database

  • The reason for storing binaries (images) in a database is the containment. When all the data is in a database, thus greatly simplifying your backup strategy.
  • 11.11.2015 / 12:12