Stay organized with collections
Save and categorize content based on your preferences.
When you create a Dataproc Metastore service, you must choose to use
either the MySQL database type or the Spanner database type.
This choice affects the features that you can integrate and use with your
Dataproc Metastore service. It's important to note that you can't
update your database type after you create a Dataproc Metastore
service. Make sure you choose the appropriate database type for your needs.
This page explains the differences between these database types and how to select
one for your service.
Differences between MySQL and Spanner
MySQL
The Dataproc Metastore MySQL database type is an implementation of Cloud SQL.
Note the following when using a MySQL database:
MySQL is the default database type when creating a Dataproc Metastore.
MySQL is supported by all Hive versions.
MySQL supports all Dataproc Metastore features.
MySQL supports Dataproc Metastore encryption, such as using
customer-managed encryption keys (CMEK).
Spanner
The Dataproc Metastore Spanner database type is an implementation of Spanner.
Note the following when using a Spanner database:
Spanner is only supported on Hive versions 2.3.6 and 3.1.2.
Spanner only supports Avro imports.
Additional details
The following table provides additional details about these differences.
MySQL
Spanner
Reliability (uptime)
Cloud SQL SLO 99.95%*
Spanner SLO 99.99%*
Maintenance windows
Required
Not Required
Notes:
*The Cloud SQL and Spanner SLOs don't directly
translate to Dataproc Metastore SLOs.
Dataproc Metastore
Your database type selection does not affect Dataproc Metastore
SLOs.
There's no pricing difference between the two database types.
To get the permission that
you need to create a Dataproc Metastore,
ask your administrator to grant you the
following IAM roles on your project, based on the principle of least privilege:
You choose your database type when you first create a
Dataproc Metastore service.
The following example shows an abbreviated version of the steps that you follow
to choose a database type. For complete step-by-step instructions, see
Create a Dataproc Metastore service.
Console
In the Google Cloud console, open the Dataproc Metastore page:
SERVICE_ID: the name or ID for your
Dataproc Metastore service.
LOCATION: the region that your
Dataproc Metastore service resides in.
DATABASE_TYPE: the database type that you want to
set for your Dataproc Metastore service.
Accepted values include mysql and spanner. The default value is
mysql.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eDataproc Metastore services require the selection of either MySQL or Spanner as the database type during creation, which cannot be changed afterward.\u003c/p\u003e\n"],["\u003cp\u003eMySQL is the default database type, supporting all Hive versions and Dataproc Metastore features, including customer-managed encryption keys (CMEK).\u003c/p\u003e\n"],["\u003cp\u003eSpanner supports Hive versions 2.3.6 and 3.1.2, but only supports Avro imports.\u003c/p\u003e\n"],["\u003cp\u003eWhile there's no pricing difference, Spanner offers a higher reliability (uptime) SLO of 99.99%, compared to MySQL's 99.95%.\u003c/p\u003e\n"],["\u003cp\u003eMySQL requires maintenance windows, while Spanner does not.\u003c/p\u003e\n"]]],[],null,["# Database types\n\nWhen you create a Dataproc Metastore service, you must choose to use\neither the MySQL database type or the Spanner database type.\n\nThis choice affects the features that you can integrate and use with your\nDataproc Metastore service. It's important to note that you can't\nupdate your database type after you create a Dataproc Metastore\nservice. Make sure you choose the appropriate database type for your needs.\n\nThis page explains the differences between these database types and how to select\none for your service.\n\nDifferences between MySQL and Spanner\n-------------------------------------\n\n### MySQL\n\nThe Dataproc Metastore MySQL database type is an implementation of [Cloud SQL](/sql).\nNote the following when using a MySQL database:\n\n- MySQL is the default database type when creating a Dataproc Metastore.\n- MySQL is supported by all Hive versions.\n- MySQL supports all Dataproc Metastore features.\n- MySQL supports Dataproc Metastore encryption, such as using customer-managed encryption keys (CMEK).\n\n### Spanner\n\nThe Dataproc Metastore Spanner database type is an implementation of [Spanner](/spanner).\nNote the following when using a Spanner database:\n\n- Spanner is only supported on Hive versions 2.3.6 and 3.1.2.\n- Spanner only supports Avro imports.\n\n### Additional details\n\nThe following table provides additional details about these differences.\n\nNotes:\n\n- ^\\*^The Cloud SQL and Spanner SLOs don't directly translate to Dataproc Metastore SLOs. Dataproc Metastore Your database type selection does not affect Dataproc Metastore SLOs.\n- There's no pricing difference between the two database types.\n\nBefore you begin\n----------------\n\n- [Enable Dataproc Metastore](/dataproc-metastore/docs/enable-service) in your project.\n- [Understand networking requirements](/dataproc-metastore/docs/access-service) specific to your project.\n\n### Required Roles\n\n\nTo get the permission that\nyou need to create a Dataproc Metastore,\n\nask your administrator to grant you the\nfollowing IAM roles on your project, based on the principle of least privilege:\n\n- [Grant full control of Dataproc Metastore resources](/iam/docs/roles-permissions/metastore#metastore.editor) (`roles/metastore.editor`)\n- [Grant full access to all Dataproc Metastore resources, including IAM policy administration](/iam/docs/roles-permissions/metastore#metastore.admin) (`roles/metastore.admin`)\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nThis predefined role contains the\n` metastore.services.create`\npermission,\nwhich is required to\ncreate a Dataproc Metastore.\n\n\nYou might also be able to get\nthis permission\nwith [custom roles](/iam/docs/creating-custom-roles) or\nother [predefined roles](/iam/docs/roles-overview#predefined).\nFor more information about specific Dataproc Metastore roles and permissions, see [Manage Dataproc access with IAM](/dataproc-metastore/docs/iam-and-access-control).\n\n\u003cbr /\u003e\n\nChoose your database type\n-------------------------\n\nYou choose your database type when you first create a\nDataproc Metastore service.\n\nThe following example shows an abbreviated version of the steps that you follow\nto choose a database type. For complete step-by-step instructions, see\n[Create a Dataproc Metastore service](/dataproc-metastore/docs/create-service).\n**Caution:** You can't update your database type after you create a Dataproc Metastore service. Make sure you choose the appropriate database type for your requirements. To change your database type, you must delete and recreate your service. \n\n### Console\n\n1. In the Google Cloud console, open the Dataproc Metastore page:\n\n [Open Dataproc Metastore](https://console.cloud.google.com/dataproc/metastore/services)\n2. In the navigation bar, click **Create**.\n\n The **Create service** page opens.\n3. For **Database type** , select either **MySQL** or **Spanner**.\n\n MySQL is the default database type.\n4. Choose the [remaining configurations](/dataproc-metastore/docs/create-service#create-a-service)\n for your service, as needed.\n\n5. Click **Submit**.\n\n### gcloud CLI\n\n1. Run the following [`gcloud metastore services create`](/sdk/gcloud/reference/metastore/services/create)\n command:\n\n ```\n gcloud metastore services create SERVICE_ID \\\n --location=LOCATION \\\n --database-type=DATABASE_TYPE; default=\"mysql\"\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eSERVICE_ID\u003c/var\u003e: the name or ID for your Dataproc Metastore service.\n - \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the region that your Dataproc Metastore service resides in.\n - \u003cvar translate=\"no\"\u003eDATABASE_TYPE\u003c/var\u003e: the database type that you want to set for your Dataproc Metastore service. Accepted values include `mysql` and `spanner`. The default value is `mysql`.\n\nWhat's next\n-----------\n\n- [Create a service](/dataproc-metastore/docs/create-service)\n- [Update and delete a service](/dataproc-metastore/docs/manage-service)\n- [Data storage for internal tables](/dataproc-metastore/docs/data-storage-internal-tables)"]]