# Spin Cycle: An orchestration framework for automating database infrastructure tasks

DevFeed: [Spin Cycle: An orchestration framework for automating database infrastructure tasks](<https://devfeed.tech/articles/spin-cycle-automating-the-tedious-27016.md>)

Original publisher: [Read original article](<https://medium.com/square-corner-blog/spin-cycle-automating-the-tedious-3f569106fd3c?source=rss----3650599ae4e2---4>)

Author: Felix Plajer

Published: 2019-04-09T18:16:58Z

Content type: article

Language: en

Sources: [Square Corner Blog - Medium](<https://devfeed.tech/sources/square-corner-blog-medium.md>)

Topics: [Orchestration](<https://devfeed.tech/topics/orchestration.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [MySQL](<https://devfeed.tech/topics/mysql.md>), [Docker](<https://devfeed.tech/topics/docker.md>), [unit tests](<https://devfeed.tech/topics/unit-tests.md>)

Tags: [automation](<https://devfeed.tech/tags/automation.md>), [code](<https://devfeed.tech/tags/code.md>), [database](<https://devfeed.tech/tags/database.md>), [databases](<https://devfeed.tech/tags/databases.md>), [docker](<https://devfeed.tech/tags/docker.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [orchestration](<https://devfeed.tech/tags/orchestration.md>), [tests](<https://devfeed.tech/tags/tests.md>)

## AI overview

Square announces the general availability of Spin Cycle, an orchestration framework its database team uses to automate infrastructure tasks such as provisioning and decommissioning database clusters, upgrading MySQL and Docker, and managing database hosts.

## Source excerpt

Spin Cycle -- Automating the TediousAn orchestration framework to automate anythingHeads up, we've moved! If you'd like to continue keeping up with the latest technical content from Square please visit us at our new home https://developer.squareup.com/blog Spin Cycle makes it easy to automate complex infrastructure tasks. The database team at Square uses it for most of our day-to-day operations -- provisioning new clusters and decommissioning old ones, upgrading MySQL and Docker, stopping and starting database hosts, and more. We've been developing and using Spin Cycle for over two years now, and today we're happy to announce its GA release. Scripts Don't Scale Before Spin Cycle, databases at Square were managed by hand. This worked, but it wasn't ideal. For example, we had a script to provision a new database cluster. This script had been used for a few years, and for the most part it served its purpose. The original engineer who wrote it designed it well enough -- it was a fully fledged program with functions and classes and unit tests. The script became a problem when other engineers needed to update it. It was difficult to add new tests when not familiar with all the code, so inevitably a lot of untested changes accrued. When the script broke it was hard to fix and even harder to make sure your fix didn't break any of the untested bits. The script was slow, running its steps serially instead of concurrently, because that was easier to develop and debug. Over time, an important business process became embedded in this tangled ball of code. Provisioning a new database wasn't a series of orderly steps anymore. Even if our script had been perfect -- tests for every new change, each step totally encapsulated -- we would have had problems. To provision 10 databases, you had to run the script 10 times in 10 windows -- hopefully an error didn't get lost in the noise. You couldn't see the arguments someone else passed in and what output they got back, let alone look at past ru