Kumpulan baca Cloud SQL mendukung load balancing untuk beban kerja baca yang besar.
Apa itu kumpulan baca?
Kumpulan baca adalah kumpulan instance replika baca yang digunakan untuk mendistribusikan beban kerja baca yang besar. Workload ini dapat dialihkan dari instance utama ke kumpulan baca untuk mengurangi beban pada instance utama.
Setiap replika baca di kumpulan baca disebut node kumpulan baca.
Anda dapat menskalakan kumpulan baca dengan beberapa cara:
Penskalaan masuk atau keluar: menskalakan kapasitas load balancing secara horizontal dengan
mengubah jumlah node kumpulan baca di kumpulan baca.
Setiap kumpulan baca mendukung antara 1 dan 20 node kumpulan baca.
Menskalakan ke atas atau ke bawah: menskalakan kapasitas load balancing secara vertikal dengan
mengubah jenis mesin yang terkait dengan node kumpulan baca. Setelah ditentukan,
konfigurasi diterapkan secara seragam di setiap node pool baca dalam pool baca.
Saat Anda mengubah setelan node pool baca seperti penyimpanan, konektivitas, atau flag konfigurasi database, perubahan akan otomatis diterapkan secara seragam di setiap node pool baca dalam pool baca.
Kumpulan baca dapat diakses melalui endpoint baca tunggal dengan
alamat IP yang tidak dapat diubah. Koneksi yang dibuat melalui endpoint akan
otomatis dialihkan ke salah satu node kumpulan baca. Saat Anda ingin
membaca kumpulan untuk menskalakan atau menskalakan, aplikasi yang sebelumnya
terhubung ke satu endpoint baca ini tidak perlu dikonfigurasi ulang, meskipun
Anda dapat membuat node kumpulan baca baru di kumpulan baca atau menghapus node sebelumnya.
Setiap node kumpulan baca juga memiliki alamat IP-nya sendiri. Meskipun tidak direkomendasikan sebagai pendekatan yang efisien untuk mengakses data Anda, Anda dapat menggunakan alamat IP ini untuk memecahkan masalah performa setiap node pool baca.
Untuk mengetahui informasi selengkapnya tentang cara mengambil informasi koneksi untuk
kumpulan baca atau node kumpulan baca (baik alamat IP maupun string koneksi),
lihat
Melihat informasi kumpulan baca.
Karakteristik berikut berlaku:
Node kumpulan baca dari kumpulan baca selalu berada di region yang sama, seperti
yang ditentukan oleh pengguna. Google Cloud mengganti residensi node kumpulan baca
di antara semua zona dalam region.
Instance utama dapat memiliki satu atau beberapa kumpulan baca.
Operasi berikut menyebabkan periode nonaktif kurang dari satu detik:
Melakukan penskalaan keluar atau masuk (menambahkan atau menghapus node pool baca).
Menskalakan ke atas atau ke bawah (mengubah jenis mesin node dalam kumpulan).
Mengonversi replika baca zonal yang ada ke kumpulan baca.
Kumpulan baca menerima pemeliharaan sebelum instance utamanya, mirip dengan
replika baca. Seperti replika baca, kumpulan baca menerima pemeliharaan selama
masa pemeliharaan instance utama.
Setiap node kumpulan baca memiliki metrik yang sama yang tersedia seperti replika baca Cloud SQL.
Saat menggunakan gcloud atau konsol Google Cloud untuk menjelaskan
detail project, nama kumpulan baca akan dicantumkan, tetapi nama
node kumpulan baca individual tidak.
Traffic ditayangkan dari node kumpulan baca berdasarkan apakah database dalam kondisi baik, tetapi terlepas dari seberapa tinggi jeda replikasi pada node kumpulan baca tersebut. Traffic dapat ditayangkan dari node kumpulan baca yang tertinggal meskipun ada node kumpulan baca lain yang tidak tertinggal. Database dianggap dalam kondisi baik jika
proses database berjalan dan dapat menjawab kueri, tetapi tidak ada persyaratan tentang
seberapa baru data yang disajikan.
Tidak ada jaminan bahwa satu sesi logis
akan terhubung ke beberapa node kumpulan baca di kumpulan baca. Permintaan selanjutnya dalam sesi dapat terhubung ke node kumpulan baca yang memiliki posisi replikasi (GTID) yang lebih rendah daripada node kumpulan baca yang melayani permintaan sebelumnya, yang dapat menyebabkan status database tampak kembali ke masa lalu.
Jenis pembaruan berikut tidak didukung:
Meskipun kumpulan baca tetap menerima update pemeliharaan Cloud SQL, Anda tidak dapat
mengupdate kumpulan baca ke versi database utama atau minor yang baru.
Memulai atau menghentikan node kumpulan baca
Selain operasi yang tidak didukung pada replika baca, operasi berikut tidak didukung pada kumpulan baca:
mempromosikan replika
restart
import
ekspor
failover
dienkripsi ulang
clone
Fitur berikut tidak dapat digunakan dengan kumpulan baca:
Private Service Connect
Sertifikat SSL/TLS dengan CA bersama atau CA yang dikelola pelanggan
Kumpulan baca tidak dapat mereplikasi ke instance lain, misalnya, replika bertingkat atau kumpulan baca lain.
Kumpulan baca harus mereplikasi langsung dari instance utama. Replika ini tidak dapat berupa
replika bertingkat.
Jika ingin mengonversi replika baca regional menjadi kumpulan baca, Anda harus
mengonversi replika baca regional menjadi replika baca zonal terlebih dahulu.
Saat membuat atau menskalakan kumpulan baca, Anda harus menunggu operasi buat kumpulan,
penyusutan skala, atau perluasan skala sebelumnya yang terkait dengan kumpulan baca selesai. Batasan
ini berlaku untuk kumpulan baca lainnya yang terkait dengan instance
primer yang sama. Jika Anda ingin menskalakan beberapa kumpulan baca yang terkait dengan
instance utama yang sama, Anda harus menunggu hingga operasi penskalaan yang terkait dengan
kumpulan baca pertama selesai sebelum Anda mulai menskalakan kumpulan baca berikutnya. Jika Anda
mengirim permintaan serentak, Anda mungkin menerima error berikut:
Operation failed because another operation was already in progress..
Hanya replika zona yang berada di region yang sama dengan replika utama yang dapat
dikonversi untuk digunakan di kumpulan baca.
Anda tidak dapat menambahkan atau menghapus node kumpulan baca dari kumpulan baca saat Anda
mengubah jenis mesinnya secara bersamaan.
Jika aplikasi Anda harus terhubung ke replika baca khusus—misalnya, karena indeks sekunder ada pada replika baca tertentu—buat
replika baca Cloud SQL dan gunakan replika tersebut.
Anda tidak dapat membuat kueri pengguna dan database tertentu yang terkait dengan
kumpulan baca. Karena Cloud SQL Studio mengandalkan data yang disediakan oleh pengguna dan database, Cloud SQL Studio tidak didukung dengan kumpulan baca.
[[["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-09-04 UTC."],[],[],null,["# About read pools\n\n\u003cbr /\u003e\n\nMySQL \\| [PostgreSQL](/sql/docs/postgres/about-read-pools \"View this page for the PostgreSQL database engine\") \\| SQL Server\n\n\u003cbr /\u003e\n\n|\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| You can process personal data for this feature as outlined in the\n| [Cloud Data Processing\n| Addendum](/terms/data-processing-addendum), subject to the obligations and restrictions described in the agreement under\n| which you access Google Cloud.\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nCloud SQL read pools support load balancing for your large read workloads.\n\nWhat are read pools?\n--------------------\n\nA *read pool* is a collection of read replica instances used to distribute\nyour large read workloads. These workloads can be redirected from the primary\ninstance to the read pool to reduce load on the primary instance.\n\nEach read replica in the read pool is called a *read pool node*.\n\nYou can scale your read pool in several ways:\n\n- **Scale in or out**: scale load balancing capacity horizontally by modifying the number of read pool nodes in the read pool. Each read pool supports between 1 and 20 read pool nodes.\n- **Scale up or down**: scale load balancing capacity vertically by modifying the machine type associated with a read pool node. Once defined, configuration is uniformly applied across each read pool node in the read pool.\n\nWhen you modify read pool node settings such as storage, connectivity, or\ndatabase configuration flags, the changes are automatically applied uniformly\nacross each read pool node in the read pool.\n\nThe read pool is accessible through a *single read endpoint* with\nan immutable IP address. Connections made through the endpoint are\nautomatically redirected to one of the read pool nodes. When you want the\nread pool to scale in or scale out, applications that were previously\nconnected to this single read endpoint don't need to be reconfigured, even\nthough you can create new read pool nodes in the read pool or delete previous\nones.\n\nEach read pool node also has its own IP address. While not\nrecommended as an efficient approach for accessing your data, you can use\nthese IP addresses to troubleshoot individual read pool node performance.\n\nFor more information on how to retrieve the connection information for the\nread pool or the read pool nodes (either IP addresses or a connection string),\nsee\n[View read pool information](/sql/docs/mysql/create-read-pool#view-read-pool).\n\nThe following characteristics apply:\n\n- Read pool nodes of the read pool always reside in the same region, as specified by the user. Google Cloud alternates read pool node residency among all zones in the region.\n- A primary instance can have one or more read pools.\n- The following operations incur sub-second downtime:\n - Scaling out or in (adding or removing read pool nodes).\n - Scaling up or down (changing the machine type of the nodes in the pool).\n - Converting an existing zonal read replica to a read pool.\n- A read pool receives maintenance before its primary instance, similar to read replicas. Like read replicas, read pools receive maintenance during the primary instance's maintenance window.\n- Each read pool node has the same metrics available as a Cloud SQL read replica.\n- When using `gcloud` or the Google Cloud console to describe the details of a project, the read pool name is listed, individual read pool node names are not.\n\nLimitations\n-----------\n\nThe following limitations apply:\n\n- Read pools are only available for [Cloud SQL Enterprise Plus edition](/sql/docs/mysql/editions-intro) instances on the [new network architecture](/sql/docs/mysql/upgrade-cloud-sql-instance-new-network-architecture#check-single-instance). The primary instance associated with a read pool must also be a Cloud SQL Enterprise Plus edition instance.\n- Traffic is served from read pool nodes based on whether the database is healthy, but regardless of how high replication lag on that read pool node is. Traffic can be served from a lagging read pool node even if another read pool node is available that isn't lagging. A database is considered healthy if the database process is up and can answer queries, but there is no requirement on how fresh the data being served is.\n- No guarantee is made about a single logical session connecting to multiple read pool nodes in the read pool. It's possible for later requests in a session to connect to a read pool node that has a lower replication position (GTID) than the read pool node that served an earlier request, which can cause the state of the database to appear to go back in time.\n- The following types of updates aren't supported:\n - While read pools still receive Cloud SQL maintenance updates, you can't update your read pool to a new major or minor database version.\n - Starting or stopping nodes of the read pool\n- In addition to operations that aren't supported on read replicas, the following operations aren't supported on read pools:\n - promote replica\n - restart\n - import\n - export\n - failover\n - re-encrypt\n - clone\n- The following features can't be used with a read pool:\n - Private Service Connect\n - SSL/TLS certificates with shared CA or customer-managed CA\n- A read pool can't replicate to another instance, for example, a cascading replica or another read pool.\n- A read pool must replicate directly from a primary instance. It can't be a cascading replica.\n- If you want to convert a regional read replica to a read pool, then you must first convert the regional read replica to a zonal read replica.\n- When creating or scaling a read pool, you must wait for previous create pool, scale in, or scale out operations associated with the read pool to finish. This restriction applies to any other read pool associated with the same primary instance. If you want to scale multiple read pools associated with the same primary instance, then you must wait for scaling operations associated with the first read pool to finish before you start scaling the next read pool. If you issue concurrent requests, then you might receive the following error: `Operation failed because another operation was already in progress.`.\n- Only a zonal replica located in the same region as the primary can be converted for use in a read pool.\n- You can't add or remove read pool nodes from the read pool while you're changing their machine type at the same time.\n- If your application must connect to a dedicated read replica---for example, because of secondary indexes present on a specific read replica---create a Cloud SQL read replica and use it instead.\n- You can't query specific users and databases associated with a read pool. Since Cloud SQL Studio relies on data provided by users and databases, Cloud SQL Studio isn't supported with read pools.\n\nWhat's next\n-----------\n\n- [Create and manage read pools](/sql/docs/mysql/create-read-pool)"]]