On Thursday, June 6, 2013 11:48:57 AM UTC-5, Hector Gonzlaez wrote:
Hello All,
Many times I have this kind of conversation, Do we have to store images in Database or it is better to leave them on FileSystem
I think if we are dealing with a Multimedia solution, then we have to store every Song, Movie, Picture, etc in the Database, otherwise we have to storage them on FileSystem
As far as I know, in terms of performance it is not recommended, to storage in Databases multimedia files, when it is not a Multimedia solution, but it is easier to Backup DB then multiple files on FileSystem.
In the other hand when an image is stored on DB we need to extract it either on memory or FileSystem, then display it.
I'm not certain that ADF handles files / images differently than other approaches, but I'll note a few things:
* In general, it's best in applications (like ADF apps) that you want to cluster to be heavily dependent on filesystems - you'll quickly run into the issue of 'which filesystem', as nodes in a cluster will be running on different file systems. So as a general rule, images that are part of your app (like those you include with af:image) will likely be part of your code base (Git / SVN) unless there is a strong need to change the images.
* Images that are part of a runtime (upload, etc.) should be stored in a database (or WebCenter Content!) to serve as a 'canonical' version with caching strategies applied to serve images from filesystems or even Content Delivery Networks. (Storing images in a database or content mgmt system will also give you some ability to recover crashed servers and/or spin up new ones - there's also the oft-employed solution of having a shared directory on an NFS mount or something similar shared across servers that could work for your scenario - but be aware of the pros and cons of relying on networked file systems and have a good backup plan in place. Talk to your operations group if you have one.)
Shorter advice: it's good to use a filesystem for serving 'static' content, it's not good to trust it.
Shorter advice #2: Don't serve multimedia from a 'single server' solution - long downloads can block web servers from creating child processes slowing things down for everyone. Use CDNs where you can - Amazon's "Cloud Front" (for example) can be set up to serve multimedia content more efficiently (and faster!) with streaming distributions than you can off of a local filesystem.