Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Saat membuat layanan Dataproc Metastore, Anda harus memilih untuk menggunakan
jenis database MySQL atau jenis database Spanner.
Pilihan ini memengaruhi fitur yang dapat Anda integrasikan dan gunakan dengan layanan Dataproc Metastore. Perlu diperhatikan bahwa Anda tidak dapat
memperbarui jenis database setelah membuat layanan Dataproc Metastore. Pastikan Anda memilih jenis database yang sesuai dengan kebutuhan Anda.
Halaman ini menjelaskan perbedaan antara jenis database ini dan cara memilih
salah satunya untuk layanan Anda.
Perbedaan antara MySQL dan Spanner
MySQL
Jenis database MySQL Dataproc Metastore adalah penerapan Cloud SQL.
Perhatikan hal berikut saat menggunakan database MySQL:
MySQL adalah jenis database default saat membuat Dataproc Metastore.
MySQL didukung oleh semua versi Hive.
MySQL mendukung semua fitur Dataproc Metastore.
MySQL mendukung enkripsi Dataproc Metastore, seperti menggunakan
kunci enkripsi yang dikelola pelanggan (CMEK).
Spanner
Jenis database Spanner Dataproc Metastore adalah implementasi Spanner.
Perhatikan hal berikut saat menggunakan database Spanner:
Spanner hanya didukung di Hive versi 2.3.6 dan 3.1.2.
Spanner hanya mendukung impor Avro.
Detail tambahan
Tabel berikut memberikan detail tambahan tentang perbedaan ini.
MySQL
Spanner
Keandalan (uptime)
SLO Cloud SQL 99,95%*
SLO Spanner 99,99%*
Masa pemeliharaan
Wajib
Tidak Diperlukan
Catatan:
*SLO Cloud SQL dan Spanner tidak secara langsung
diterjemahkan ke SLO Dataproc Metastore.
Dataproc Metastore
Pilihan jenis database Anda tidak memengaruhi SLO Dataproc Metastore.
Tidak ada perbedaan harga antara kedua jenis database tersebut.
Untuk mendapatkan izin yang
Anda perlukan untuk membuat Dataproc Metastore,
minta administrator Anda untuk memberi Anda
peran IAM berikut di project Anda, berdasarkan prinsip hak istimewa paling rendah:
Anda memilih jenis database saat pertama kali membuat layanan
Dataproc Metastore.
Contoh berikut menunjukkan versi singkat langkah-langkah yang Anda ikuti untuk memilih jenis database. Untuk mengetahui petunjuk langkah demi langkah selengkapnya, lihat
Membuat layanan Dataproc Metastore.
Konsol
Di konsol Google Cloud , buka halaman Dataproc Metastore:
SERVICE_ID: nama atau ID untuk layanan Dataproc Metastore Anda.
LOCATION: region tempat layanan Dataproc Metastore Anda berada.
DATABASE_TYPE: jenis database yang ingin Anda
tetapkan untuk layanan Dataproc Metastore.
Nilai yang diterima mencakup mysql dan spanner. Nilai defaultnya adalah
mysql.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-27 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)"]]