I’m looking for cleaner way to horizontally scale my Java app with minimal impact in sources and infrastructure. Here is my problem: I’m currently saving resources in local file system, so i need to consistently share these files among all my new processing processing nodes.
I know the existence of ehcache and terractora server array but localRestartable (persistence guaranteed) is only available on ehcache enterprise and i want to keep commercial licenses as away as possible.
Other alternatives could be memcached, redis, mongodb (persistence in mind), even nfs, but i want the opinion of those who have experience using these services as storage services, also i need to clarify: Requirements prevent to use any on-line cloud storage service although i’m open to any alternative that could be installable on my data-center of course!.
I’m looking for cleaner way to horizontally scale my Java app with minimal impact
Share
With MongoDB you can take advantage of:
You have a few options for storing your binary files in MongoDB:
1) You could save the files as binary data within a field in a MongoDB document. The current document size limit (as at MongoDB 2.2) is 16Mb, which seems more than adequate for your ~1Mb files.
2) You can use the GridFS API to conveniently work with larger documents or fetch binary files in smaller chunks (see also: Java docs for the GridFS class).