Blogs
Shopify logo

Shopify

Engineering blog · shopify.engineering

363posts0this week0watchers

Feature trails

139
Feature trailActive

Simulated A/B Testing with LLM Agents

Shopify has developed SimGym, a system that uses LLM-guided robots in cloud browsers to perform simulated A/B testing of storefront changes. This allows for rapid testing and validation of new themes and layouts, even for stores with low traffic, by mimicking real user interactions and shopping intents. The system leverages Browserbase for cloud browsers and an inference cluster for LLM agents, with ongoing optimizations focused on reducing inference latency and cost. Recent advancements include the development of ShopGym, which turns live storefronts into self-contained, resettable sandbox shops and generates shopping tasks tied to their products, features, and policies. This enables reproducible failure analysis, consistent agent comparison, and performance measurement.

5 posts · 2020–2026

Timeline

20202026
Feature trailActive

React Native App Clip Development

Shopify has transitioned its mobile applications from React Native to native development (Swift and Kotlin) by 2026. This decision is driven by advancements in AI coding models, which have significantly reduced the cost of maintaining parity between platforms. While React Native was successful in enabling cross-stack development and feature sharing, AI agents can now effectively implement features, translate between platforms, and assist with testing and review, diminishing the primary advantage. Helix is a toolset developed to facilitate this migration by breaking down the process into small, reviewable checkpoints and enforcing strict quality gates, including behavior tests, visual reviews using Gemini, and adversarial code reviews, before engineer approval.

7 posts · 2019–2026

Timeline

20192026
Feature trailActive

Application Security Program Development

Shopify has evolved its application security program by developing and enhancing an agentic code review and test oracle harness named Dispatch. This system uses multiple AI agents to discover vulnerabilities in software, prove them with real tests, and provide Shopify-tuned fixes. The harness is designed to be durable and outlast individual models, focusing on integrating with existing testing pipelines and producing actionable, context-specific pull requests for developers. It has been applied to large-scale applications, demonstrating cost-effectiveness and the ability to identify critical findings. The system emphasizes deterministic scripting for reliable outputs and robust partitioning strategies to optimize cost and accuracy.

2 posts · 2019–2026

Timeline

20192026
Feature trailActive

Internal Security Tooling and Automation

Shopify has developed and enhanced Hubble, an internal tool designed to encapsulate and extend various security tools, providing a unified interface for IT staff to manage inventory, device management, and security. It standardizes data from multiple systems, offers granular access control, and centralizes auditing for incident response. For end-users, Hubble provides device health and compliance information with actionable steps for remediation. It also serves as a single source of truth for se

2 posts · 2022–2026

Timeline

20222026
Feature trailActive

AI Assistant (Sidekick) Capabilities and Training

Shopify has developed and enhanced its AI assistant, Sidekick, by implementing a continual learning loop, optimizing prompt compression techniques, and introducing Just-in-Time (JIT) instructions to manage tool complexity. The system now uses Ground Truth Sets (GTX) and LLM-as-a-Judge calibrated against human judgment for robust evaluation, alongside LLM-powered user simulation for pre-production testing. Training has evolved to Group Relative Policy Optimization (GRPO) with N-Stage Gated Reward, addressing reward hacking through iterative improvements in syntax validators and LLM judges. Key takeaways emphasize modular architectures, robust evaluation frameworks, and vigilance against unexpected system failures.

4 posts · 2020–2026

Timeline

20202026
Feature trailActive

Test Selection and Optimization

Shopify has developed systems to optimize the testing process for large codebases, focusing on improving the stability and reliability of end-to-end (E2E) mobile tests. Initial efforts involved intelligently selecting which tests to run to reduce CI time. This has evolved to building an opinionated wrapper around Appium and WebdriverIO for mobile E2E testing. The new framework enforces strict testing patterns through a builder-style API that requires assertions with every step, preventing flaky tests. It also incorporates computer vision for element identification, moving away from reliance on Test IDs, and provides a unified CLI for running tests across different environments. The goal is to achieve high test stability and enable faster, more confident shipping of mobile features.

8 posts · 2017–2026

Timeline

20172026
Feature trailActive

Checkout UI Extension Modernization

Shopify is migrating its UI extension surface to remote-dom with Polaris web components, moving away from legacy React components and APIs. This involves upgrading extensions to newer API versions, adopting Preact for rendering, and rewriting codebases to TypeScript. The goal is to reduce bundle sizes, improve load performance, and ensure compatibility with future platform requirements. This initiative also includes developing custom, lightweight alternatives for large libraries like Liquid.js and dayjs.

1 post · 2021–2026

Timeline

20212026
Feature trailActive

Audio and Visual Experiences for Music Merchants

Shopify has developed and enhanced audio and visual capabilities for music merchants, including platform-level support for audio media types, a standalone app for release management, a tracklist player with a global audio singleton for continuous playback, custom GLSL shaders for real-time audio visualization, and a tour dates block with geolocation. The system leverages metaobjects and metafields as the data layer for releases, tracks, and tour information. This hackathon project demonstrates the technical depth in creating engaging visual experiences for merchants, including real-time data visualization and interactive elements.

1 post · 2025–2026

Timeline

20252026
Feature trailActive

Product Categorization System

Shopify has developed and enhanced its product categorization system by introducing an AI multi-agent system to continuously evolve the taxonomy. This system goes beyond static classification by actively improving taxonomy labels themselves, keeping the system agile and future-proof. It integrates actual merchant product data for real-world grounding, employs specialized agents for structural consistency and product-driven insights, synthesizes these insights intelligently, and detects complex e. This post details the evolution to a Vision Language Model-based system that leverages a comprehensive product taxonomy for granular understanding, attribute extraction, and description generation. The system employs FP8 quantization, in-flight batching, and KV cache optimization for inference efficiency. Training data quality is ensured through a multi-LLM annotation system with human validation. Future directions include migrating to a DAG structure for the taxonomy and enhancing metadata extraction.

6 posts · 2020–2026

Timeline

20202026
Feature trailActive

Hosting for Custom Storefronts (Oxygen)

Shopify has developed and enhanced its hosting solution for Hydrogen custom storefronts, known as Oxygen. This involves leveraging Hydrogen, a React framework for custom storefronts, and integrating it with cutting-edge technologies like React Server Components and component-level data fetching. This post details best practices for using React Server Components (RSC) within Hydrogen applications, emphasizing a default-to-shared component strategy, judicious use of client components for interacti. The MCP UI protocol extends MCP by returning a set of embedded UI resources, supporting inline HTML, remote resources, and Remote DOM for direct client-side rendering. This enables AI agents to augment their conversational flow with visual and interactive components, handling complex commerce UI elements like variant selection, bundle builders, and real-time inventory updates. An intent-based message system preserves agent control while components bubble up intents for the agent to interpret, facilitating rich user experiences. Adaptive styling allows components to match their host environment's brand guidelines.

10 posts · 2020–2026

Timeline

20202026
Feature trailActive

Internal Hosting Platform (Quick)

Shopify has developed and enhanced Quick, an internal platform for hosting static sites and providing backend services. Initially launched in July 2025, Quick allows employees to deploy folders of HTML and assets, receiving a secure URL accessible only to Shopify employees. It has since evolved to offer integrated backend services including a database, AI capabilities, file storage, data warehouse access, WebSockets, and an identity API. The platform has seen massive adoption, hosting over 50,000 sites and enabling AI-assisted site creation and sharing. The platform's philosophy emphasizes simplicity and embracing constraints, with a single VM supporting over 50,000 sites. Maintenance involves rate limiting for database usage and migration from Node.js to Go for improved memory management and parallelism. Quick fosters an emergent ecosystem of shared JS libraries and landing pages, with a focus on internal trust enabling features like open guestbooks and leaderboards without spam concerns.

1 post · 2014–2026

Timeline

…20172026
Feature trailActive

Structured AI Workflows

Shopify has developed and open-sourced Roast, a convention-oriented workflow orchestration framework designed for creating structured AI workflows. Roast interleaves non-deterministic AI behavior with deterministic code execution, using YAML configuration and markdown prompts to provide guardrails for AI agents. It supports various step types (directory-based, command execution, inline prompts, custom Ruby), built-in tools (ReadFile, WriteFile, UpdateFiles, Grep, SearchFile, Cmd, Bash), and a powerful CodingAgent integrated with Claude Code. Roast's session replay feature significantly speeds up workflow development. Internally, Roast has been used for test quality at scale, automated type safety with 'Boba', proactive site reliability monitoring, competitive intelligence aggregation, and a 'Chesterton's Fence' code research tool.

6 posts · 2022–2026

Timeline

20222026
Feature trailActive

Data Store Selection and Usage

Shopify has evolved its data extraction and warehousing strategies to address the limitations of batch-based CDC with Longboat. This includes developing a new change-event capture system that leverages Kafka for near real-time data ingestion and streaming transformations, enabling lower latency query response times for merchant analytics. The system aims to unify data extraction pipelines, improve data freshness, and ensure data quality by capturing hard deletes and intermediate states, moving towards a more robust and scalable data infrastructure.

23 posts · 2011–2026

Timeline

…20172026
Feature trailActive

Webserver Connection Handling and Request Dropping

Shopify has evolved its approach to managing webserver connection handling and request dropping mechanisms to improve application resilience under high load. This includes developing dynamic query rules for ProxySQL to reroute, rewrite, or reject database queries, and implementing a tool to manage these rules at scale across thousands of instances. The system incorporates a dry-run mode for query rules to prevent accidental data corruption or downtime, and employs exponential backoff for logging.

2 posts · 2013–2026

Timeline

…20172026
Feature trailActive

ML Experimentation Platform

Shopify has developed and enhanced its ML platform, Merlin, by adding online inference capabilities for real-time predictions, a model registry with experiment tracking (Comet ML), Merlin Pipelines for reproducible ML workflows, and the Pano Feature Store. This enables deploying and serving ML models at scale with low latency, supporting various ML libraries and offering state-of-the-art features like rolling deployments and autoscaling. The concept of full-stack data science is being embraced, and this post details the integration of real-time embeddings for improved search intent understanding using Dataflow streaming pipelines, addressing challenges in memory management, model loading, and batching for GPU-accelerated inference.

6 posts · 2021–2026

Timeline

20212026
Feature trailActive

Admin App Development Frameworks

Shopify is standardizing on Remix for Admin apps, enhancing the developer experience and performance. This includes modernizing the App Bridge to leverage web standards and custom elements, enabling seamless integration of web development practices and frameworks like Remix within the Shopify Admin. The migration of admin.shopify.com to Remix is a key step in this evolution, introducing route manifests for a single source of truth, leveraging Remix loaders for faster and more consistent page loading, and enabling AI integrations through Remix actions and zod schemas.

3 posts · 2022–2026

Timeline

20222026
Feature trailActive

GraphQL Batching for N+1 Problem

Shopify has developed and enhanced its GraphQL execution engine by introducing GraphQL Cardinal, a breadth-first execution engine. This new engine resolves each field once across all objects, rather than once per object, significantly improving performance for high-cardinality list queries. This addresses the hidden costs of depth-first traversal, such as linear scale amplification and field-level overhead, leading to substantial reductions in execution time and memory usage. The migration of a

2 posts · 2018–2026

Timeline

20182026
Feature trailActive

Recommender Systems for Merchants

Shopify has developed and enhanced recommender systems to provide personalized insights, actions, tools, and resources to merchants. Initial efforts focused on leveraging collaborative filtering and user-item interactions to predict item relevance. This post details the development of a foundational generative recommender system that learns directly from raw event sequences, operates within real production latency constraints, and delivers measurable impact at scale. Key advancements include architecture decisions, training strategies, and optimized CUDA kernels for efficient training and serving. The system uses time-aware attention with rotary encoding and relative attention bias, improved negative sampling strategies (shared negatives, positive-aware hard negatives), and a boosting-inspired approach for incremental recall. Online A/B testing showed positive movement in key metrics like shop orders, click-through rate, and conversion rate. Future work explores moving from product ID space to token space through semantic IDs for reduced embedding table dependence and better integration of text queries and assistant interactions.

6 posts · 2019–2026

Timeline

20192026
Feature trailActive

Multi-cloud GPU Orchestration

Shopify has integrated SkyPilot to manage multi-cloud GPU workloads, enabling engineers to define jobs in YAML and run them on available Kubernetes clusters across different cloud providers (Nebius, GCP). This includes a custom plugin for routing based on hardware requirements (H200s to Nebius, L4s/CPUs to GCP), fair-share scheduling via Kueue, and automatic injection of necessary configurations for specific hardware like InfiniBand. The system also supports development environments with dedicated.

1 post · 2026

Timeline

Feature trailActive

Universal Commerce Protocol (UCP)

Shopify has developed the Universal Commerce Protocol (UCP) as an open standard for AI agents to transact with merchants. UCP is designed with a layered architecture, separating core transaction primitives (Shopping Service) from major functional areas (Capabilities like Checkout, Orders, Catalog) and domain-specific augmentations (Extensions). It emphasizes discovery and negotiation of capabilities between agents and merchants, allowing for flexible and extensible interactions. UCP UI extends UCP to enable AI agents to interact with merchants through a user interface. This post details the protocol's escrow architecture, operators, and payment operations (authorize, capture, charge, void, reclaim, refund) to enable sophisticated, multi-step payment flows onchain, preserving crypto's advantages for real-world commerce.

2 posts · 2025–2026

Timeline

20252026
Feature trailActive

Responsive Visuals for Marketing Pages

Shopify has developed and enhanced its capabilities for creating dynamic and visually engaging real-time data visualizations for marketing events like BFCM. This includes optimizing 3D rendering techniques for large numbers of dynamic elements like order arcs and fireworks, implementing instancing for GPU-based rendering, and developing sophisticated camera animation and interactive features. The focus is on achieving high performance and visually rich experiences for showcasing global commerce. This post details the optimization of arc and firework rendering using instancing for GPU-based rendering, and the implementation of camera animations with a fix for the 'world flip' issue.

5 posts · 2015–2025

Timeline

…20172026
Feature trailActive

Unified Edge Traffic Management

Shopify has unified its edge network infrastructure with the introduction of Möbius and Shopify Front End (SFE). Möbius handles TLS and TCP termination close to the client, providing improved performance and DDoS protection. SFE acts as a unified routing layer behind Möbius, dispatching traffic to various applications and services. This initiative standardizes traffic paths, simplifies observability, and automates edge configuration for application owners, enabling faster feature deployment and improved resiliency. This post details the initial implementation of a scriptable load balancer using Nginx and Lua to handle high-write traffic during flash sales, introducing a leaky bucket algorithm and a queue page to manage customer experience and platform stability.

2 posts · 2017–2025

Timeline

20172026
Feature trailActive

Gamified Retail Experiences with IoT and POS Integration

Shopify has developed and enhanced capabilities for creating unique, gamified retail experiences by integrating IoT devices with their Point of Sale (POS) system. This involves building custom hardware-software solutions, such as a gamified treadmill that rewards participants with store credit, and developing POS UI extensions to seamlessly redeem these rewards. The system leverages custom software to process real-time data from IoT devices, manage game states, and integrate with the Shopify admin. This post details the implementation of a treadmill that prints store credit, including hardware (manual treadmill, POS hardware, receipt printer, displays, server, iPads), software (Python script for FTMS data, Remix app for displays and control panel, POS UI extension for redemption), and the gamification logic for pace-based rewards. The POS UI extension decouples redemption from the treadmill experience and enhances customer data by creating/updating records with session metadata.

1 post · 2025

Timeline

20252026
Feature trailActive

Resiliency Planning and Game Days

Shopify has evolved its resiliency planning and operational readiness, particularly for high-traffic events like Black Friday Cyber Monday (BFCM). Initial efforts focused on load and stress testing to identify system limits and regressions. This has evolved to include capacity planning based on traffic forecasts and historical data, with detailed resource estimations for key areas and buffers for flexibility. Scalability testing, including "faux" BFCM events like "Oktoberfest scale-up", is now a core part of the readiness program. This includes extensive Game Days simulating production failures at BFCM scale, cross-system disaster simulations, and load testing on production infrastructure across multiple regions. New challenges arise from preparing infrastructure that has not experienced holiday traffic, requiring systematic mapping of system behavior under stress and optimization of ETL pipelines and API layers. Scale testing validates the entire platform working together at BFCM volumes, revealing issues that only surface when everything runs at capacity simultaneously. The operational plan coordinates engineering teams, incident response, and live system tuning with real-time monitoring, incident response teams, merchant communications, and live optimization. Tools and processes developed for BFCM readiness, such as the Resiliency Matrix and Critical Journey Game Days, are permanent infrastructure improvements that enhance daily resilience.

15 posts · 2015–2025

Timeline

…20172026
Feature trailActive

Product Search Ranking Engine

Shopify has developed and enhanced its product search engine by introducing RankFlow, a Domain-Specific Language, and TurboDSL, a high-performance C++ execution engine. This system allows data scientists to deploy ML models (transformers, neural rankers, gradient boosting algorithms) trained on billions of queries with millisecond latency at scale, combining ML innovation with C++ performance. The system supports real-time indexing, retrieval, ranking, and experimentation, with features like privacy controls, multi-language support, and accessibility. The TurboDSL engine achieved a 48% speedup in ranking feature computation. Performance visibility on every PR includes detailed component-level timings and statistical significance testing.

1 post · 2025

Timeline

20252026
Feature trailActive

Search Algorithm Evaluation Framework

Shopify has developed and enhanced its search algorithms and the methodologies used to evaluate them. Initial efforts focused on improving search relevance within the Help Center. This post details a three-step framework for evaluating new search algorithms, encompassing data collection (Kafka events, annotation), offline metric evaluation (MAP, NDCG), and online metric evaluation (user interaction, scroll depth, search abandonment). The framework aims to provide a robust system for deploying ML

4 posts · 2021–2025

Timeline

20212026
Feature trailCooling

React Native Animation Performance

Shopify has developed and enhanced its use of React Native Skia, a library that exposes Skia graphics engine functionality to React Native. This involves leveraging Skia's primitives for custom drawings, animations, and visual effects, integrating tightly with react-native-reanimated for performant animations and react-native-gesture-handler for interactive gestures. The library enables the creation of advanced UI elements and dynamic user experiences beyond the capabilities of standard React Native. This post details the integration of WebGPU and Skia Graphite, enabling unified backend architecture, web ecosystem symmetry, and general-purpose GPU computing. It showcases the use of Three.js and React Three Fiber with WebGPU, the ComputeToys for compute shaders, and TensorFlow.js for machine learning. Architectural improvements to React Native Skia's reconciler and scene graph model have led to significant performance gains and expanded platform support to macOS, tvOS, and Node.js. Skia Graphite offers automatic threading and seamless 2D/3D composition.

13 posts · 2020–2025

Timeline

20202026
Feature trailCooling

React Native List Component Performance

Shopify has developed and enhanced FlashList, a drop-in replacement for React Native's FlatList, focusing on performance and precision. FlashList v2 is a complete rewrite leveraging React Native's New Architecture to eliminate the need for item size estimates, improve scrolling accuracy, and enhance horizontal list support. It introduces advanced scroll position maintenance, improved masonry support, and better web compatibility.

1 post · 2022–2025

Timeline

20222026
Feature trailCooling

API Idempotency for Payment Services

Shopify has established a robust API versioning strategy to ensure stability and predictability for its partners. This involves releasing new API versions quarterly with date-based names (e.g. 2020-01). The platform team builds the infrastructure and tooling to enforce this strategy, which includes managing breaking and non-breaking changes. Breaking changes require thorough impact analysis and stakeholder agreement, while non-breaking changes are tested for forward compatibility. The Payment Service has been enhanced with API idempotency to prevent duplicate charges and ensure reliable transaction outcomes, using idempotency keys, request locking, and a stepwise progress tracking mechanism for mutations.

6 posts · 2019–2025

Timeline

20192026
Feature trailCooling

Import Maps and JavaScript Module Loading

Shopify has addressed critical adoption issues with JavaScript import maps and module loading. Previously, modules could not load before the import map, and only one import map was allowed per document, causing conflicts and fragility. Shopify collaborated on a web platform-level solution that introduces a reconciliation mechanism. This allows for multiple import maps, modules to load before import maps, and resolves conflicts by merging new maps into a global representation while respecting aliasing. This post details the successful integration of Subresource Integrity (SRI) metadata into import maps, enabling integrity verification for imported JavaScript modules in Chromium and WebKit browsers, thus allowing the use of dynamic imports without shimming.

2 posts · 2024–2025

Timeline

20242026
Feature trailCooling

Shopify Mobile Hybrid Architecture

Shopify has developed and enhanced its mobile applications using a hybrid approach, combining native iOS and Android development with web technologies through the Mobile Bridge framework. This framework reinvents WebViews to improve performance, appearance, and integration, making web content blend seamlessly with native screens. Key improvements include preloading and caching WebViews for faster load times (reducing P75 from 6s to 1.4s), adapting Polaris components and hiding unnecessary UI elements. Future work involves rendering Polaris components natively from web code using remote-dom for greater flexibility and improved user experience.

12 posts · 2017–2025

Timeline

20172026
Feature trailQuiet since 2024

Mobile Tophatting Process

Shopify has developed and enhanced its mobile release process with the introduction of Tophat, a desktop macOS application that streamlines the tophatting of mobile changes. Tophat provides a seamless and interactive experience for testing pull requests on real devices or simulators without requiring local compilation. It integrates with CI pipelines to provide links to build artifacts, and includes a 'Quick Launch' feature for developers to easily grab the latest native builds. For iOS, Tophat leverages the `ios-deploy` utility and Fastlane's `match` for signing, enabling installation and debugging on real devices. The tool also supports attaching to local Metro bundlers for faster iteration on JavaScript changes.

5 posts · 2015–2024

Timeline

…20172026
Feature trailQuiet since 2024

Database Sharding and Pod Architecture

Shopify has introduced database sharding to horizontally scale its databases. To address the resilience issues arising from sharding, they developed a 'pods' architecture. Each pod is an isolated unit containing a set of shops and their dedicated datastores, along with shared resources like job workers and app servers. Crucially, there is no cross-pod communication, ensuring that a failure in one pod does not impact others. A 'Sorting Hat' component in load balancers routes requests to the appropriate pod. This post details how composite primary keys can mitigate deadlocks in high concurrency environments when updating data in sharded databases, by ensuring that gap locks required for updates remain within each process instance, dramatically reducing the chances of overlapping gaps.

1 post · 2018–2024

Timeline

20182026
Feature trailQuiet since 2024

Code Modularity and Boundary Enforcement

Shopify has evolved its approach to managing large codebases by transitioning from a monolithic architecture to a modular monolith. This involves re-organizing code by real-world concepts (e.g., orders, shipping) instead of software concepts (models, views, controllers), and enforcing strict boundaries between components. Tools like Wedge are used to track and enforce these boundaries by analyzing cross-component dependencies and API access. This initiative aims to improve developer productivity, reduce fragility, and simplify onboarding by decreasing coupling and increasing modularity.

10 posts · 2019–2024

Timeline

20192026
Feature trailQuiet since 2024

Storefront Rendering Performance

Shopify has extracted storefront traffic from the Rails monolith into a dedicated, single-purpose application to improve rendering performance. This involves designing on top of an active-active replication setup, reading from dedicated read replicas, and building on top of an active-active replication setup. The goal is to offer the fastest online shopping experience possible. This post details optimizations including MySQL multi-statement execution, a thin data mapping layer, book-keeping for Vitess integration, and the migration of the Shop app backend to Vitess for horizontal scaling of the MySQL database, enabling sharding and improved performance.

5 posts · 2020–2024

Timeline

20202026
Feature trailQuiet since 2023

WebAssembly Runtime for Extensibility

Shopify is exploring and implementing WebAssembly (Wasm) as a secure, performant, and flexible runtime for executing untrusted partner code on its own infrastructure, moving beyond browser-based use cases. This involves leveraging the Lucet Wasm runtime and compiling code from languages like AssemblyScript to enable extensibility for partners. Ruvy, a new toolchain built on top of ruby.wasm, further enhances this by pre-initializing the Ruby virtual machine and including Ruby files directly into

3 posts · 2020–2023

Timeline

20202026
Feature trailQuiet since 2023

ShopifyQL Commerce Data Querying Language

ShopifyQL is an accessible, commerce-focused querying language designed to empower merchants to explore their data without requiring deep technical expertise. It simplifies traditional data querying concepts like visualization, period comparisons, and commerce-specific date filtering. The language is supported by exploration data models tailored for commerce use cases, focusing on products, orders, and customers. Future development includes user-defined date ranges and enhanced period comparisons.

2 posts · 2022–2023

Timeline

20222026
Feature trailQuiet since 2023

YJIT Compiler for Ruby

Shopify engineers contributed to the upstream Ruby 3.1.0 release by developing and merging YJIT, a new just-in-time compiler. This post details the process of porting YJIT from C to Rust, highlighting the benefits of Rust's type safety and macro system for managing compiler complexity, as well as challenges with build systems and FFI. The team also explored Zig as an alternative. The Rust porting effort is ongoing, with plans to further decouple machine code generation and add ARM64 support. This work aims to improve performance for web and Rails workloads.

18 posts · 2015–2023

Timeline

…20172026
Feature trailQuiet since 2023

JavaScript Runtime for Shopify Functions

Shopify is expanding its Shopify Functions capabilities to support custom routing rules for order fulfillment. This involves leveraging Rust for default routing rules and enabling merchants to create their own rules using JavaScript compiled to WebAssembly (Wasm). The system utilizes a pipeline pattern for processing and a reducer for tie-breaking among rules. Future work will focus on opening up order routing for third-party developer-created rules. This post details the development of Javy, a toolchain for executing JavaScript in WebAssembly, addressing challenges with module size and the lack of dynamic linking in Wasm. It explores using QuickJS as the JavaScript engine and the trade-offs involved in compiling it to Wasm.

2 posts · 2023

Timeline

20232026
Feature trailQuiet since 2023

Ruby Execution Models and Threading

Shopify has evolved its Ruby execution models and threading strategies to optimize garbage collection performance within its monolithic application. Initial efforts focused on reducing the latency impact of the Ruby garbage collector (GC) by analyzing and tuning its behavior. Key developments include addressing major GC triggers like `:oldmalloc` and `:nofree` by adjusting GC limits and pre-allocating heap slots. The introduction of Ruby 3.2's variable width allocation necessitated a finely-grai

5 posts · 2019–2023

Timeline

20192026
Feature trailQuiet since 2023

Redux Toolkit Migration for State Management

Shopify's Retail Point of Sale app migrated from Vanilla Redux to Redux Toolkit (RTK) to reduce boilerplate, improve code readability, and streamline state management. The migration adopted a balanced approach, reusing existing logic while refactoring reducers and thunks to leverage RTK's features like immutable syntax and generated action creators. A hybrid approach was used for asynchronous logic due to GraphQL limitations with RTK Query, utilizing createAsyncThunk with ThunkAPI. Key learnings include the importance of explicit typing for hooks and the need for `unwrap()` on dispatch calls.

1 post · 2023

Timeline

20232026
Feature trailQuiet since 2023

Centralized Authentication Service (Identity)

Shopify has developed a centralized authentication service called Identity, built on the OpenID Connect (OIDC) specification, to manage user identities and enable single sign-on (SSO) across multiple stores. This involved synchronizing user data, migrating legacy accounts to Identity accounts, prompting users to combine accounts, and enforcing two-factor authentication (2FA). The system handles account merging, password updates, and prevents the creation of new legacy accounts, significantly reducing administrative friction and improving user experience.

2 posts · 2019–2023

Timeline

20192026
Feature trailQuiet since 2023

International Address Formatting

Shopify has evolved its capabilities for handling international address formatting. This includes developing a database of country-specific address formats, implementing dynamic form representation based on country selection, and creating a display representation that accounts for locale. An API endpoint provides synchronized data across applications, and abstraction libraries like '@shopify/address' simplify developer integration. Future work includes caching solutions to prevent network calls. This post details the initial efforts in internationalizing the platform, including addressing gendered languages, pluralization rules, hardcoded strings, character set limitations (MySQL utf8), and the development of a translation platform to automate the process of requesting and integrating translations.

3 posts · 2018–2023

Timeline

20182026
Feature trailQuiet since 2023

TypeScript Project References for Monorepo Performance

Shopify has developed and enhanced its use of TypeScript Project References to improve monorepo performance and developer experience. This involves breaking down large TypeScript codebases into smaller, more manageable projects, reducing editor initialization times and improving build performance. The migration is done gradually, starting with leaf nodes in the dependency graph and working upwards, with tools like TypeTrack developed to measure improvements. This approach encourages code modularity and a healthier codebase.

3 posts · 2020–2023

Timeline

20202026
Feature trailQuiet since 2023

Ruby Equality Implementation

Shopify has evolved its understanding and implementation of equality in Ruby, distinguishing between entities and value objects. This involves correctly implementing the `==` operator to ensure reflexivity, symmetry, and transitivity, and handling type coercion where appropriate. The focus is on predictable and correct equality checks to prevent bugs and align with developer expectations.

2 posts · 2022–2023

Timeline

20222026
Feature trailQuiet since 2023

Technical Debt Management Strategies

Shopify has evolved its strategies for managing and reducing technical debt within its engineering organization. This includes categorizing debt into Yearly, Monthly, Weekly, and Daily types, and implementing the '25 Percent Rule' to allocate engineering time: 10% for Daily Debt (improving code encountered during regular work), 10% for Weekly Debt (addressing smaller issues identified as separate tasks), and 5% for Monthly/Yearly Debt (intellectual work on planning and prioritization). The focus is on fostering a culture that encourages refactoring and continuous improvement.

1 post · 2023

Timeline

20232026
Feature trailQuiet since 2023

E-commerce Metrics Calculation

Shopify has evolved its systems and methodologies for calculating core e-commerce metrics. Initial efforts focused on defining and implementing foundational metrics like customer count, churn rate, and lifetime value. This post details the refinement of churn rate calculation, moving from simplistic and problematic accounting-based definitions to a more robust, timely, and current approach that uses daily customer counts and cancellations, weighted by probability of being active. The BG/NBD model is being explored for more advanced predictions. The post also clarifies the fundamental concepts of states and events, and how they relate to intervals and points, providing a theoretical basis for accurate metric calculation. It emphasizes starting with events for metric definition due to their less abstract nature compared to states.

6 posts · 2011–2023

Timeline

…20172026
Feature trailQuiet since 2023

Tax Engine Componentization

Shopify has evolved its tax engine by developing and enhancing the Tax Insights feature. This involves complex data modeling, creating new data models, handling dynamically changing tax laws and economic nexus thresholds, and publishing these insights to a key-value store for end-user consumption. The architecture leverages data extraction into a data warehouse (GCS), processing with Spark jobs, and serving data via Bigtable. This enables merchants to stay informed about their sales tax obligations.

2 posts · 2019–2023

Timeline

20192026
Feature trailQuiet since 2023

Shopify CLI Rewrite and Modernization

Shopify has rewritten and modernized its CLI from Ruby to Node.js, aiming to reduce system requirements, improve developer experience, and align with web technologies. The new CLI is built on a shared NPM package (`@shopify/cli-kit`) for consistency, embraces functional programming principles, and utilizes a monorepo structure for atomic contributions. Cross-OS support is ensured through dedicated modules, comprehensive testing, and clear instructions. Future work includes removing the remaining Ruby dependency for theme developers.

1 post · 2023

Timeline

20232026
Feature trailQuiet since 2023

HTTP Interaction Recording and Playback for Testing

This feature thread tracks the development and enhancement of tools and strategies for testing and debugging HTTP interactions. Initial efforts focused on addressing the challenges of managing complex Webmock stubs and testing intricate remote API operations. The introduction of the VCR gem provides a mechanism to record and playback HTTP interactions, offering a more accurate representation of API behavior compared to manual mocking. This enables more reliable and easier-to-debug tests, especially for complex or unpredictable APIs. The thread also covers advanced techniques like splitting collaborators into separate cassettes and using ERB in YAML files for dynamic content.

1 post · 2023

Timeline

20232026
Feature trailQuiet since 2022

GitHub Token Rotation and Management

Shopify has evolved its system for managing and automatically rotating GitHub Personal Access Tokens (PATs). Initial efforts focused on addressing the security and operational challenges associated with long-lived, manually managed PATs, such as vulnerability to developer churn, attribution difficulties, and lack of enforced rotation policies. The solution involves building a system that leverages GitHub Actions and GitHub Apps to transparently rotate tokens, reducing the security risks and operational overhead associated with manual management. This includes addressing cost implications of GitHub Actions billing and improving the reliability of the schedule trigger.

1 post · 2022

Timeline

20222026
Feature trailQuiet since 2022

Systems Programming Language Standardization (Rust)

Shopify has adopted Rust as its official systems programming language, alongside its continued commitment to Ruby for business logic. This decision is driven by Rust's safety, performance, productivity, and strong community. The company is investing in supporting Rust in its development and deployment processes, and aims to contribute to the Rust community and ecosystem. This standardization covers high-performance servers, Ruby extensions, and WebAssembly compilation.

1 post · 2022

Timeline

20222026
Feature trailQuiet since 2022

Apache Airflow Orchestration at Scale

Shopify has evolved its data pipeline platform from PySpark (Starscream) to a more efficient SQL-based workflow using dbt (Seamster) for reporting and common data tasks. This involved modularizing data model development, implementing unit testing with Great Expectations, and providing schema and DAG validation through temporary BigQuery datasets to reduce development time and improve the consistency of business metrics. The platform has also migrated its Kafka infrastructure to Kubernetes, enabling reliable cluster deployment with predictable and scalable performance, and has adopted best practices for containerizing Kafka and managing cluster availability.

7 posts · 2018–2022

Timeline

20182026
Feature trailQuiet since 2022

Server-Sent Events for Real-time Streaming

Shopify has implemented Server-Sent Events (SSE) to simplify its real-time data streaming architecture, particularly for the BFCM Live Map. This move from a polling model to SSE has significantly reduced data latency, improved performance, and streamlined the overall system by removing intermediate presentation layers and message bus bottlenecks. The new architecture leverages a Flink-based data pipeline and a horizontally scalable Golang SSE server, load-balanced by Nginx, to deliver data within milliseconds of its availability.

1 post · 2022

Timeline

20222026
Feature trailQuiet since 2022

Datadog Metrics Extraction and Analysis

Shopify has evolved its capabilities for extracting and analyzing metrics from Datadog. This post details a step-by-step guide for extracting Datadog metrics using its REST API and performing in-depth analysis locally in Jupyter notebooks, addressing limitations in Datadog's built-in visualization and analysis tools, and the granularity issues with long-term metric data.

1 post · 2022

Timeline

20222026
Feature trailQuiet since 2022

Server-Driven UI for Mobile Store Screens

Shopify has implemented a server-driven UI architecture for the Shop App's Store Screen, enabling dynamic and personalized merchant store layouts. This allows for flexible control over displayed sections and components, moving away from a purely client-driven approach. The system includes server-side template processing, data loading, and GraphQL layers, and a client-side component architecture. This post details the development of iOS widgets, focusing on native development with SwiftUI for analytics display, data fetching strategies using Reportify and ShopifyQL, implementing a short-lived cache to prevent excessive network calls and session kick-outs, and building a flexible UI to support multiple widget sizes and metric configurations.

1 post · 2022

Timeline

20222026
Feature trailQuiet since 2022

Marshal Serialization Replacement

Shopify has successfully migrated its caching mechanisms away from Ruby's Marshal serialization to MessagePack. This involved developing custom extension types for common Ruby objects like Date, Symbol, Time, DateTime, BigDecimal, and ActiveRecord::Base. The migration was phased, running both formats in parallel for six months, logging unencodable objects to identify necessary extension types and potential cache misuse. The new system uses a version byte prefix to distinguish between MessagePack

2 posts · 2022

Timeline

20222026
Feature trailQuiet since 2022

Apollo Client Cache Management

Shopify has evolved its understanding and utilization of the Apollo GraphQL client cache. This post details the internal workings of the InMemoryCache, including data fetching policies, normalization strategies (object breakdown, unique cache identifiers using `__typename` and `id` or custom `keyFields`, and flattening into a hash map), and the lifecycle of cached objects. It explains how the cache updates automatically when single entities or entire collections are edited and returned in mutation responses, and outlines scenarios where manual update functions or refetches are necessary for UI updates, such as when query responses are unrelated to cache changes, entire sets of changed objects cannot be returned, the order of response sets differs from the cached one, or items are added/removed from a list without returning the full list. The post also revisits an initial query example to illustrate a common cache misuse scenario related to missing fields.

1 post · 2022

Timeline

20222026
Feature trailQuiet since 2022

Trino Query Execution Performance Tooling

Shopify has evolved its approach to managing Trino query execution performance by developing custom verification, benchmarking, and profiling tooling. This framework, built as a lightweight Python library, standardizes testing procedures, extracts undocumented knowledge into code, and minimizes the risk of changes at scale. It supports use cases like replaying past queries, replicating real-time traffic, and utilizing standardized benchmarking frameworks like TPC-DS. The tooling integrates with Datadog for metrics extraction and analysis. The team also addressed issues with JVM settings, CPU and memory allocation, and cluster classes by creating workload-specific clusters and implementing lock contention limits.

1 post · 2021–2022

Timeline

20212026
Feature trailQuiet since 2022

Production Engineering Model

Shopify has evolved its engineering organization towards a Production Engineering model, inspired by industry practices like SRE and Facebook's Production Engineering. The goal is to unify development and operations responsibilities, reduce manual toil through automation and tooling, and improve self-service capabilities for feature teams. This involves building common infrastructure, shared operational responsibility, and world-class developer tools. The model aims to balance management support and empower feature teams with ownership and operational excellence.

7 posts · 2016–2022

Timeline

…20172026
Feature trailQuiet since 2022

Ruby Dependency Security and Analysis

Shopify has evolved its Ruby Dependency Security initiatives, focusing on analyzing the relationships between Ruby packages and their dependencies to identify potential security vulnerabilities and improve the overall security posture of the Ruby ecosystem. This includes efforts related to Multi-Factor Authentication (MFA) rollout on RubyGems, dependency analysis to uncover indirect vulnerabilities, and the development of tools and visualizations to understand these relationships. This post details the resolution of a dependency confusion vulnerability across over 600 Ruby applications by developing tooling to automate lockfile format upgrades and collaborating with the Bundler team to improve dependency management safety.

1 post · 2022

Timeline

20222026
Feature trailQuiet since 2022

Git Workflow and Best Practices

Shopify has evolved its Git workflows and best practices, with this post detailing the introduction of automatic deployment triggered by the GitHub merge button. This system, powered by Shipit and integrated with ChatOps (Spy), automates the deployment pipeline, resolving issues of deploy logjam and unshipped changes. The goal is to enable faster, safer, and more frequent deployments, reinforcing high expectations, trust, and fearlessness in developers. Future work includes further speed and stability improvements.

3 posts · 2011–2022

Timeline

…20172026
Feature trailQuiet since 2022

Development Methodologies and Practices

Shopify has evolved its engineering practices by emphasizing techniques that minimize code reading and maximize reliance on automated checks like the type system and linters. This includes strategies for finding entry points, making initial breaking changes, climbing the callstack with build errors, and updating recommended code during the downswing. The focus is on codifying standards in linters, leveraging the type system for stricter argument validation and exhaustive switches, and optimizing.

10 posts · 2010–2022

Timeline

…20172026
Feature trailQuiet since 2022

Compensation System Engineering

Shopify has engineered a new compensation system called Flex Comp, which allows employees to customize their total rewards allocation between base salary, RSUs, and stock options. This involved building a new user interface, establishing robust API contracts, and implementing advanced privacy controls for sensitive compensation data. Key technical challenges included secure eventing for analytics, managing large RSA key pairs for encryption, and designing an extensible front-end architecture to support future features like Shop Cash. The system also addresses regional regulatory differences and supports multiple languages and currencies.

1 post · 2022

Timeline

20222026
Feature trailQuiet since 2022

Android POS Receipt Printing

Shopify has developed and enhanced its Android Point of Sale (POS) application's receipt printing capabilities. This involved implementing a multi-step printing pipeline to handle diverse receipt content combinations, including data aggregation, content generation, and dynamic layout selection. The system aims to provide merchants with flexible and comprehensive receipt printing options. This post details the development of Android widgets for displaying merchant analytics, focusing on native de

3 posts · 2019–2022

Timeline

20192026
Feature trailQuiet since 2022

UI Performance Optimization

Shopify has developed and enhanced its UI performance across its admin interfaces. Initial efforts focused on understanding user flows and identifying performance bottlenecks through profiling. Key strategies include prioritizing the loading of components and data, memoizing expensive tasks, deferring non-essential components, prefetching resources based on user hints, and improving loading states with skeletons and stable content presentation. This post details the development of the Polaris Video component, which leverages the preload attribute to improve font loading times, reducing time-to-text-paint by 50% and eliminating FOIT.

9 posts · 2017–2022

Timeline

20172026
Feature trailQuiet since 2022

React Form Management Library

Shopify has developed and open-sourced the react-form library within its Quilt repository. This library provides custom React hooks, primarily `useForm` and `useField`, to manage form state and validation efficiently and safely. The library aims to simplify form development by offering smart defaults and reducing the need for manual state management with `useState`. It supports features like form submission handling, resetting form fields, conditionally enabling submit buttons based on form 'dirty' state, and implementing validation rules.

1 post · 2022

Timeline

20222026
Feature trailQuiet since 2022

Go Worker Pools for Event Processing

Shopify has evolved its event processing capabilities by implementing the Go worker pool pattern to control concurrency and improve performance. This has led to a significant increase in event processing throughput, enabling better preparation for high-traffic events and reuse of the pattern across different pipeline components.

1 post · 2022

Timeline

20222026
Feature trailQuiet since 2022

Cross-cultural code review communication

Shopify has evolved its strategies for effective communication during code reviews, particularly in cross-cultural contexts. This involves understanding how different cultural backgrounds influence feedback delivery and reception, moving from assumptions of politeness to explicit, curious, and context-driven communication. The goal is to shift the emphasis from confrontation to collaboration and from perfection to excellence, ensuring that the codebase and merchant experience are prioritized over interpersonal conflicts.

2 posts · 2022

Timeline

20222026
Feature trailQuiet since 2022

Delivery Date Prediction and Management

Shopify has evolved its capabilities for predicting and managing delivery dates for merchants and buyers. Initial efforts focused on building a platform for third-party logistics (3PL) providers to upload their pre-computed delivery dates. This involved creating new GraphQL APIs for 3PLs to integrate with the core Shopify platform and displaying these dates on product detail pages and at checkout. The Shopify Fulfillment Network (SFN) team developed a system to calculate and upload SFN delivery dates to the core platform, considering network, carrier, and product data. This post details the factors influencing delivery dates (proximity, goods type, fulfillment center time, carrier time) and the strategy of producing multiple schedules shared across merchant SKUs. The system allows for real-time lookups of pre-computed delivery dates, which are then used during order fulfillment to ensure timely delivery.

1 post · 2022

Timeline

20222026
Feature trailQuiet since 2022

Cloud Development Environments

Shopify has evolved its cloud-based development environments, with a focus on the Spin tool. This post details the challenges and strategies for migrating the Shopify Fulfillment Network (SFN) codebase to Spin, highlighting the complexities of managing dependencies, handling frequent code changes that cause regressions, and the human factors influencing adoption. The team focused on enabling core validation flows to transition from a 'Spiral of Struggle' to a 'Loop of Happy Equilibrium' where developers can efficiently work with complex, multi-repository projects in the cloud.

1 post · 2022

Timeline

20222026
Feature trailQuiet since 2022

React Stable Values and Performance

This feature thread tracks the development and enhancement of understanding and implementing stable values in React, particularly within the context of functional components and hooks. Initial efforts focused on identifying common pitfalls related to unstable values in dependency arrays of hooks like `useEffect`, `useCallback`, and `useMemo`, as well as the performance implications of unstable inline functions used as components. The thread also delves into the nuances of memoization in React, covering the correct terminology and judicious use of `useCallback` and `React.memo` to optimize performance and prevent unnecessary re-renders.

1 post · 2022

Timeline

20222026
Feature trailQuiet since 2022

Message Classification Model for Shopify Inbox

Shopify has developed and enhanced its AI-powered message classification model for Shopify Inbox. Initial efforts focused on building a prototype using a data-centric approach and a pre-trained Universal Sentence Encoder model to understand buyer intent. This led to the identification of key areas like order status requests. Subsequent development involved creating a more robust taxonomy with over 40 topics, refining annotation processes, and fine-tuning a DistilBERT model for improved accuracy. This post details the development of a real-time buyer signal data pipeline using Apache Kafka and Apache Beam to surface relevant customer context—including active cart activities and order completion information—to merchants while they're chatting with their customers. The pipeline leverages Monorail and Change Data Capture (CDC) for data ingestion, Apache Beam for stream processing with windowing, timers, and stateful processing, and Google Cloud Dataflow for deployment. The system filters events and aggregates customer activities to provide real-time, high-intent buyer signals to merchants in Shopify Inbox, aiming to optimize sales opportunities and prioritize conversations.

1 post · 2021–2022

Timeline

20212026
Feature trailQuiet since 2022

Container Resource Management with Systemd and CGroups

Shopify has evolved its approach to container resource management, specifically addressing issues with systemd processes within containers not adhering to Kubernetes resource limits due to cgroup driver configurations. Initial efforts focused on containerizing applications and managing secrets. Subsequent development has focused on container resource management, addressing issues with systemd processes within containers not adhering to Kubernetes resource limits due to cgroup driver configurations. This post details a deep dive into a specific Linux kernel memory cgroup controller bug that caused inconsistent MySQL Pod startup times in KateSQL, leading to performance degradation. The investigation involved analyzing system calls, perf flamegraphs, and cgroup counts, ultimately identifying a cgroup leak. Mitigation strategies included node replacement and a workaround using `memory.force_empty`. The fix was confirmed by upgrading to GKE 1.18, which included upstream fixes for cgroup slab re-parenting bugs.

3 posts · 2014–2022

Timeline

…20172026
Feature trailQuiet since 2022

Bug Bounty Program and Security Vulnerability Management

Shopify has evolved its Bug bounty program and its role in managing security vulnerabilities. Initial efforts focused on establishing a security response program and evolving it into a bug bounty with HackerOne. The program emphasizes high minimum payouts, transparency in disclosure, and educational opportunities for researchers. It has led to numerous fixes and significant bounty payouts. This post details the program reaching the $1M USD milestone in 2018 and doubling the maximum bounty to $10,000 for critical vulnerabilities, and highlights the 'Invoice Swap', 'Sneaky Catfish', and 'Remote Code Execution' vulnerabilities as examples of the program's impact.

8 posts · 2017–2022

Timeline

20172026
Feature trailQuiet since 2022

Browser-based Virtual Hangout Platform

Shopify developed and enhanced Shopify Party, a browser-based internal tool designed to make virtual hangouts more engaging and fun. The platform allows employees to use 3D avatars to explore virtual worlds and connect through games, moving beyond traditional video chat fatigue. Key technical aspects include leveraging Unity WebGL for 3D rendering and Normcore for peer-to-peer networking and synchronized game state. Development focused on non-prescriptive gameplay, hop-in/hop-off friendliness, and ease of learning. Customization options for avatars were implemented through texture application and shaders. The project was completed in three months by utilizing third-party assets and custom character design.

1 post · 2022

Timeline

20222026
Feature trailQuiet since 2022

Maestro Orchestration Language

Shopify has evolved its Flow orchestration capabilities by introducing and enhancing Maestro, a domain-specific orchestration language. This involved decoupling the Flow editor and engine, implementing a new horizontally scalable engine for Maestro orchestrations, and creating a translation layer from original Flow workflows to Maestro. The system now supports at-least-once execution semantics for primitive calls, enabling fault tolerance and providing merchants with execution feedback. The Flow editor has also been re-implemented with a more flexible and expressive visual language that translates to Maestro orchestrations. This has allowed for the migration of all existing workflows to the new editor and engine, improving the overall automation and customization capabilities for merchants.

1 post · 2022

Timeline

20222026
Feature trailQuiet since 2022

Business System Integration Platform

Shopify has developed and enhanced its Business System Integration Platform, built on Ruby on Rails and leveraging Rails Engines for modularity. The platform prioritizes minimal, transparent, flexible, secure, and reusable integrations, eliminating data storage to avoid becoming a source of truth. It utilizes Actions for business logic and embraces Hashes for data manipulation, allowing for quick and reliable integration of diverse business systems. The platform also includes a command-line deve

1 post · 2021–2022

Timeline

20212026
Feature trailQuiet since 2022

Shopify API Data Manipulation

Shopify has evolved its APIs to allow for dynamic content injection into shop pages via Application Proxies. This enables third-party applications to serve content that is rendered through Shopify's Liquid templating engine, allowing for seamless integration of external data and functionality into the native shop experience. Security is maintained through signed requests.

5 posts · 2011–2022

Timeline

…20172026
Feature trailQuiet since 2022

Infrastructure as Code with Terraform

Shopify has adopted Terraform for managing infrastructure as code, enabling engineering best practices like testing, revision history, and automated rollbacks for third-party services. This initiative began with the Conversations team implementing a custom Terraform provider for Twilio TaskRouter, allowing business and support teams to directly manage routing configurations. The broader adoption of Terraform aims to empower non-developers with infrastructure management, free up developer time, and provide visibility into infrastructure changes over time.

1 post · 2022

Timeline

20222026
Feature trailQuiet since 2022

Liquid Render Performance Analysis

Shopify has evolved its Liquid rendering engine, Liquid-C, by introducing a VM and refactoring its bytecode instruction structure to remove the constant pointer. This change aims to improve performance by allowing for more flexible instruction pointer movement and reducing duplicate constants in the VM's constant array. While the initial refactor slightly increased memory usage and parsing time, it lays the groundwork for implementing If and For tags, which are expected to significantly boost rendering speed. The project is open-source and seeks community contributions.

2 posts · 2020–2022

Timeline

20202026
Feature trailQuiet since 2022

V8 CPU Profiler Integration for v8go

Shopify has evolved its v8go library by integrating the V8 CPU Profiler, enabling Go developers to measure JavaScript performance. This involved exploring and implementing both lazy and eager loading strategies for profile data, with performance benchmarks guiding the final implementation to optimize Cgo call overhead for larger JavaScript execution trees.

1 post · 2022

Timeline

20222026
Feature trailQuiet since 2022

Polymorphic Association Storage Strategy

This feature thread tracks the development and enhancement of strategies for managing polymorphic associations in Rails, focusing on reducing coupling between the codebase and the database. Initial efforts addressed the challenges of namespace changes breaking polymorphic associations. This post details a solution to stop storing class names as polymorphic types, instead using arbitrary strings. This allows for easier refactoring of class names and namespaces without database migrations. The solution involves overriding the `polymorphic_name` method and adjusting association scopes to handle both old and new `polymorphic_type` values during migration, followed by a cleanup task to remove the old values. The main benefit is reduced coupling between the codebase and the database, allowing for easier class and module renaming without database modifications.

1 post · 2022

Timeline

20222026
Feature trailQuiet since 2022

Deprecation Management Toolkit

Shopify has developed and enhanced its tools and strategies for managing code deprecations. Initial efforts focused on preventing developers from accidentally using deprecated code and addressing the challenges of complex dependency upgrades. The Deprecation Toolkit was introduced as an open-source Ruby gem that uses a whitelist approach to track and manage deprecations. It allows for gradual fixing of existing deprecations while enforcing stricter rules for new ones. This post details the iteration of this toolkit, including its use in gamifying deprecation fixing and its impact on dependency upgrade processes.

2 posts · 2018–2022

Timeline

20182026
Feature trailQuiet since 2022

DNS Traffic Management for Resiliency

Shopify has evolved its DNS traffic management strategies to improve service resiliency and availability. This has evolved into a fully automated, self-served system utilizing two DNS providers with layered traffic management capabilities, including geographical fencing, endpoint status health checking, priority-based failover, and weighted selection. The system aims to prevent outages caused by issues like expired root certificates in embedded client stores. The incident described highlights how the system has evolved from manual TLS certificate provisioning to a fully automated, cloud-integrated system that supports over 1M merchants, including the adoption of Let's Encrypt and the integration with cloud provider managed certificates, before returning to a unified approach using their own Notary system for both edge networks.

4 posts · 2019–2022

Timeline

20192026
Feature trailQuiet since 2021

Blog Post Curation and Technical Showcase

This post is a curated list of 10 popular engineering blog posts from 2021, covering a range of technical topics including web app development, performance optimization, compiler development, data analysis, database upgrades, search technologies, GraphQL, CI/CD, and mobile development. It also includes a bonus section of older, still popular posts. The post highlights the expertise of Shopify engineers and their contributions to the engineering community.

1 post · 2021

Timeline

20212026
Feature trailQuiet since 2021

E-commerce Platform Integration

Shopify has evolved its capabilities for integrating with external e-commerce platforms and marketplaces, specifically addressing challenges in synchronizing data between different domain models, communication protocols, and messaging styles. This includes handling asynchronous vs. synchronous operations, message ordering, and differing data granularity for entities like orders and refunds. The team has developed strategies to bridge these differences, such as persisting order data to resolve message ordering issues and retaining original order details to fill in missing item-specific refund information required by Amazon's API. The goal is to provide merchants with seamless data synchronization and order management across platforms.

4 posts · 2012–2021

Timeline

…20172026
Feature trailQuiet since 2021

MySQL Backup and Restore Infrastructure

Shopify has redesigned its MySQL backup and restore tooling to leverage GCP's Persistent Disk (PD) snapshot feature, significantly reducing the Recovery Time Objective (RTO) to under 30 minutes. The new system uses Kubernetes CronJobs for frequent, automated PD snapshots across all regions, minimizing data loss and enabling faster replica rebuilds. A robust retention policy manages snapshot storage costs. A verification process ensures data integrity by restoring and checking daily snaps. Offsite backups are also managed by exporting snapshots and archiving them.

1 post · 2019–2021

Timeline

20192026
Feature trailQuiet since 2021

Quantile Regression for Merchant Funding

Shopify has evolved its capabilities for assessing merchant eligibility for cash advances by applying machine learning techniques, specifically quantile regression. This allows for more nuanced predictions of future sales and risk assessment, ensuring that advances are structured for a high probability of repayment. The system aims to provide funding that balances risk for both merchants and Shopify.

2 posts · 2017–2021

Timeline

20172026
Feature trailQuiet since 2021

AI for Traveling Salesperson Problem

This feature thread tracks the development and application of AI and optimization techniques to solve complex routing problems like the Traveling Salesperson Problem (TSP). Initial efforts focused on addressing computationally hard problems and handling uncertainty in real-world scenarios. Shopify's optimization expert Meinolf Sellmann collaborated with colleagues to win first prize in both tracks of the AI4TSP Competition. The first track involved determining a tour that would work well on expectation, averaged over all possible travel time scenarios, using dialectic search. The second track allowed for building the tour on the fly at every location, taking into account elapsed time, using deep reinforcement learning. Key to both approaches is allowing the machine to learn from prior experience and adjust the program automatically, embodying the concept of self-programming machines.

1 post · 2021

Timeline

20212026
Feature trailQuiet since 2021

Database Replica Read Consistency

Shopify has evolved its approach to managing database replica read consistency. Initially, replication lag was a concern for read-heavy applications. The team explored tight consistency and causal consistency (GTID-based) but found them too complex or expensive. The chosen solution is a form of monotonic read consistency, achieved by modifying ProxySQL to route related read requests to the same replica using a consistent read ID (UUID) embedded in query comments. This ensures a co

2 posts · 2021

Timeline

20212026
Feature trailQuiet since 2021

ActiveRecord Model Caching

Shopify has evolved its caching mechanisms to improve performance and reduce database load. This includes developing custom write-through caches for high-traffic features like the Shop app's home feed, utilizing Memcached for its simplicity and low overhead. The system handles concurrent updates and ensures cache validity through a pending writes key and short-expiry keys, making changes transparent to developers via Active Record Concerns. Rollout strategies involve phased testing and comparison of cached vs. database data to guarantee correctness. This has led to significant reductions in database load, app latency, and overall CPU usage.

2 posts · 2013–2021

Timeline

…20172026
Feature trailQuiet since 2021

Swift Struct Copy Function

Shopify has developed and enhanced capabilities for creating immutable objects in Swift, inspired by Kotlin's data class copy function. This involves implementing a functional builder pattern to capture override values, allowing for convenient creation of new struct instances with modified properties while preserving original values. This pattern aims to reduce boilerplate code and improve the adoption of immutability in Swift codebases.

1 post · 2021

Timeline

20212026
Feature trailQuiet since 2021

Continuous Integration of Framework Head

Shopify has evolved its strategy for continuously integrating the latest upstream commits of critical frameworks, such as Rails, into production. This proactive approach involves living on the 'edge' of the framework's master branch, with automated tools for weekly integration, extensive CI testing against a large test suite, and a phased deployment strategy using canaries to mitigate risks. This builds upon previous efforts to upgrade major framework versions and manage the risks associated with long-running upgrades.

4 posts · 2016–2021

Timeline

…20172026
Feature trailQuiet since 2021

GraphQL Mutations for Data Manipulation

This feature thread tracks the development and implementation of GraphQL mutations for creating, updating, and deleting data within Shopify's systems. Initial efforts focused on understanding GraphQL queries for data fetching. This post introduces the concept of mutations as the mechanism for modifying data, detailing the process of generating mutation resolvers, defining input arguments, and handling the `resolve` method to interact with the database. It covers specific examples for creating, u

5 posts · 2019–2021

Timeline

20192026
Feature trailQuiet since 2021

API Versioning and Breaking Change Management

Shopify has established a robust API versioning strategy to ensure stability and predictability for its partners. This involves releasing new API versions quarterly with date-based names (e.g., 2020-01). The platform team builds the infrastructure and tooling to enforce this strategy, which includes managing breaking and non-breaking changes. Breaking changes require thorough impact analysis and stakeholder agreement, while non-breaking changes are tested for forward compatibility. This post discusses the challenges of applying RESTful thinking to processes, advocating for transaction-specific URIs (e.g., POST /orders/42/pay) over generic updates (PATCH /orders/42) to improve clarity, authorization, and validation. It emphasizes modeling processes as state machines and avoiding direct `update_attributes` calls in controllers to enhance security and prevent mass-assignment vulnerabilities.

1 post · 2012–2021

Timeline

…20172026
Feature trailQuiet since 2021

Pagination with Relative Cursors

Shopify has evolved its APIs to use relative cursor pagination, moving away from offset-based pagination to improve performance and scalability for large datasets. This involves standardizing pagination patterns and providing mechanisms for faster, more scalable data retrieval.

2 posts · 2019–2021

Timeline

20192026
Feature trailQuiet since 2021

Illustration Management and Discovery Tooling

Shopify has developed and enhanced tools and strategies for managing and discovering visual assets, specifically illustrations, across Shopify's large and distributed codebase. Initial efforts focused on the challenges of updating illustration styles and the fragmentation of assets across thousands of repositories. This post details the creation of `@shopify/get-repo-images`, an open-source tool built in Go, which enables illustrators and developers to efficiently find illustrations and their references in code across multiple repositories. The tool was rewritten from Node.js to Go for significant performance improvements, reducing build times from over 35 minutes to 8 minutes.

1 post · 2021

Timeline

20212026
Feature trailQuiet since 2021

In-Context Merchant Analytics

Shopify has evolved its capabilities for surfacing merchant analytics directly within their operational workflows in the Shopify admin. Initial efforts focused on establishing a dedicated Analytics section. This evolution brings key metrics and insights to contextually relevant pages, such as the Orders page, to enable faster, data-informed decision-making by reducing navigation between different sections of the admin. The process involves identifying relevant metrics, understanding data shapes for different merchant segments, prototyping with real data, and finalizing a data specification sheet for a single source of truth for queries. The development also includes designing datasets for new metrics, selecting an atomic grain of one row per event (fulfillment, in-transit, or delivery), and building a batch pipeline for initial data modeling before moving to streaming.

2 posts · 2021

Timeline

20212026
Feature trailQuiet since 2021

Development Methodologies and Practices

Shopify has evolved its engineering practices by emphasizing techniques that minimize code reading and maximize reliance on automated checks like the type system and linters. This includes strategies for finding entry points, making initial breaking changes, climbing the callstack with build errors, and updating recommended code during the downswing. The focus is on codifying standards in linters, leveraging the type system for stricter argument validation and exhaustive switches, and optimizing.

1 post · 2021

Timeline

20212026
Feature trailQuiet since 2021

Financial Calculations and Precision Management

Shopify has developed and enhanced strategies for managing precision loss in financial calculations, addressing the challenges of rounding and currency conversions. This includes implementing banker's rounding, using high-precision data types, ensuring consistency in rounding methods, and providing explicit documentation for stakeholders and users. The focus is on minimizing 'hanging pennies' and ensuring accurate financial outcomes.

1 post · 2021

Timeline

20212026
Feature trailQuiet since 2021

Feature Flagging and Rollout System

Shopify has evolved its system for safely deploying new features using beta flags and phased rollouts. This includes defining primitives like Subject, BetaIdentifier, BetaFlag, and BetaRollout, and implementing a digest-based percentage rollout mechanism for consistent growing sets of subjects. The system also introduces a higher-level 'Feature' abstraction to manage complex qualification changes and provide kill switches for immediate rollback. Considerations for data structure differences, rollback disruption, and avoiding BetaIdentifier reuse are also addressed.

1 post · 2021

Timeline

20212026
Feature trailQuiet since 2021

GCP Project-Wide SSH Key Management

Shopify has evolved its approach to managing SSH keys within Google Cloud Platform project-wide metadata. Initial efforts focused on addressing the security risks associated with persistent, unmanaged SSH keys, which could lead to unauthorized access and security vulnerabilities. The development of SSH-Pruner aims to automate the management of these keys, ensuring they do not persist longer than necessary and distinguishing between Shopify's keys and Google's infrastructure keys. The tool iterates through projects, identifies SSH keys in project metadata, and removes those without valid expiration dates, while preserving unexpired keys and Google's infrastructure keys. This ensures keys do not persist longer than necessary and minimizes impact on developer workflows.

1 post · 2021

Timeline

20212026
Feature trailQuiet since 2020

Ruby Static Typing with Sorbet

Shopify has adopted and is scaling the use of Sorbet for static typing in its Ruby codebase. This involves addressing challenges with metaprogramming, ActiveSupport::Concern, and inclusion requirements. The team is also exploring the relationship between Sorbet, RBS, and Tapioca for generating type signatures. The focus is on gradual adoption, starting with `typed: false` files and moving towards `typed: true`, prioritizing frequently reused or error-prone files. Generated RBI files are checked.

1 post · 2020

Timeline

20202026
Feature trailQuiet since 2020

Container Security and Governance

Shopify has evolved its container security and governance practices by implementing Binary Authorization for Kubernetes, leveraging Voucher for signing Docker images after security checks. This builds upon previous efforts to manage application secrets in containerized environments and the overall containerization strategy, moving away from less secure methods and towards automated, verifiable image deployment. Voucher has been integrated into the Grafeas project. This post details the initial steps in containerizing applications using Docker and CoreOS, focusing on portability, predictability, density, consistency, and developer/ops workflows.

3 posts · 2014–2020

Timeline

…20172026
Feature trailQuiet since 2020

Media Management System

Shopify has evolved its media management system to support videos and 3D models alongside existing images. This involved a critical architectural decision between using Rails callbacks and a pipeline approach for handling complex data operations and ensuring transactional integrity. The pipeline approach was adopted to improve control over code, enhance maintainability, and achieve a clear separation of concerns, allowing for more robust and scalable media handling.

1 post · 2020

Timeline

20202026
Feature trailQuiet since 2020

TruffleRuby Compiler Intermediate Representation

Shopify is developing TruffleRuby, a JIT compiler for Ruby, and has implemented an optimization for the `||=` lazy initialization operator. This optimization leverages deoptimization to reduce machine code generation and improve compilation speed and memory usage. The system uses a custom `OrLazyValueDefinedNode` to handle the `||=` operator, making the deoptimization case the uncommon one where the variable needs to be assigned a value more than once. This optimization shows the benefit of looking at industry codebases for patterns not visible in language specifications. Shopify is also contributing to CRuby/MRI and Sorbet, and maintains Tapioca.

1 post · 2020

Timeline

20202026
Feature trailQuiet since 2020

Nix for Developer Tooling

Shopify has evolved its use of Nix for developer tooling, focusing on rebuilding developer environments and managing dependencies for languages like Ruby and Node.js. The team is exploring Nix for CI/CD and has addressed pain points related to development workflows and dependency updates in a remote work environment. Efforts include upstreaming improvements and managing Nixpkgs revisions.

2 posts · 2020

Timeline

20202026
Feature trailQuiet since 2020

Session Hijacking Protection

Shopify has evolved its approach to managing webserver connection handling and request dropping mechanisms to improve application resilience under high load. This includes developing dynamic query rules for ProxySQL to reroute, rewrite, or reject database queries, and implementing a tool to manage these rules at scale across thousands of instances. The system incorporates a dry-run mode for query rules to prevent accidental data corruption or downtime, and employs exponential backoff for logging

2 posts · 2010–2020

Timeline

…20172026
Feature trailQuiet since 2020

Ruby App Boot Time Optimization

Shopify has evolved its Ruby application boot time optimization strategies, focusing on reducing the time spent waiting for Rails to boot in the monolithic application to improve developer iteration speed. This includes the introduction of Bootsnap for optimizing and caching expensive computations, implementing path pre-scanning for `Kernel#require` and `ActiveSupport` autoloads, and compilation caching for Ruby bytecode. The team also explores profiling and benchmarking techniques to identify a

2 posts · 2017–2020

Timeline

20172026
Feature trailQuiet since 2020

Mobile App Service Management

Shopify has established a system to treat mobile applications as services, enforcing best practices and tooling usage through ServicesDB. This system codifies ownership, contact information, testing and deployment configurations, versioning, and monitoring requirements, ensuring consistency and scalability across mobile projects.

1 post · 2020

Timeline

20202026
Feature trailQuiet since 2019

Decision Making Framework

Shopify has developed and enhanced a framework called TOMASP (Timebox, Options, Meta, Analyze, Step back, Prepare to be wrong) to guide engineers and technical leaders in making better, faster, and more informed decisions. This framework aims to counteract cognitive biases and uncertainty by providing structured steps for evaluating alternatives, considering long-term impact, and preparing for potential failures. It emphasizes the process of decision-making over solely focusing on outcomes.

1 post · 2019

Timeline

20192026
Feature trailQuiet since 2019

Kubectl Plugin for Ingress-Nginx

Shopify has evolved its approach to managing and debugging Kubernetes Ingress controllers, specifically ingress-nginx. This post details the development and contribution of a kubectl plugin that simplifies upgrades by identifying breaking changes, provides a more detailed listing of ingress configurations, and streamlines common debugging tasks by automating pod selection and providing convenient wrappers for kubectl commands. This has significantly reduced the time and effort required for upgrades and debugging.

2 posts · 2018–2019

Timeline

20182026
Feature trailQuiet since 2019

iOS CI/CD Infrastructure

Shopify has evolved its Continuous Integration and Continuous Delivery (CI/CD) infrastructure for iOS applications. Initial efforts focused on building a unified build system, Shopify Build, based on Buildkite for Linux and Android projects. This post details the significant challenges and solutions for extending this unified system to iOS, which requires macOS environments. Key developments include the transition from a VMware ESXi-based system with manual configuration to a more automated and scalable solution leveraging MacStadium's Private Cloud and a scheduler/worker VM architecture with linked clones. This has drastically reduced build times and improved scalability.

1 post · 2017–2019

Timeline

20172026
Feature trailQuiet since 2018

Android POS Architecture (MVVM)

Shopify has evolved its Android Point of Sale (POS) application architecture by migrating from competing MVC and MVP patterns to a unified Model-View-ViewModel (MVVM) approach. This adoption leverages Google's Android Architecture Components, including ViewModel and LiveData, to ensure consistent architecture, automatic state retention across configuration changes, and a clearer separation of concerns that leads to easier testing. The team committed to writing all new screens using MVVM and converting older screens when making significant changes.

1 post · 2018

Timeline

20182026
Feature trailQuiet since 2018

Locale-aware Number and Currency Condensing

Shopify has evolved its capabilities for locale-aware number and currency condensing. This involves developing a library that abbreviates numbers and currencies according to the user's locale, leveraging Unicode CLDR data and Intl.js. The library, named condense-number, was open-sourced on npm to help developers with international number formatting needs. It addresses challenges in multilingual environments where hardcoded abbreviations are insufficient, providing dynamic and accurate representations for graphs and other UI elements.

1 post · 2018

Timeline

20182026
Feature trailQuiet since 2018

React Data Table Component

Shopify has developed and enhanced its React component library with a robust data table component. This component addresses challenges in responsiveness, readability, context, and accessibility. Key features include a scrollable container for wide tables, a fixed first column for context, and manual adjustment of cell heights to maintain proper alignment and readability across different screen sizes and orientations. The development process involved iterative refinement and bug fixing to ensure a high-quality user experience.

1 post · 2018

Timeline

20182026
Feature trailQuiet since 2018

Browser Payment Request API Integration

This feature thread tracks the development and enhancement of integrating new browser payment APIs to streamline the checkout experience. Initial efforts focused on evaluating the Payment Request API, including its `canMakePayment()` method and the payment sheet UI. Experiments were conducted to measure its impact on checkout completion rates and purchase speed, comparing it against traditional checkout flows. The integration involved building an isolated Ruby app leveraging Shopify's existing APIs and infrastructure, and testing its impact on merchant businesses and buyer behavior.

1 post · 2018

Timeline

20182026
Feature trailQuiet since 2018

S3 Partitioning and Request Rate Management

Shopify has evolved its approach to managing cloud storage usage, specifically Amazon S3, to address increasing error rates and latencies caused by rapid merchant growth. Initial efforts focused on understanding the impact of S3's internal partitioning mechanism on request rates and rate limits. The core problem identified was that a spike in activity from a single shop could trigger a 'SlowDown' exception for an entire partition, affecting multiple shops. To mitigate this, Shopify implemented a solution by adding hash-generated digests to new shops' asset operations, distributing writes across many partitions and significantly reducing SlowDown events and latencies.

1 post · 2018

Timeline

20182026
Feature trailQuiet since 2018

ChatOps for Incident Management

This feature thread tracks the development and integration of ChatOps into Shopify's incident management procedures. Initial efforts focused on establishing a structured incident response process based on the Incident Command System (ICS). This post details the implementation of 'Spy', a chatbot built on Lita, to assist Incident Managers on Call (IMOCs) by automating and streamlining incident detection, communication, mitigation, and documentation. Spy integrates with tools like PagerDuty, StatusPage, and GitHub, and provides commands for page acknowledgment, incident initiation, communication (TLDR summaries, direct messages), mitigation actions, incident stopping, and service disruption documentation. It also includes features for IMOC well-being, such as reminders and fatigue prevention.

1 post · 2018

Timeline

20182026
Feature trailQuiet since 2017

Code Style Enforcement and Management

Shopify has evolved its code style consistency by introducing RuboCop and developing Policial, a tool that runs on pull requests to enforce these standards. This has involved improving the tool to use GitHub's commit status API for a less noisy experience, extending the Ruby style guide, and enforcing RuboCop in CI to prevent new violations. Efforts are ongoing to fix existing violations and achieve full compliance with the Shopify Ruby style guide.

1 post · 2017

Timeline

20172026
Feature trailQuiet since 2017

Facebook Channel Product Sync Scalability

Shopify has evolved its Facebook channel integration by scaling product synchronization capabilities. Initial efforts involved establishing the Facebook channel and growing its merchant base. Recent optimizations have addressed the serial nature of the product synchronization backend by introducing concurrent processing of product updates per shop and per product. This was achieved by leveraging Sidekiq Pro's batching functionality, where a supervisor job enqueues a batch of product sync jobs that run concurrently. The supervisor waits for all product sync jobs to complete, holding a lock on the shop's domain to prevent race conditions. After individual product sync jobs complete, the supervisor re-enqueues itself if more products need syncing, increasing worker utility. This has resulted in a significant decrease in the number of products needing sync and has made the syncing horizontally scalable.

1 post · 2017

Timeline

20172026
Feature trailQuiet since 2017

Hybrid Swift and Objective-C Codebase Management

Shopify has developed and enhanced strategies for maintaining hybrid Swift and Objective-C codebases, enabling the integration of new Swift code with existing Objective-C components. This involves leveraging Swift's type safety and modern features while ensuring seamless interoperability with Objective-C's runtime. Key techniques include using the `@objc` attribute for granular bridging control, wrapping Swift-only types in NSObject subclasses for Objective-C visibility, and utilizing Swift extensions to add Objective-C-visible methods as categories. This approach allows for the development of type-safe models in Swift and dynamic UI inflation in Objective-C, facilitating the adoption of Swift without a complete codebase rewrite.

1 post · 2017

Timeline

20172026
Feature trailQuiet since 2016

Production Rails Debugging Tools

Shopify has evolved its tools and strategies for debugging production Rails applications. This includes leveraging tools like gdb and rbtrace to quickly track down issues without requiring code instrumentation and deployment. Recent advancements include using gdb to attach to running processes, set breakpoints, generate core dumps for out-of-band analysis, and retrieve Ruby call stacks to identify the source of warnings and errors. This enables faster debugging and resolution of production issues. This post details the use of various Ruby introspection methods (`#class`, `#is_a?`, `#instance_of?`, `#methods`, `#method`, `#caller`, `#instance_variables`, `::name`, `::class_variables`, `::instance_methods`, `::superclass`, `Module.nesting`, `::ancestors`, `::constants`) and debugger commands (`var`, `backtrace`, `frame`, `help`) to aid in this process.

2 posts · 2015–2016

Timeline

…20172026
Feature trailQuiet since 2015

Secrets Management in Containers

Shopify has evolved its approach to managing application secrets within containerized environments. Initial efforts focused on moving away from Chef's encrypted data bags due to limitations in security, auditing, and compatibility with containerization. The introduction of EJSON provided a solution for encrypting secrets with asymmetric encryption, allowing developers to manage secrets alongside their code. Subsequent development focused on secure key management and integration with container init processes.

1 post · 2015

Timeline

…20172026
Feature trailQuiet since 2015

Lua Runtime in Go

Shopify has evolved its event processing capabilities by implementing the Go worker pool pattern to control concurrency and improve performance. This has led to a significant increase in event processing throughput, enabling better preparation for high-traffic events and reuse of the pattern across different pipeline components. This post details the development of go-lua, a pure Go implementation of the Lua programming language, to serve as the core execution engine for their load generation tool. The implementation manually ported the Lua 5.2 compiler and virtual machine from C to Go, offering advantages in garbage collection, minimal execution context overhead, and easier concurrency mapping. Challenges included optimizing the interpreter's inner loop performance due to Go's switch statement implementation and limited function call inlining, leading to the exploration of function table dispatch and manual inlining. Benchmarks showed go-lua to be slower than C Lua but competitive with other Go implementations, with limitations including lack of coroutines, string pattern matching, and weak reference tables.

1 post · 2015

Timeline

…20172026
Feature trailQuiet since 2015

SVG Graphics and Animation

Shopify leverages SVG for dynamic and interactive web graphics, including animated charts with d3.js, self-drawing paths using stroke-dashoffset, and responsive SVG implementations via viewBox and CSS hacks. SVG is also used for complex typographic treatments and patterned backgrounds, often generated server-side with Rails helpers. The technology is presented as a powerful and flexible alternative to CSS for web graphics.

1 post · 2015

Timeline

…20172026
Feature trailQuiet since 2015

Ruby Method Cache Tuning

Shopify has evolved its approach to optimizing Ruby's performance by tuning the global method cache size. This involved identifying performance bottlenecks using system-level profiling tools like `perf` and `ftrace`, and then dynamically configuring the cache size via the `RUBY_GLOBAL_METHOD_CACHE_SIZE` environment variable. This led to significant improvements in cache hit rates and a reduction in CPU cycles spent on method lookups, demonstrating the value of system-level performance tuning for large Ruby applications.

1 post · 2015

Timeline

…20172026
Feature trailQuiet since 2014

Client-side JavaScript Framework (Batman.js)

Shopify has evolved its client-side JavaScript framework strategy, moving away from the in-house Batman.js framework due to its complexity, poor documentation, and maintenance burden. The team has rebuilt the Shopify admin using a more classic architecture with ERB views, server-side rendering, Turbolinks, and a lightweight custom JavaScript binding system. This approach aims to reduce code duplication, improve developer productivity, and provide a faster, more stable experience for merchants.

3 posts · 2011–2014

Timeline

…20172026
Feature trailQuiet since 2014

Webhook Testing and Development Tools

This feature thread tracks the development and enhancement of tools and strategies for testing and developing webhooks. Initial efforts focused on addressing the challenges of testing webhooks during development, particularly the need for a publicly accessible URL. This post introduces PostCatcher, a web application that generates unique URLs for receiving and examining POST requests, and LocalTunnel, a service that exposes local machine ports to the internet, allowing developers to use localhost.

3 posts · 2011–2014

Timeline

…20172026
Feature trailQuiet since 2013

Rack Middleware for Input Sanitization

This feature thread tracks the development and enhancement of Shopify's Rack middleware for input sanitization. Initial efforts focused on addressing issues with invalid form submissions during user login, specifically when users provided malformed shop URLs. The solution involved creating a custom Rack middleware that runs before OmniAuth to sanitize and recover bad form data, preventing errors caused by invalid URIs. This middleware utilizes a strategy pattern for different sanitization techniques. The implementation was open-sourced as the `param_sanitizer` gem.

1 post · 2013

Timeline

…20172026
Feature trailQuiet since 2013

Real-time iOS Debugging and Object Exploration

This feature thread tracks the development and enhancement of real-time debugging tools for iOS applications, focusing on interactive object exploration without traditional breakpoints. Initial efforts introduced the Super Debugger, a wireless tool that allows developers to inspect and manipulate objects in running iOS apps (on devices or simulators) from a Mac application. This enables rapid iteration and immediate visual feedback by sending messages to objects and observing changes in real-time. This post details the functionality of the Super Debugger, including its setup, object inspection, message sending in F-Script syntax, and real-time updates.

1 post · 2013

Timeline

…20172026
Feature trailQuiet since 2011

Memory Leak Detection and Debugging

This feature thread tracks the development and enhancement of strategies and tools for detecting and debugging memory leaks in production systems. Initial efforts focused on understanding the nature of memory leaks, differentiating between 'good' (intentional global allocations) and 'bad' (unintentional, growing allocations) leaks. The thread details the challenges of reproducing leaks, the limitations of general-purpose tools, and the exploration of language-specific profilers like memprof. This post details a specific incident where a memory leak in a C extension of a memcached client library caused production crashes, and how the team eventually reproduced and resolved the issue through a combination of debugging, teamwork, and tool usage.

1 post · 2011

Timeline

…20172026
Feature trailQuiet since 2011

Python Shopify API Integration

Shopify has evolved its tools and libraries for building Shopify applications using various programming languages and frameworks. Initial efforts focused on providing core API access. This post details the integration of the Python Shopify API with the Django web framework and Google App Engine hosting service, providing developers with a reusable Django app code for handling user login, authentication, and session management, as well as middleware for session initialization and a decorator for requiring login. The example application can run as a regular Django application or on Google App Engine.

1 post · 2011

Timeline

…20172026
Feature trailQuiet since 2011

Shopify API Data Manipulation

Shopify has evolved its APIs to allow for dynamic content injection into shop pages via Application Proxies. This enables third-party applications to serve content that is rendered through Shopify's Liquid templating engine, allowing for seamless integration of external data and functionality into the native shop experience. Security is maintained through signed requests.

1 post · 2011

Timeline

…20172026
Feature trailQuiet since 2011

Shopify API Exploration

This post introduces developers to the Shopify API, explaining its RESTful architecture, available resources (Shop, Products, Customers, Orders), and the use of HTTP verbs (GET, POST, PUT, DELETE) for programmatic control. It demonstrates how to retrieve shop information and product data using API calls, providing examples in both XML and JSON formats. This lays the groundwork for building applications that interact with Shopify stores.

1 post · 2011

Timeline

…20172026
Feature trailQuiet since 2011

StatsD Metrics Collection

Shopify utilizes StatsD for collecting and visualizing custom metrics, enabling high-level overviews of system performance and aiding in assumption validation. The `statsd-instrument` gem facilitates this by providing metaprogramming methods for injecting instrumentation into various parts of the application, such as Liquid templates, Google Base updates, and Webhook processing. This system is used to track metrics like cache hits/misses, API success/failure rates, and request counts, contributing to improved observability and faster debugging.

1 post · 2011

Timeline

…20172026
Feature trailQuiet since 2011

State Machine Implementation and Auditing

Shopify has evolved its approach to state machine implementation and auditing. This includes recognizing state machine patterns in data models (e.g., 'state' or 'status' fields, boolean flags, nullable timestamps), leveraging gems like 'state_machine' for implementation, and tracking transition history. For acyclic state machines, timestamps per state are used. For cyclic machines, a dedicated log table records transitions (timestamp, old state, new state, event). Records are never deleted; instead, an 'error' state is used for accountability and historical analysis. This ensures better bug prevention, clearer API definitions, and valuable insights into user behavior.

1 post · 2011

Timeline

…20172026
Feature trailQuiet since 2010

Rails Version Upgrades

Shopify has a history of managing and executing major Ruby on Rails version upgrades, including significant efforts for Rails 3. This involves preparing the codebase, addressing compatibility issues with libraries and internal code, and managing the risks associated with large-scale migrations. The company aims to stay current with the Rails ecosystem to provide the best tools for developers and customer experience.

1 post · 2010

Timeline

…20172026