# How Shopify Used a Throttled Rails Background Job to Delete Historical Database Records

DevFeed: [How Shopify Used a Throttled Rails Background Job to Delete Historical Database Records](<https://devfeed.tech/articles/how-an-intern-released-3-terabytes-worth-of-storage-before-bfcm-1412.md>)

Original publisher: [Read original article](<https://shopify.engineering/how-an-intern-released-3-terabytes-worth-of-storage-before-bfcm>)

Author: Gurpreet Gill

Published: 2018-12-14T18:22: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: [Shopify](<https://devfeed.tech/topics/shopify.md>), [Rails](<https://devfeed.tech/topics/rails.md>), [MySQL](<https://devfeed.tech/topics/mysql.md>), [Replication](<https://devfeed.tech/topics/replication.md>), [Availability](<https://devfeed.tech/topics/availability.md>)

Tags: [availability](<https://devfeed.tech/tags/availability.md>), [internship](<https://devfeed.tech/tags/internship.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [rails](<https://devfeed.tech/tags/rails.md>), [replication](<https://devfeed.tech/tags/replication.md>), [shopify](<https://devfeed.tech/tags/shopify.md>)

## AI overview

A Shopify intern describes building a Rails background job to delete historical reporting records that caused excessive scanning of InnoDB pages. The job used batched iteration and throttling to limit database load, replication lag, and availability risks during BFCM preparation.

## Source excerpt

Hi there! I'm Gurpreet and currently finishing up my second internship at Shopify. I was part of the Products team during both of my internships. The team is responsible for building and maintaining the products area of Shopify admin. As a developer, every day is another opportunity to learn something new. Although I worked on many tasks during my internship, today I will be talking about one particular problem I solved.