# Building and Testing Resilient Ruby on Rails Applications

DevFeed: [Building and Testing Resilient Ruby on Rails Applications](<https://devfeed.tech/articles/building-and-testing-resilient-ruby-on-rails-applications-1320.md>)

Original publisher: [Read original article](<https://shopify.engineering/building-and-testing-resilient-ruby-on-rails-applications>)

Author: Simon Eskildsen

Published: 2015-01-29T19:16:00Z

Content type: article

Language: en

Sources: [Shopify Engineering](<https://devfeed.tech/sources/shopify-engineering.md>), [Shopify Engineering - Shopify Engineering](<https://devfeed.tech/sources/shopify-engineering-shopify-engineering.md>)

Topics: [Rails](<https://devfeed.tech/topics/rails.md>), [Ruby](<https://devfeed.tech/topics/ruby.md>), [Shopify](<https://devfeed.tech/topics/shopify.md>), [Integration testing](<https://devfeed.tech/topics/integration-testing.md>), [Latency](<https://devfeed.tech/topics/latency.md>), [Network](<https://devfeed.tech/topics/network.md>), [API](<https://devfeed.tech/topics/api.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [browser](<https://devfeed.tech/tags/browser.md>), [developers](<https://devfeed.tech/tags/developers.md>), [development](<https://devfeed.tech/tags/development.md>), [http](<https://devfeed.tech/tags/http.md>), [infrastructure](<https://devfeed.tech/tags/infrastructure.md>), [integration](<https://devfeed.tech/tags/integration.md>), [latency](<https://devfeed.tech/tags/latency.md>), [network](<https://devfeed.tech/tags/network.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [shopify](<https://devfeed.tech/tags/shopify.md>), [testing](<https://devfeed.tech/tags/testing.md>)

## AI overview

This article explains how Shopify prepared its Ruby on Rails applications for peak holiday traffic by prioritizing resiliency. It describes mapping service dependencies, isolating optional dependencies, and testing behavior when external services are slow or unavailable. The article introduces Toxiproxy, a TCP proxy with an HTTP API for simulating network conditions in local development and integration tests.

## Source excerpt

Black Friday and Cyber Monday are the biggest days of the year at Shopify with respect to every metric. As the Infrastructure team started preparing for the upcoming seasonal traffic in the late summer of 2014, we were confident that we could cope, and determined resiliency to be the top priority. A resilient system is one that functions with one or more components being unavailable or unacceptably slow. Applications quickly become intertwined with their external services if not carefully monitored, leading to minor dependencies becoming single points of failure. For example, the only part of Shopify that relies on the session store is user sign-in - if the session store is unavailable, customers can still purchase products as guests. Any other behaviour would be an unfortunate coupling of components. This post is an overview of the tools and techniques we used to make Shopify more resilient in preparation for the holiday season.