markevans / dragonfly-s3_data_store

S3 data store for the Dragonfly ruby gem
MIT License
62 stars 58 forks source link

Read file from secondary buckets, when it doesn't exist in primary #13

Closed wpiekutowski closed 9 years ago

wpiekutowski commented 9 years ago

With this pull request, user can specify a list of buckets that will be used as a fallback, when requested file can't be found in the primary bucket. This is useful when you don't want to copy your whole production bucket to staging every time you decide to run staging from a copy of production database. In this case, on the staging server, you set production bucket as a secondary bucket. Writes will only go to the primary bucket, which, in this case, is staging.

markevans commented 9 years ago

Thanks I see the use case, though I think it doesn't belong here - rather it could belong in the main dragonfly repo as it's a more general thing (wouldn't just impact s3 datastores) Also, I'd rather not start complicating code with secondary datastores etc. - at the moment it's very simple. Maybe a better/simpler way would be to have a hook somewhere in the dragonfly code that the user can manually say what to do when it gets a NotFound error

wpiekutowski commented 9 years ago

That's an interesting idea. Something like a secondary_datastore configuration DSL?

On 4 August 2015 at 12:15, Mark Evans notifications@github.com wrote:

I see the use case, though I think it doesn't belong here - rather it could belong in the main dragonfly repo as it's a more general thing (wouldn't just impact s3 datastores) Also, I'd rather not start complicating code with secondary datastores etc. - at the moment it's very simple. Maybe a better/simpler way would be to have a hook somewhere in the dragonfly code that the user can manually say what to do when it gets a NotFound error

— Reply to this email directly or view it on GitHub https://github.com/markevans/dragonfly-s3_data_store/pull/13#issuecomment-127556804 .

markevans commented 9 years ago

actually I was thinking something more generic, like what to do if it gets a not found. It could read from a secondary datastore if the user wanted, or it could do something else like provide a default placeholder, or it could look in another bucket if needed - it would be up to the user. I'll open an issue in dragonfly if you like

markevans commented 9 years ago

https://github.com/markevans/dragonfly/issues/405

wpiekutowski commented 9 years ago

Awesome, thank you!