data databases kubernetes news open source products Tanzu SQL

VMware Tanzu SQL: MySQL at Scale Made Easy for Kubernetes

We are happy to announce that VMware Tanzu SQL with MySQL for Kubernetes 1.0 is generally available! Tanzu customers can easily run MySQL at scale on Kubernetes with this new release, which complements our existing Postgres engine for Kubernetes. Even better, with this new release Tanzu Advanced customers now have the two most popular open source operational databases included with their purchase.

MySQL is the world’s most widely used open source database, in no small part because it’s so easy to set up and use. However, there’s a big difference between getting a database up and running and trusting one with your customers’ data. Indeed, our operator goes far beyond just throwing a container image at Kubernetes. Rather, we’ve encoded years of experience and best practices for deploying MySQL to help you get to production faster!

Ease of use

At VMware Tanzu Data Services, we don’t believe you should have to be an expert to get started with MySQL, so installing the operator is easy. Spinning up a new instance is even easier. MySQL is a 25-year-old technology, so many of the defaults are dated, and configurations have evolved over time. Further, because MySQL is a dynamic, open source project, keeping it up to date can be a full-time job. But VMware works with a wide range of customers, so we're constantly learning from unique environments and encoding best practices, sane defaults, and security precautions into the product along the way.

Like its sister product, VMware Tanzu SQL with Postgres for Kubernetes, it takes very little YAML to deploy a MySQL instance: 

 
 ---
  apiVersion: with.sql.tanzu.vmware.com/v1
  kind: MySQL
  metadata:
    name: mysql-sample
  spec:
    resources:
      mysql:
        requests:
          memory: 1Gi
    storageSize: 1Gi
    imagePullSecret: tanzu-mysql-image-registry

YAML file for deployment

To see the complete process of installing the operator and deploying an instance, check out our 5-minute installation demo video: 

 

Or, if you're a developer, see how to deploy an instance and connect an application:

 

Scale and consistency

MySQL is a point solution, and as such is more frequently deployed as part of an app than as a centralized service. That’s great for developers and satisfies the needs of many different business owners. By following the operator pattern, you can spin up hundreds of databases and be confident that each will be configured in a sane manner and will scale easily as usage demands. 

Our operator leverages the fleet management capabilities inherent in Kubernetes to make sure that no database is left behind. Being able to audit the entire fleet and guarantee that every instance is running the most recent security patches available is important. Nobody wants to deal with a security breach because a database hasn’t been maintained since it was deployed!

Backups

Of course, you’d never run a database without backups. Back in the day, systems administrators had to remember to change tapes and make sure backups didn’t get stale. Now, with built-in backups, you can be sure that every instance is backed up at whatever frequency is needed. Enable backups in just two steps: define an S3-compatible backup location, and create a backup. You can also easily specify a schedule; the system will produce backup artifacts for the lifetime of the database.

 
---
apiVersion: with.sql.tanzu.vmware.com/v1
kind: MySQLBackupLocation
metadata:
  name: backuplocation-sample
spec:
  storage:
    s3:
      bucket: "name-of-bucket"
      # bucketPath: "my-backups-prefix/"
      # region: "us-west-1"
      # endpoint: "custom-endpoint"
      secret:
        name: backuplocation-creds-sample
---
apiVersion: v1
kind: Secret
metadata:
  name: backuplocation-creds-sample
stringData:
  # Credentials
  accessKeyId: "my-access-key-id"
  secretAccessKey: "my-secret-access-key"
---
apiVersion: with.sql.tanzu.vmware.com/v1
kind: MySQLBackupSchedule
metadata:
  name: backupschedule-sample
spec:
  backupTemplate:
    spec:
      location:
        name: backuplocation-sample
      instance:
        name: mysql-sample
  schedule: "@daily"

Sample template for backups

Configuring backups is just a matter of plugging your values into these templates; simply apply them and you're done! For more information, see the Backup up and Restoring documentation.

Encryption

These days, there's no excuse for running a database without requiring encryption in transit. That's why secure communications come built in and are required with every instance. You can provide your own certificates or we can generate one automatically for you. For more information, see the TLS configuration documentation.

High availability

To deploy a database in production, you want to set up for the tightest recovery time objective (RTO) possible. High availability (HA) isn't only about disaster recovery and business continuity; it also minimizes the impact of planned maintenance in your primary data center. We've included high availability as an option for all MySQL instances, and it is very easy to enable. Just switch highAvailability.enabled to true and kubectl apply. The operator will do all of the deployment steps, so you don't need to worry about configuration and setup.

 High availability for Tanzu SQL with MySQL for Kubernetes

The purpose of the high availability option is to minimize RTO. To keep things simple and predictable, all queries are sent to just one node. So we've made sure that it's very easy to scale up an HA cluster—just change the resource properties and redeploy. Each instance will be resized automatically, with virtually zero impact on running applications.

If you're curious, we're using MySQL's Group Replication feature. We've been tracking Group Replication as it has matured over the years, and currently feel that it's the best option for setting up new HA databases. By using Group Replication as the basis of your HA topologies, it's possible to automatically redirect client connections from a failing node to a healthy one. Group Replication packs in a lot of automation and predictability functions, without which we'd still be dealing with the manual and error-prone process of promoting a replica.

With automatic failover built in, clients can see as little as a 1-second interruption when the primary fails. See how in a 2-minute demonstration of high availability in action.

Learn more on the Configuring MySQL Instances for High Availability documentation page.

What’s next?

At Tanzu Data Services, we live and breathe databases, and MySQL is one of our favorites. With VMware Tanzu SQL with MySQL for Kubernetes 1.0, we’re just getting started, and will be working hard to bring additional enterprise-quality features dedicated to making your database administration tasks as pain-free as possible. Look for integrations with VMware Tanzu Observability and more comprehensive support for specific pod placement in coming releases, as well as operator support for disaster recovery options later in the year.

Ready to start? Download and give the operator a try in your environment and see how it compares to how you’re managing databases today!