Challenge 1: Migration

Next Challenge

Introduction

This first challenge is all about migrating the legacy database containing the historical store data to Cloud Spanner, an always on database with virtually unlimited scale.

Description

The legacy MySQL database has already been migrated to Google Cloud as a MySQL instance in your project. Find it and explore its details & contents. The user name and password for the database should be provided to you by your coach.

Create a new Spanner Enterprise edition instance called onlineboutique with 100 Processing Units in the same region as the MySQL instance. Then create a new Spanner database with the name ecom in the new instance. Once the Spanner database is created, migrate the ecom schema and data from the MySQL instance to the new Spanner database using the Spanner Migration Tool. Make sure to choose POC Migration as the migration type.

 Note
Once the migration starts, it will take roughly 15 minutes to complete. While the migration is running, you can already start looking into the next challenge, but you’ll need the migration to be completed in order to complete the next challenge.

Success Criteria

  • There is a new Cloud Spanner instance, onlineboutique with 100 PU and a new database, ecom.
  • All the data from the MySQL database ecom is migrated to the new Spanner database.
  • Verify that the following tables with the corresponding row counts exist in the new Spanner database:

    Table #Rows
    distribution_centers 10
    events 2438862
    inventory_items 494254
    order_items 182905
    orders 125905
    products 29120
    users 100000

Learning Resources

Tips

  • If there’s nothing mentioned in the instructions about a parameter, stick to the defaults (this applies to all of the challenges).
  • In principle you could install the Spanner Migration Tool on any VM, but the Cloud Shell is the easiest option.
  • The Spanner Migration Tool will need network access to the MySQL database, so you’ll need to add the IP address of the Cloud Shell (or any other VM where you’re running the tool from) to the authorized networks of the MySQL instance.

Next Challenge