BlogsShopifyMedia Management System

Media Management System

Media Management System

1
posts
2020

This feature thread tracks the development and enhancement of Shopify's media management system, focusing on the addition of video and 3D model support alongside existing image capabilities. Initial efforts focused on supporting legacy image infrastructure while introducing new media types. A key challenge was deciding between a callback-based approach and a pipeline approach for handling complex data operations and ensuring transactional integrity. The pipeline approach was adopted to improve code control, maintainability, and separation of concerns, with individual handlers for each media type and a structured `before_transaction`, `during_transaction`, `after_transaction` pattern. This evolution aims to provide merchants with richer product showcasing capabilities while maintaining system stability and developer efficiency.

2020

Media at Scale: Callbacks vs pipelines - Shopify

7/9/2020

This post introduces a new capability for managing video and 3D model media alongside existing product images within the Shopify Admin. It details a technical decision-making process between using Rails callbacks and a pipeline approach for implementing this feature. The post argues for the pipeline approach due to its benefits in code control, maintainability, and separation of concerns, especially as complexity grows. It outlines the structure of the pipeline with `before_transaction`, `during_transaction`, and `after_transaction` methods for individual media handlers and a service entry point for consumers, emphasizing transactional integrity and reduced cognitive load for developers.