Canva’s Live Database Migration: From MySQL to DynamoDB

Create A Website for $1.99/Month

Online design service Canva has an obscene amount of media. In 2017, Canva’s media store led more than 25 billion user-uploaded media with another 50 million uploaded daily by 100 million monthly active users. This is the story of how Canva migrated that dataset from MySQL to Amazon Web Services‘ DynamoDB with zero downtime.

MySQL was doing just fine as Canva’s media store until around the one billionth media entry, according to a few creative solutions implemented by the engineering team held the OG system together just long enough for the live migration to DynamoDB to complete.

A huge amount of preparation and testing went into the process. Five years later, the company, which was purchased by Adobe last year, published the migration details and basic system architecture diagrams published, in a blog post written by Canva Engineering Lead Robert Sharp and Jacky Chen, Canva Software Developer.

Here are a few of the lessons they learned:

Be lazy. Understand access patterns and migrate commonly accessed patterns first.
Do it live. Gather as much information as possible by migrating live, identifying bugs and learning to use and run the technology.
Test in production. Introduce checks to do it safely.

The Media Service

Canva’s microservices architecture is primarily comprised of resource-oriented services, meaning operations are managed around different resources (i.e., documents, folders, users and media). Each service exposes an API, has isolated persistence and is owned by a team of engineers. The media service, for example, manages all things media within Canva.

The Canva Media Service Architecture.

The media service manages operations on and encapsulates the state of media resources. Some of the attributes the service stores are ID, owning user, external source information and a reference to the media files and where they’re stored for all media files. Detailed metadata is also stored in the media service.

Reads are more common than writes and in…

..

Read More

You May Also Like

About the Author: V. Moss