Forum: Ruby on Rails Storing images: filesystem or database?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Stephen B. (Guest)
on 2006-04-24 14:24
(Received via mailing list)
For a while i've been storing image in my PHP apps in the filesystem,
but with the potential for a Rails project coming up i thought it was
time for a review :0)

In everyone's experience, is it best to store uploaded images in the db
or just stick them on the filesystem with a reference in the db?

I've seen various performance tests and security arguments for and
against each method so it's difficult to know what's best.

Does anyone know which method Flickr use?  I'm assuming whatever they're
doing would be a good place to start :0)


David M. (Guest)
on 2006-04-24 14:30
(Received via mailing list)
Check the message archives for the pros vs. cons on this using Rails -
it comes up for discussion here every few weeks, and you might find
that everything has already been said that you'll be interested in.


Dave M.
Stephen B. (Guest)
on 2006-04-24 14:33
(Received via mailing list)
Probably should have done that before posting :0)


Hemant K. (Guest)
on 2006-04-24 17:02
(Received via mailing list)
I think...its always better to store images in file system...if the
can be large and can have several versions.....

last argument is...because suppose you use RMagick to modify the image
store it under some other name/dir.... for all these cases file system
This topic is locked and can not be replied to.