user644745
user644745

Reputation: 5723

cloudfoundry: how to use filesystem

I am planning to use cloudfoundry paas service (from VMWare) for hosting my node.js application. I have seen that it has support for mongo and redis in the service layer and node.js framework. So far so good.

Now I need to store my mediafiles(images uploaded by users) to a filesystem. I have the metadata stored in Mongo.

I have been searching internet, but have not yet got good information.

Upvotes: 6

Views: 977

Answers (2)

Vishal Biyani
Vishal Biyani

Reputation: 4407

Filesystem in most cloud solutions are "ephemeral", so you can not use FS. You will have to use solutions like S3/ DB for such purpose

Upvotes: 0

yfeldblum
yfeldblum

Reputation: 65445

You cannot do that for the following reasons:

  • There are multiple host machines running your application. They each have their own filesystems. Each running process in your application would see a different set of files.
  • The host machines on which your particular application is running can change moment-to-moment. Indeed, they will change every time you re-deploy your application. Every time a process is started on a new host machine, it will see an empty set of files. Every time a process is stopped on an old host machine, all the files would be permanently deleted.

You absolutely must solve this problem in another way.

  • Store the media files in MongoDB GridFS.
  • Store the media files in an object store such as Amazon S3 or Rackspace Cloud Files.

Upvotes: 10

Related Questions