5 Replies Latest reply on Jun 16, 2009 10:34 AM by Sameer Ravindra

    Best Practice: Outputting image resources?

    Brandon Simpson Newbie

      I'm using Seam and IceFaces to build a commercial website. Although I think I understand the basics of Seam pretty well and have been making good progress, I'm finding that I have a lot of questions on how to implement more advanced features. I'd like to start some discussions on best practices and see if anyone has any experiences, ideas, thoughts, or pitfalls, they might be willing to share.

      I want to be able to output images that have profile pictures of my users and am trying to figure the most efficient way of doing this.

      My initial thoughts were that I want to store all the images in the database so that they would be backed up in database backups and would also be centrally available to all my app servers should I use clustering in the future. I worry, however that this would also be taxing on the database, so my initial thoughts are that I would use the local file system on each app server as a cache. So in other words, when a request comes in, I would look for the image resouce on the local file system first, and only if it doesn't exist, I would read it from the database and create it on the local file system. Anyone done something similar to this?

      Aside from where to get the image, I also have concerns about efficiency on providing that resource. Is the seam resource servlet more or less efficient than letting a default web server or some other specialized servlet serve up the images if they are on a local file system? Any ways to speed this up? Any concerns in regards to memory usage?

      Thanks in advance!