I'm in the process of updating a legacy system to use current technologies. One of my tasks was to allow the many different file-based projects to deploy as WAR files which tomcat would extract.

Now I'm having trouble with two projects in particular which contain so much media (over 20GB) that packaging them as WAR's would not make sense.

Should I simply leave these projects a file-based? or is there a work around so I don't have to jam the all the media into the WARs?

Changing the path in the code is not an option, it would be far too lengthy.

  • 1
    Throw the media on S3 and have the web server in front of Tomcat do redirects? – Michael Hampton Jul 28 '15 at 20:23
  • So have Apache's /htdocs hold the file and call on tomcat whenever it's needed? is that possible? – Native Jul 28 '15 at 20:25
  • It's a pretty standard way to set up a web server. – Michael Hampton Jul 28 '15 at 20:39
  • Do you know of any documentation for setting this up? – Native Jul 29 '15 at 13:20

In my experience(well, not only mine) - it is a very bad idea to keep any media files either in a databases or try to pack already packed files(JPG,MP3 is already squeezed) in WAR.

You will not free up a lot of space and loose ability to use static content caching mechanisms (usual case - nginx used to serve static content(read media, html and so on..). Filesystem is caching often accessed files and gives it out much faster than anything else. Besides of that, from the point of backups - if you keep media files separately from WAR app then incremental backups would be very effective but in case you holding all content in a WAR file, then any changes will trigger to dump all of its content again.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.