Pages

Saturday, September 4, 2010

Storing image in File System or SQLite

That's the question that has been ask a lot, but if you google about it. It doesn't give a very definite answer. So here's the thing that I found out at the moment (Probably changed in time)

If your image is  < 1 MB Store it in SQLite. Because it will give you centralized and simple access to the images. And SQLite is still efficient handling blob with that size. 

If your image is > 1 MB just store the reference to the file in the database while the actual image is stored in the file system. Preferable the directory is relative to your current directory. 

The 1 MB limitation is derived from here, but some say 2 MB is still acceptable, i guess you just have to try it for your self.

No comments: