Let's look at the main disadvantages of storing images in a database table:
- Images cannot be indexed without textual information - Images are large in size (Kb), and can inflate the database tables - Retrieving images from the database table requires passing the image to a separate script, which slows down your page load speed
To summarize, storing images in a database table requires more development and is a messy process. Ideally, you want to store images in a folder, and store the image names and captions in a database table. This way the image information can be indexed and searched, the database table uses up less space and displaying the information on your web page is a lot faster.
![]() We store all sorts of information in a database table, so why not store your images in the same manner? Well, the reality is that storing images in a database table is messy and the disadvantages convincingly outweigh any possible advantage. An image cannot be stored in a database table in it’s original format. Instead, it is stored as a binary large object, or a blob. Not every database supports blobs, and if you ever decide to migrate to a different platform, you might find yourself facing a major obstacle.
Published in
Development Blog
MiguelE-mail: This e-mail address is being protected from spambots. You need JavaScript enabled to view itLatest from MiguelAdd comment |


