How to Introduce Composite Primary Keys in Rails

Databases are a key scalability bottleneck for many web applications. But what if you could make a small change to your database design that would unlock massively more efficient data access? At Shopify, we dusted off some old database principles and did exactly that with the pri … | Continue reading


@engineering.shopify.com | 3 years ago

How to Use Quasi-Experiments and Counterfactuals to Build Great Produc

Descriptive statistics and correlations are every data scientists’ bread and butter, but they often come with the caveat that correlation isn’t causation. At Shopify, we believe that understanding causality is the key to unlocking maximum business value. We aim to identify insigh … | Continue reading


@engineering.shopify.com | 3 years ago

Enforcing Modularity in Rails Apps with Packwerk

On September 30, 2020 at 1 pm EST join us for ShipIt! presents: Packwerk by Shopify. Learn more about our latest open source tool for creating packages with enforced boundaries in Rails apps. Please register.The Shopify core codebase is large, complex, and growing by the day. To … | Continue reading


@engineering.shopify.com | 3 years ago

Under Deconstruction: The State of Shopify’s Monolith

Ruby on Rails is a great framework for rapidly building beautiful web applications that users and developers love. But if an application is successful, there’s usually continued investment, resulting in additional features and increased overall system complexity.Shopify’s core mo … | Continue reading


@engineering.shopify.com | 3 years ago

Tophatting in React Native

On average in 2019, Shopify handled billions of dollars of transactions per week. Therefore, it’s important to ensure new features are thoroughly tested before shipping them to our merchants. A vital part of the software quality process at Shopify is a practise called tophatting. … | Continue reading


@engineering.shopify.com | 3 years ago

How to Improve Your React Native Styling Workflow

In April, we announced Shop, our digital shopping assistant that brings together the best features of Arrive and Shop Pay. The Shop app started from our React Native codebase for our previous package tracking app Arrive, with every screen receiving a complete visual overhaul to f … | Continue reading


@engineering.shopify.com | 3 years ago

Implementing Type 2 Dimensional Models at Shopify

Application databases are generally designed to only track current state. For example, a typical user’s data model will store the current settings for each user. This is known as a Type 1 dimension. Each time they make a change, their corresponding record will be updated in place … | Continue reading


@engineering.shopify.com | 3 years ago

How Shopify made storefront response times 4x faster

In January 2019, we set out to rewrite the critical software that powers all online storefronts on Shopify’s platform to offer the fastest online shopping experience possible, entirely from scratch and without downtime.The Storefront Renderer is a server-side application that loa … | Continue reading


@engineering.shopify.com | 3 years ago

Building Reliable Mobile Applications

Merchants worldwide rely on Shopify's Point Of Sale (POS) app to operate their brick and mortar stores. Unlike many mobile apps, the POS app is mission-critical. Any downtime leads to long lineups, unhappy customers, and lost sales. The POS app must be exceptionally reliable, and … | Continue reading


@engineering.shopify.com | 3 years ago

An Introduction to DNS Traffic Management on Shopify's Engineering Blog

Distributed systems are only as resilient as we build them to be. Domain Name System (DNS) traffic management is a well-used approach to do so. In this first part of a two-part series, we aim to give a broad overview of DNS and how it’s used for traffic management, as well as the … | Continue reading


@engineering.shopify.com | 3 years ago

Migrating Large TypeScript Codebases to Project References

In 2017, we began migrating the merchant admin UI of Shopify from a traditional Ruby on Rails Embedded RuBy (ERB) based front-end to an entirely new codebase, TypeScript paired with React and GraphQL. Using TypeScript enabled our ever-growing Admin teams to leverage TypeScript’s … | Continue reading


@engineering.shopify.com | 3 years ago

We Built Size.link

Join Daniel on July 20, 2020 at 1 pm EST for ShipIt! Presents: AR/VR at Shopify. Daniel will be talking about what we’re doing with AR/VR at Shopify. Please RegisterSize.link is a free tool built by Shopify’s Augmented Reality (AR) team that lets anyone view the size of a product … | Continue reading


@engineering.shopify.com | 3 years ago

Spark Joy by Running Fewer Tests

Developers write tests to ensure correctness and allow future changes to be made safely. However, as the number of features grows, so does the number of tests. Tests are a double-edged sword. On one hand, well-written ones catch bugs and maintain a program’s stability, but as the … | Continue reading


@engineering.shopify.com | 3 years ago

Understanding Programs Using Graphs

You may have heard that a compiler uses a data structure called an abstract-syntax-tree, or AST, when it parses your program, but it’s less common knowledge that an AST is normally used just at the very start of compilation, and a powerful compiler generally uses a more advanced … | Continue reading


@engineering.shopify.com | 3 years ago

What Is Nix?

Join us on May 25, 2020 at 1:00 pm EST for ShipIt! presents How Shopify Uses Nix, a discussion about how Shopify is using Nix to rebuild our developer tooling with Burke Libbey. Please register.Over the past year and a bit, Shopify has been progressively rebuilding parts of our d … | Continue reading


@engineering.shopify.com | 3 years ago

How to Fix Slow Code in Ruby

By Jay Lim and Gannon McGibbonAt Shopify, we believe in highly aligned, loosely coupled teams to help us move fast. Since we have many teams working independently on a large monolithic Rails application, inefficiencies in code are sometimes inadvertently added to our codebase. Ov … | Continue reading


@engineering.shopify.com | 3 years ago

Dev Degree: Behind the Scenes

On April 24th, we proudly celebrated the graduation of our first Dev Degree program cohort. This milestone holds a special place in Shopify history because it’s a day born out of trial and error, experimentation, iteration, and hustle. The 2016 cohort had the honor and challenge … | Continue reading


@engineering.shopify.com | 3 years ago

Categorizing Products at Scale

By: Jeet Mehta and Kathy GeWith over 1M business owners now on Shopify, there are billions of products being created and sold across the platform. Just like those business owners, the products that they sell are extremely diverse! Even when selling similar products, they tend to … | Continue reading


@engineering.shopify.com | 4 years ago

Optimizing lazy initialization in TruffleRuby with deoptimization

Shopify's involvement with TruffleRuby began half a year ago, with the goal of furthering the success of the project and Ruby community. TruffleRuby is an alternative implementation of the Ruby language (where the reference implementation is CRuby, or MRI) developed by Oracle Lab … | Continue reading


@engineering.shopify.com | 4 years ago

Circuit Breaker Is Misconfigured – Shopify Engineering

Circuit breakers are an incredibly powerful tool for making your application resilient to service failure. But they aren’t enough. Most people don’t know that a slightly misconfigured circuit is as bad as no circuit at all! Did you know that a change in 1 or 2 parameters can take … | Continue reading


@engineering.shopify.com | 4 years ago

Great Code Reviews – The Superpower Your Team Needs

There is a general consensus that code reviews are an important aspect of highly effective teams. This research paper is one of many exploring this subject. Most organizations undergo code reviews of some form.However, it’s all too common to see code reviews that barely scratch t … | Continue reading


@engineering.shopify.com | 4 years ago

React Native Is the Future of Mobile at Shopify

After years of native mobile development, we’ve decided to go full steam ahead building all of our new mobile apps using React Native. As I’ll explain, that decision doesn’t come lightly.Each quarter, the majority of your buyers purchase on mobile (with 71% of our buyers purchasi … | Continue reading


@engineering.shopify.com | 4 years ago

How Shopify implemented its secure authentication service

As Shopify merchants grow in scale they will often introduce multiple stores into their organization. Previously, this meant that staff members had to be invited to multiple stores to setup their accounts. This introduced administrative friction and more work for the staff users … | Continue reading


@engineering.shopify.com | 4 years ago

Shopify Manages API Versioning and Breaking Changes

Earlier this year I took the train from Ottawa to Toronto. While I was waiting in line in the main hall of the station, I noticed a police officer with a detection dog. The police officer was giving the dog plenty of time at each bag or person as they worked and weaved their way … | Continue reading


@engineering.shopify.com | 4 years ago

Successfully Merging the Work of 1000 Developers

Collaboration with a large team is challenging, and even more so if it’s on a single codebase, like the Shopify monolith. Shopify changes 40 times a day. We follow a trunk-based development workflow and merge around 400 commits to master daily. There are three rules that govern h … | Continue reading


@engineering.shopify.com | 4 years ago

Shopify Manages Petabyte Scale MySQL Backup and Restore

At Shopify, we run a large fleet of MySQL servers, with numerous replica-sets (internally known as “shards”) spread across three Google Cloud Platform (GCP) regions. Given the petabyte scale size and criticality of data, we need a robust and efficient backup and restore solution. … | Continue reading


@engineering.shopify.com | 4 years ago

Five common data stores and when to use them

An important part of any technical design is choosing where to store your data. Does it conform to a schema or is it flexible in structure? Does it need to stick around forever or is it temporary?In this article, we’ll describe five common data stores and their attributes. We hop … | Continue reading


@engineering.shopify.com | 4 years ago

How to write fast code in Ruby on Rails

At Shopify, we use Ruby on Rails for most of our projects. For both Rails and Ruby, there exists a healthy amount of stigma toward performance. You’ll often find examples of individuals (and entire companies) drifting away from Rails in favor of something better. On the other han … | Continue reading


@engineering.shopify.com | 4 years ago

Pagination with Relative Cursors

When requesting multiple pages of records from a server the simple implementation is to have an incremental page number in the URL. Starting at page one, each subsequent request that’s sent has a page number that’s one greater than the previous. The problem is that incremental pa … | Continue reading


@engineering.shopify.com | 4 years ago

Lessons from Leading a Remote Engineering Team

For my entire engineering management career, I’ve managed remote teams. At Shopify, I manage Developer Acceleration, a department with both colocated and remote teams with members spread across four Canadian offices and in six countries.You may think that managing remote teams is … | Continue reading


@engineering.shopify.com | 4 years ago

Deconstructing the Monolith

Shopify is one of the largest Ruby on Rails codebases in existence. It has been worked on for over a decade by more than a thousand developers. It encapsulates a lot of diverse functionality from billing merchants, managing 3rd party developer apps, updating products, handling sh … | Continue reading


@engineering.shopify.com | 4 years ago

Mobile Release Engineering at Scale with Shipit Mobile

One of the most important phases of software development is releasing it out to the final users. At Shopify, we've invested heavily in tooling for continuous deployment for our web apps. When a developer working on a web project wants to deploy their changes to production, the pr … | Continue reading


@engineering.shopify.com | 4 years ago

Dev Degree – A Big Bet on Software Education

Reading Time: 10 minutes “Tell me and I forget, teach me and I may remember, involve me and I learn.” - Benjamin FranklinWhen I decided to study computer science at university, my parents were skeptical. They didn’t know anyone who had chosen this as a career. Computer science wa … | Continue reading


@engineering.shopify.com | 5 years ago

The Unreasonable Effectiveness of Test Retries: An Android Monorepo Case Study

At Shopify, we don't have a QA team, we have a QA culture which means we rely on automated testing to ensure the quality of our mobile apps. A reliable Continuous Integration (CI) system allows our developers to focus on building a high-quality system, knowing with confidence tha … | Continue reading


@engineering.shopify.com | 5 years ago

E-Commerce at Scale: Inside Shopify's Tech Stack – Stackshare.io

 9 minute readBefore 2015, we had an Operations and Performance team. Around this time, we decided to create the Production Engineering department and merge the teams. The department is responsible for building and maintaining common infrastructure that allows the rest of product … | Continue reading


@engineering.shopify.com | 5 years ago

Shopify's move off glbc to ingress-nginx

Shopify, the leading cloud-based, multi-channel commerce platform, is growing at an incredibly fast pace. Since the beginning of 2016, the number of merchants on the platform increased from 375,000 to 600,000+. As the platform scales, we face new and exciting challenges such as i … | Continue reading


@engineering.shopify.com | 5 years ago

Virtualized iOS builds at Shopify

Shopify has a growing number of software developers working on mobile apps such as Shopify, Shopify POS and Frenzy. As a result, the demand for a scalable and stable build system increased. Our Developer Acceleration team decided to invest in creating a single unified build syste … | Continue reading


@engineering.shopify.com | 5 years ago