Reputation: 103145
I have two web applications running in the same Tomcat Instance. In one of these applications the user will have the ability to upload files such as images and pdf files. I would like the uploaded files to be available to the second application.
Is there a best practice for such a scenario? Or just a pointer to a technology would be fine.
I considered using web services but wondered if it was overkill.
Thanks Vincent
Upvotes: 3
Views: 441
Reputation: 57325
Cheap, bad answer - have both applications softlink to a shared directory. This has the benefit of being stupid-simple to do but has evil transactional-type issues. Since you say that only one application is changing the data, and the other is read-only you might be able to get away with it, as long as the second app can't observe files in a partially created state.
Using a db is transactionally safe but is going to be pretty unpleasant as the files get larger.
Upvotes: 3
Reputation: 15225
I'd say it depends on how robust you need the file storage to be, and how transactional. The simplest way would be a shared directory that's on the classpath of both apps. A database would be a more robust, but more complex, solution.
Upvotes: 2
Reputation: 10379
You could shove the files into a shared database... this also lets you store meta data along with them.
Upvotes: 0