Skip to content

Image File storage

Cdhaldane edited this page Jun 22, 2021 · 2 revisions

BLOB STORAGE

  • Better for smaller images
  • Bad practice but easier to integrate

FILE STORAGE

  • Better for larger images
  • The right way to store images

File: File tables are special type of tables which points to a folder within server and shows its content as rows within the table. We can configure File tables for non transactional access too in which case we can add images either through SQL code or by directly copying to the folder. The advantage with this method is that image will stored in file system itself and reference would be in the file table. You can also index table to make search operations faster and actual image can be fetched as file from the actual folder or accessed through SQL code in binary format

BLOB: image data would be stored in binary format within the database itself. So based on the size and quality of image db size may increase rapidly which will have effect on backup restore operations etc.

Either way, changes must be made to the database to allow BLOB types or another table for Images.

With how we have it set up I could not find much material on how to do it with file paths, as everyone uses PHP or web databases.

As for BLOB, it's as easy as storing as OBJECT.type(BLOB) and rendering a BLOB image, which still requires changing the database.

Since we are planning on storing multiple types of files such as images and videos; file storage is the most logical way to go.

Clone this wiki locally