On Fri, Nov 27, 2009 at 6:04 AM, Thom Brown <thombrown@xxxxxxxxx> wrote: > I'm wondering if anyone has experience of storing and getting images to and > from a database? We currently have the problem of images being uploaded to > a single gateway used by many companies, most of which run several > websites. As it stands, once they upload the image, it then has to be > fsync'd to the appropriate servers (3-way in some cases) or accessed through > our image proxy. For our customer image hosting service, we store the master copy of everything in the database, and have an external process that pushes the (scaled) images to the front-end delivery service. Currently this is amazon's cloudfront service. The URLs that our customers can use/give out are all pointing to the cloudfront, which is wicked fast and scalable. We do not directly serve the images from the DB. That would just not scale. What I'd do is put a shim layer in front of the http service that gives out the image and looks for it in a cache. If not found, fetches it from the DB then every subsequent request gets it from the local cache on the http server. You could probably implement this shim as a 'file not found' error handler in apache, so there would be no overhead on a cache hit. -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general