I have an app running on a JBoss 4.02 cluster. A requirement of this app is that it must serve various files to clients. The files are mostly 60-80K, but there are a lot of them and they will be changed/added regularly. I have a number of possible solutions in mind but would like to hear what other people do in such situations.
1. Have a server set up as a content repository, Place files on it and have the cluster query this machine, making local copies if necessary.
PROS: Simple to set up and control
CONS: introduces SPOF, could lead to a bottleneck
2. Place files in JBoss farm directory and have JBoss far them out to other nodes. Use a background process ( maybe a custom deployer? ) to register chages and inform the app.
PROS: uses current JBoss processes
CONS: Leads to messy deploy directory ( maybe canbe cleaned up by making copies elsewhere?? ), ...
3. Place files as BLOBs in a DB.
PROS: simple, especially if using hibernate with JBossCache
CONS: Potential performance issues, dealing with BLOBs issues, ... ?
4. Let users upload files using a web interface. Store files in JBossCache and let it manage them.
PROS: Gives users control of their files
CONS: memory issues?, how do i organise these files, what if iwant query the number of files of a particular type in the system
Does anyone have ideas what a good solution would be? Anyone have any comments to make about any of the above possible solutions?
thanks
Just thought of a fifth possibility
5. Have a HA-Singleton service manage file updates/additions. other nodes can use this if they don't have a local cached copy
PROS: No SPOF, ??
CONS: too complex maybe, still need to write a lot of code