November 19, 2020

Asset has_many attachments with Shrine per account

Erik here. :wave:

I've been working on the problem area of an asset having multiple attachments assigned to it on a per-account level basis. 

Currently, the basic idea of attachments and assets is wired up and semi-reusable with StimulusJS and Shrine. Our development setup is just like what our production environment will be, we have an upload endpoint, we receive a file object upon successful upload. We'll just have a separate endpoint which our StimulusJS will consume.

I've been wanting to do a deep dive into Shrine on the 'ol blog to help formulate my thoughts and understanding of this setup. It utilizes quite a bit of non-standard plugins that are offered via Shrine but not widely covered on the internet.

We were faced with making a decision around whether or not to have a Digital Ocean Space per account or to have one DO Space. Our infrastructure whiz Ahad felt we could benefit longer term if there was way to keep account attachments as separate DO Spaces. This would be made possible by Shrine's default_storage and dynamic_storage plugins.

Tomorrow begins the playing in default_storage and dynamic_storage land. Wish me luck.

Comments

Sign up or login to comment
Mark
© 2021 12in12