Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Halaman ini memberikan ringkasan replikasi lintas region AlloyDB untuk PostgreSQL.
Replikasi lintas region AlloyDB memungkinkan Anda membuat cluster dan instance sekunder dari cluster utama untuk membuat resource tersedia di berbagai region, jika terjadi pemadaman di region utama. Cluster dan instance sekunder ini berfungsi sebagai salinan resource cluster dan instance utama Anda.
Konsep utama di halaman ini meliputi:
Cluster utama. Cluster baca-tulis di satu region.
Cluster sekunder. Cluster hanya baca di region yang berbeda dengan cluster utama,
yang mereplikasi dari cluster utama secara asinkron.
Jika terjadi kegagalan cluster utama AlloyDB, Anda dapat
mempromosikan cluster sekunder menjadi cluster utama.
Anda dapat membuat hingga lima cluster sekunder untuk cluster primer. Semua cluster sekunder mereplikasi dari satu cluster utama. Jika Anda
mempromosikan cluster sekunder, cluster sekunder tersebut akan menjadi cluster
primer yang independen.
Instance sekunder. Pemimpin hanya baca dari cluster sekunder. Cluster ini
bertanggung jawab untuk menerima aliran replikasi dari cluster utama. Aliran
replikasi memperbarui volume penyimpanan di region sekunder berdasarkan
volume penyimpanan di region utama.
Jika cluster sekunder dipromosikan menjadi cluster utama, instance sekunder
akan menjadi instance utama.
Instance sekunder dapat berupa basic (zonal) atau ketersediaan tinggi
(regional).
Diagram berikut menggambarkan cara kerja replikasi lintas region:
Gambar 1. Contoh arsitektur replikasi lintas region AlloyDB.
Manfaat
Manfaat replikasi lintas region di AlloyDB meliputi hal-hal berikut:
Pemulihan dari bencana. Jika region cluster utama menjadi tidak tersedia, Anda dapat mempromosikan resource AlloyDB di region lain untuk melayani permintaan.
Mengurangi periode nonaktif. Dukungan ketersediaan tinggi (HA) di cluster sekunder mengurangi periode nonaktif selama peristiwa pemeliharaan atau pemadaman layanan yang tidak direncanakan.
Data yang didistribusikan secara geografis. Mendistribusikan data secara geografis akan mendekatkan data kepada Anda dan mengurangi latensi baca.
Peningkatan penskalaan baca: Setiap replika lintas region (atau cluster sekunder) dapat mendukung hingga 20 node baca, sehingga Anda dapat menskalakan baca lebih lanjut.
Pengalihan dengan nol kehilangan data. Untuk
penyiapan replikasi lintas region, AlloyDB mendukung pengalihan antara
instance utama dan sekunder tanpa kehilangan data.
Bekerja dengan replikasi lintas region
Bekerja dengan replikasi lintas region AlloyDB melibatkan tugas-tugas berikut:
Buat cluster sekunder.
Cluster sekunder adalah salinan cluster utama AlloyDB yang terus diperbarui.
Melihat cluster sekunder.
Setelah membuat cluster sekunder, Anda dapat melihat detailnya di halaman Cluster
di konsol Google Cloud .
Tambahkan instance kumpulan baca.
Anda dapat menambahkan instance pool baca ke cluster sekunder. Jika ingin menskalakan kapasitas baca secara horizontal, Anda dapat menambahkan hingga 20 node baca ke cluster sekunder.
Mempromosikan cluster sekunder.
Anda dapat membaca data dari cluster sekunder, tetapi Anda tidak dapat menulis ke cluster tersebut
hingga Anda mempromosikannya ke cluster utama mandiri yang memiliki fitur lengkap. Saat Anda
mempromosikan cluster sekunder, instance sekunder cluster juga
dipromosikan sebagai instance utama dengan kemampuan baca dan tulis.
Kasus penggunaan utama untuk mempromosikan cluster sekunder adalah pemulihan dari bencana.
Jika terjadi pemadaman layanan regional di region cluster utama, Anda dapat
mempromosikan cluster sekunder ke cluster utama mandiri, dan
melanjutkan penyajian aplikasi.
Pengalihan dengan nol kehilangan data.
Pengalihan memungkinkan Anda membalikkan peran cluster primer dan sekunder
tanpa kehilangan data. Anda dapat melakukan pengalihan untuk menguji penyiapan pemulihan dari bencana atau melakukan migrasi workload Anda. Saat Anda menyelesaikan pengalihan, arah replikasi akan dibalik.
Jika Anda memiliki beberapa cluster sekunder, cluster sekunder yang menerima perintah pengalihan akan menjadi cluster primer; cluster primer sebelumnya akan menjadi cluster sekunder, yang mereplikasi dari cluster primer baru. Semua cluster sekunder lainnya beralih mereplikasi dari cluster utama baru.
Ada dua skenario umum untuk melakukan pengalihan cluster sekunder:
Simulasi pemulihan dari bencana. Anda dapat menjalankan pengujian proses pemulihan bencana
dengan mengalihkan aplikasi ke region lain tanpa kehilangan data
untuk menyimulasikan pemadaman layanan regional.
Migrasi regional. Lakukan migrasi terencana resource AlloyDB dari region utamanya ke region lain. Pengalihan memastikan
bahwa cluster sekunder menjadi cluster primer dengan Toleransi Durasi Kehilangan Data (RPO) 0, sehingga memastikan
bahwa migrasi tidak kehilangan data apa pun.
Konfigurasi pencadangan otomatis dan berkelanjutan.
Secara default, AlloyDB otomatis menyalin konfigurasi pencadangan otomatis dan berkelanjutan dari cluster utama ke cluster sekunder yang baru dibuat. Jika ingin menggunakan konfigurasi pencadangan yang berbeda untuk
cluster sekunder, Anda dapat mengubah konfigurasi pencadangan saat
membuat cluster sekunder.
Jika cluster utama Anda menggunakan enkripsi kunci enkripsi yang dikelola pelanggan (CMEK) untuk cadangan, lakukan salah satu hal berikut saat Anda membuat cluster sekunder:
Berikan setelan enkripsi CMEK untuk cadangan cluster sekunder.
Nonaktifkan pencadangan untuk cluster sekunder.
Untuk mengetahui informasi selengkapnya tentang cara mengenkripsi cadangan Anda dengan CMEK, lihat Menggunakan CMEK.
Anda dapat mengubah setelan pencadangan otomatis dan berkelanjutan untuk cluster sekunder setelah dibuat.
[[["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-25 UTC."],[[["\u003cp\u003eAlloyDB cross-region replication creates read-only secondary clusters and instances in different regions, which mirror a primary cluster's data.\u003c/p\u003e\n"],["\u003cp\u003eSecondary clusters can be promoted to fully functional primary clusters in the event of a primary cluster failure, enabling disaster recovery.\u003c/p\u003e\n"],["\u003cp\u003eCross-region replication offers benefits like reduced downtime, geographic data distribution, geographic load balancing, and switchover with zero data loss.\u003c/p\u003e\n"],["\u003cp\u003eSecondary clusters can have up to 20 read nodes, allowing for increased read scaling capabilities.\u003c/p\u003e\n"],["\u003cp\u003eWorking with cross-region replication involves tasks such as creating and viewing secondary clusters, adding read pool instances, promoting secondary clusters, and performing switchovers with zero data loss.\u003c/p\u003e\n"]]],[],null,["# Cross-region replication overview\n\nThis page provides an overview of AlloyDB for PostgreSQL cross-region replication.\n\nAlloyDB cross-region replication lets you create secondary\nclusters and instances from a primary cluster to make the resources available in\ndifferent regions, in the event of an outage in the primary region. These\nsecondary clusters and instances function as copies of your primary cluster and\ninstance resources.\n\nKey concepts in this page include the following:\n\n- **Primary cluster.** A read-write cluster in a single region.\n\n- **Secondary cluster.** A read-only cluster in a different region than the primary,\n that replicates from the primary cluster asynchronously.\n In the event of a failure of an AlloyDB primary cluster, you can\n promote a secondary cluster to a primary cluster.\n\n You can create up to five secondary clusters for a primary cluster. All of\n the secondary clusters replicate from a single primary cluster. If you\n promote a secondary cluster, that secondary cluster becomes an independent\n primary cluster.\n- **Secondary instance.** A read-only leader of a secondary cluster. It is\n responsible for receiving a replication stream from a primary cluster. The\n replication stream updates the storage volume in the secondary region based on\n the storage volume in the primary region.\n If a secondary cluster is promoted to a primary cluster, the secondary instance\n becomes the primary instance.\n\n A secondary instance can be either basic (zonal) or high-availability\n (regional).\n\n The following diagram illustrates how cross-region replication works:\n\n**Figure 1.** Example of AlloyDB cross-region replication architecture.\n\nBenefits\n--------\n\nThe benefits of cross-region replication on AlloyDB include the\nfollowing:\n\n- **Disaster recovery.** In the event the primary cluster's region becomes\n unavailable, you can promote AlloyDB resources in another region\n to serve requests.\n\n- **Reduced downtime.** Support of high availability (HA) on secondary clusters\n reduces downtime during maintenance events or unplanned outages.\n\n- **Geographically distributed data.** Distributing the data geographically brings\n the data closer to you and decreases read latency.\n\n- **Increased read scaling:** Each cross-region replica (or secondary cluster)\n can support up to 20 read nodes, allowing you to scale your reads further.\n\n- **Switchover with zero data loss.** For\n cross-region replication setups, AlloyDB supports switchover between\n primary and secondary instance with zero data loss.\n\nWork with cross-region replication\n----------------------------------\n\n| **Note:** You cannot enable advanced query insights features for AlloyDB on instances in cross-region replica clusters. See [Limitations](/alloydb/docs/advanced-query-insights-overview#limitations) and [FAQ](/alloydb/docs/using-advanced-query-insights#advanced-query-insights-features-with-secondary-clusters) for more information.\n\nWorking with AlloyDB cross-region replication involves the following tasks:\n\n- [**Create a secondary cluster.**](/alloydb/docs/cross-region-replication/work-with-cross-region-replication#secondary-cluster-instance)\n A secondary cluster is a continuously updated copy of your AlloyDB\n primary cluster.\n\n- [**View a secondary cluster.**](/alloydb/docs/cross-region-replication/work-with-cross-region-replication#view-secondary-cluster)\n After you create a secondary cluster, you can view its details in the **Clusters**\n page in the Google Cloud console.\n\n- [**Add read pool instances.**](/alloydb/docs/cross-region-replication/work-with-cross-region-replication#read-pools-secondary-cluster)\n You can add read pool instances to a secondary cluster. If you want to scale your read\n capacity horizontally, you can add up to 20 read nodes to your secondary cluster.\n\n- [**Promote a secondary cluster.**](/alloydb/docs/cross-region-replication/work-with-cross-region-replication#promote-secondary-cluster)\n You can read the data from a secondary cluster, but you can't write to it\n until you promote it to a fully-featured, standalone primary cluster. When you\n promote a secondary cluster, the cluster's secondary instance is also\n promoted as a primary instance with read and write capabilities.\n\n The primary use case for promoting a secondary cluster is disaster recovery.\n If a regional outage occurs in your primary cluster's region, you can\n promote your secondary cluster to a standalone primary cluster, and\n resume serving your application.\n- [**Switchover with zero data loss.**](/alloydb/docs/cross-region-replication/work-with-cross-region-replication#switchover-secondary)\n Switchover lets you reverse the roles of your primary and secondary cluster\n with zero data loss. You can perform a switchover for testing\n your disaster recovery setup or performing migration of your workload. When\n you complete the switchover, the direction of replication\n is reversed.\n\n If you have multiple secondary clusters, the secondary cluster that receives\n the switchover command becomes a primary cluster; the previous primary\n cluster becomes a secondary cluster, replicating from the new primary\n cluster. All other secondary clusters switch to replicating from the new\n primary cluster.\n\n There are two common scenarios for switching over your secondary cluster:\n - **Disaster recovery drills.** You can run tests of your disaster recovery processes by switching your application over to another region with zero data loss to simulate a regional outage.\n - **Regional migration.** Perform a planned migration of the AlloyDB resources from their primary region to another region. Switchover ensures the secondary cluster becomes a primary cluster with 0 Recovery Point Objective (RPO), ensuring that the migration does not lose any data.\n- [**Configure automated and continuous backups.**](/alloydb/docs/backup/configure)\n By default, AlloyDB automatically copies automated and\n continuous backup configurations from the primary cluster to a newly created\n secondary cluster. If you want to use different backup configurations for\n your secondary cluster, you can modify the backup configuration when you\n create a secondary cluster.\n\n If your primary cluster uses customer-managed encryption key (CMEK) encryption\n for backups, do one of the following when you create a secondary cluster:\n - Provide CMEK encryption settings for the secondary cluster's backups.\n - Disable backups for the secondary cluster.\n\nFor more information about encrypting your backups with CMEK, see\n[Use CMEK](/alloydb/docs/use-cmek)\n\nYou can modify automated and continuous backup settings for the secondary\ncluster after its creation.\n\nWhat's next\n-----------\n\n- [Working with cross-region replication](/alloydb/docs/cross-region-replication/work-with-cross-region-replication)"]]