Where is the file stored when it is created? Some options may be:
- Put the file in a database table (as an object or byte array) so it can be accessed by all nodes in a cluster
- Put the file on a shared filesystem (NFS, Samba, etc) and have each node look up the file on disk
- Either of the above + put the file in a replicated cache.
The option you choose will depend on a number of factors:
- How large is each file typically?
- How many different files do you have?
- How often is the same file accessed?
Answering these questions will help you gauge the viability of disk/JDBC access, in addition to caching the file in memory and replicating it across nodes.