rails / activestorage

Store files in Rails applications
734 stars 60 forks source link

Supporting Additional Services #37

Closed jeffreyguenther closed 7 years ago

jeffreyguenther commented 7 years ago

Rather than clog #36 with an off topic discussion I have started a separate issue regarding the usage of gems to add support for additional services.

Having used thoughtbot/administrate that uses a similar approach for adding extra functionality to the dashboards, I think this approach works well for adding features. The only struggle I had with the approach was when they broke out a feature into a gem that really should have been in core. In their case, the image thumbnail view.

As long as the services that cover the majority of cases (as is the Rails way), I think you're golden. Like ActiveRecord, I'd like to see support out of the box for the most "popular services" So it just works. Wanna do something weird, you'll need to write your own service.

I think supporting S3, AWS, Azure, and OpenStack give you great coverage. OpenStack can provide the bridge to ton of niche services. The fog gem can be used for this.

With this position, I think we should also try to write a guide on how to implement your own service. As would be first-time rails contributor, I can take a stab at this as I attempt the OpenStack service. My extra green eyes might help bring the right things to the surface.

dhh commented 7 years ago

The plan is for Active Storage to ship with all the features in the box, like Active Record. But also, like Active Record, adapters for additional services should be done as external gems. Active Record ships with adapters for SQLite/MySQL/PostgreSQL in the box. Then everything beyond that is a gem. I'd like to continue with that.

For me, the adapters that make sense in the box for Active Storage is disk/s3/gcs/azure. OpenStack can be the first additional gem. Feel free to use activestorage-openstack as the name for that.

jeffreyguenther commented 7 years ago

Ok, I'd prefer it bundled, but I understand your position. 😀 Either way we can still provide the value to others.

Do you have a sense of how you'd like to make others aware that third-party services exist? Would you be interested in a PR for a "How to write a service" section for the README? Creating these services seems to me like it will be a little more common than writing an Active Record adapter. New cloud services seem pretty common.

dhh commented 7 years ago

Yeah, would definitely like to link up all the other adapters in the README. Also happy to have a section about how to write a service. Though we should start considering what the Rails Guide looks like for this. That's generally a better place to evolve in than just the README.

On Tue, Jul 11, 2017 at 5:38 PM, Jeffrey Guenther notifications@github.com wrote:

Ok, I'd prefer it bundled, but I understand your position. 😀 Either way we can still provide the value to others.

Do you have a sense of how you'd like to make others aware that third-party services exist? Would you be interested in a PR for a "How to write a service" section for the README? Creating these services seems to me like it will be a little more common than writing an Active Record adapter. New cloud services seem pretty common.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/rails/activestorage/issues/37#issuecomment-314484549, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAKtVGdA_jiNibleldD6OcVNScRq96Oks5sM5b9gaJpZM4OTkso .

jeffreyguenther commented 7 years ago

Sounds good.

My thought is to write the document in the style of a guide and include it in this repo for the time being. Then when the project is moved over to the main rails repo, we can move it into the guides folder. Does that work for you?

dhh commented 7 years ago

👌

On Jul 11, 2017, at 21:17, Jeffrey Guenther notifications@github.com wrote:

Sounds good.

My thought is to write the document in the style of a guide and include it in this repo for the time being. Then when the project is moved over to the main rails repo, we can move it into the guides folder. Does that work for you?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.