tags:

views:

53

answers:

2

So I would like to try using Heroku to be my server, however heroku does not allow writing to it's file system. Instead I need to use the database and something like Amazon S3 for storage of things like uploaded images.

The problem is that I often don't have internet access when developing. Or very poor internet access. So developing for Amazon S3 is kind of impractical. Is there an offline version to use so that my local machine can act as the S3 cloud, and when in testing/production environments I can use the real S3?

+1  A: 

My recommendation is to try s3fs with rsync. Here's how it would work:

  1. Mount your s3 drive to /mnt/sdaX/ on your production machine and /mnt/sdaY/ on your local machine.
  2. Create a file system at /mnt/sdaX/ on your local machine.

Make the changes on your local machine as needed. When appropriate, rync /mnt/sdaX/ to /mnt/sdaY/ on your local box.

I realize that this is complicated, but I'm not sure that there's really any other way to do it while maintaining the same configuration in both places. Normally I'd say you should just write to the s3fs drive locally with local caching enabled, but I'm not sure what happens when you return online (I'm pretty sure it doesn't sync, but I've gone ahead and asked s3fs developers).

Best,

Zach

Developer, LongTail Video

zach at longtail
I think it is rather the interface that is needed for development than the storage itself. So syncing the filesystems won't help developing against the S3 API when offline.
PartlyCloudy
I need to develop offline. I want my production to run online. The point being that I want to develop/test on the same APIs as production will use, except one is using S3 one is using local. If I was developing on an S3 accessible device 24/7 I would not care about this concern, so nothing to do with just synching.
Dmitriy Likhten
In this case, the file system *is* your interface. Rather than using an S3 specific API, you can just use the normal file system API, and s3fs will abstract the rest away.
zach at longtail
+1  A: 

Have a look at:

It might be some work to get them running, however. I finally wanted to write my own clone using node.js, but it has moved far away from the original S3 API, so it won't really help you anymore.

PartlyCloudy
I am not concerned with the S3 API as much as I am concerned with having a framework which will use S3 in production and let me do something offline while in development. Thanks thought I will investigate these. A link to your project?
Dmitriy Likhten