
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.