Archiving and restoring assets in Cloudinary
Overview
When a product is marked as unapproved in Hybris because we will no longer sell it, we want to archive all of the assets associated with that product. This means moving the assets from Cloudinary to cold storage to enable us to keep our DAM lean. There have been instances where products that have been unapproved for years have been reapproved unexpectedly, so we also need to implement a restoration workflow for any assets that have been archived. This is a record of the architecture that we have chosen for the archive and restore workflows.
Status
Accepted
Context
Currently we have no cleanup process for assets associated with unapproved products. This means that we are storing assets in Cloudinary (and previously Amplience) that are unlikely to ever be used again. This costs us money, and bloats our DAM making it less easily searchable. We need to implement an archive workflow to keen our DAM lean, by cleaning up assets that are no longer in use and sending them to cold storage. Cold storage is a storage class in AWS S3 that is more cost effective than standard storage, but has a longer retrieval time than other classes.
To ensure that stakeholders are kept up to date with assets that are being archived, we will use Slack messages to let them know which assets will be archived after they have unapproved a product in Hybris. Once they unapprove a product in Hybris, a notification is sent to our middleware which then triggers the workflow detailed in the Decision section below.
All archived assets must be retrievable so that we can restore them in the case that they are needed again. For this we have implemented the restore workflow which uses the same notifications mechanism to start off a middleware workflow, and uses Slack messages to keep stakeholders up to date throughout the process. Since the cold storage class that we are using had an average retrieval time of 5-8 hours, we wanted to make sure that stakeholders feel informed about when assets will be available to them.
Decision
Architectural diagram for the asset archive workflow, which is triggered by a notification from Hybris once someone marks a product as unapproved:
Architectural diagram for the asset restore workflow, which is triggered by a notification from Hybris once someone reapproves a previously unapproved product:
Consequences
- The cleanup of Digital Merchandising assets from Cloudinary is automated, immediately making it more effective than relying on teams to remember to maintain assets mannually
- Digital Brand could be using assets from the Digital Merchandising folders and if those assets are archived without hardcoded links being updated, it could result in broken links on site
- We have started work on another part to this workflow that includes Contentful our CMS, where we check if unapproved assets are being used in content. If they are found in some content, we unpublish that entry and tag it as "needs review"