OCI Services for MySQL Server

OCI for MySQL

MySQL Server can rely on OCI services to:

  • Secure sensitive information in the OCI Vault
  • Store backups safely and conveniently in OCI Object Storage
  • Migrate data from OCI Object Storage to a MySQL Database Service DB System

Let’s examine the options to administer MySQL the easy way using OCI services.

Secure encryption keys in the OCI vault

It is possible to encrypt virtually anything in MySQL 8: redo logs, undo logs, binary logs, backups (…) and, obviously, data. See the list of features to make your data safer than ever. MySQL Server relies on a set of keyring plugins to store encryption master keys, and starting from MySQL Server 8.0.22 (Enterprise Edition), it is possible to communicate with Oracle Cloud Infrastructure Vault for back end storage, and this is using the keyring_oci plugin.

MySQL Server Community can use local file system keyrings only, component_keyring_file and component_keyring_encrypted_file

Read more about the announcement of the integration with OCI here. Learn about generic functions for great keyring management.

And what about the Oracle Key Vault? OCI Vault (discussed in this post) and Oracle Key Vault are two key management products from Oracle. Read more about the differences here.

Store MEB hot backups in an OCI object storage bucket

If you care about your data, find a safe place to store your backups. If you’d rather delegate the duty to safely store them, you can rely on external cloud storage services. OCI Object Storage buckets are a sweet target to store your data, because MySQL integrates with OCI when taking a backup using MySQL Enterprise Backup (MEB). You can find several examples to store your MEB full or incremental backups here (backup to OCI Object Storage works with Pre-Authenticated Requests). Find also examples to restore a backup from the cloud.

And, final note, MEB works well also with encrypted tablespaces using an external keyring (like the aforementioned keyring_oci).

Store MySQL Shell logical backups in an OCI object storage bucket and migrate to MDS

MySQL Shell (starting from version 8.0.21), supports uploading a whole MySQL instance dump or selected schemas or tables from an on-premise MySQL instance into an Oracle Cloud Infrastructure Object Storage bucket. Commands to be used are util.dumpInstance(), util.dumpSchemas() or util.dumpTables(). Gaining access to OCI Object Storage is possible thanks to:

An example using a would be:

util.dumpSchemas(["world"], "worlddump", {"osBucketName": "<BUCKET_NAME>", "osNamespace": "<NAMESPACE>", threads: 8, showProgress: true})

It is also possible to restore a backup fetching it straight from Object Storage, no previous download needed. The functionality is already integrated in the dump loading utility.

util.loadDump("worlddump", {threads: 8, osBucketName: "<BUCKET_NAME>", osNamespace: "<NAMESPACE>"})

MySQL Server Community is sufficient, if used with MySQL Shell, to store backups into OCI Object Storage.

Still taking your backups with mysqldump or mysqlpump? You are “wasting” your time, because MySQL Shell is way faster than traditional logical backup methods. Check benchmarks.

Finally, remember that MySQL Shell with Object Storage support is the perfect method to import data into your new MySQL Database Service (MDS) DB System either at creation time using the data import feature, or whenever you like, pointing Shell to your target DB System to restore arbitrary data stored in an Object Storage bucket.

The combo MySQL and OCI make critical tasks like protecting your data confidentiality easy; it’s appropriate to say that Sakila is standing on the shoulder of giants.

Leave A Comment