Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Pemrosesan Pengambilan Data Perubahan (CDC)
Halaman ini memandu Anda menggunakan Change Data Capture (CDC) dalam Google Cloud Cortex Framework di BigQuery. BigQuery dirancang untuk menyimpan dan menganalisis data baru secara efisien.
Proses CDC
Saat data berubah di sistem data sumber Anda (seperti SAP), BigQuery tidak akan mengubah data yang ada. Sebagai gantinya,
informasi yang diperbarui akan ditambahkan sebagai data baru. Untuk menghindari duplikat, operasi penggabungan perlu diterapkan setelahnya. Proses ini
disebut pemrosesan Pengambilan Data Perubahan (CDC).
Data Foundation untuk SAP menyertakan opsi untuk membuat skrip bagi
Cloud Composer atau Apache Airflow guna menggabungkan
atau upsert
data baru yang dihasilkan dari update dan hanya menyimpan
versi terbaru dalam set data baru. Agar skrip ini berfungsi, tabel
harus memiliki beberapa kolom tertentu:
operation_flag
: Flag ini memberi tahu skrip apakah data disisipkan,
diperbarui, atau dihapus.
recordstamp
: Stempel waktu ini membantu mengidentifikasi versi terbaru
data. Flag ini menunjukkan apakah data:
- Disisipkan (I)
- Diperbarui (U)
- Dihapus (D)
Dengan memanfaatkan pemrosesan CDC, Anda dapat memastikan bahwa data BigQuery Anda
mencerminkan status terbaru sistem sumber secara akurat.
Tindakan ini akan menghilangkan entri duplikat dan memberikan dasar yang andal untuk
analisis data Anda.
Struktur set data
Untuk semua sumber data yang didukung, data dari sistem upstream pertama kali direplikasi ke set data BigQuery (source
atau replicated dataset
), dan hasil yang diperbarui atau digabungkan disisipkan ke set data lain (set data CDC). Tampilan pelaporan memilih data dari set data CDC,
untuk memastikan alat dan aplikasi pelaporan selalu memiliki versi terbaru
tabel.
Alur berikut menunjukkan cara pemrosesan CDC untuk SAP, yang bergantung pada
operational_flag
dan recordstamp
.

Gambar 1. Contoh pemrosesan CDC untuk SAP.
Alur berikut menggambarkan integrasi dari API ke dalam data Mentah dan pemrosesan CDC untuk Salesforce, yang bergantung pada kolom Id
dan SystemModStamp
yang dihasilkan oleh Salesforce API.

Gambar 2. Integrasi dari API ke dalam pemrosesan Data mentah dan CDC untuk Salesforce.
Beberapa alat replikasi dapat menggabungkan atau memperbarui data saat
menyisipkannya ke BigQuery, sehingga pembuatan skrip ini bersifat opsional. Dalam hal ini, penyiapan hanya memiliki satu set data. Set data pelaporan mengambil data yang diperbarui untuk pelaporan
dari set data tersebut.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-09-04 UTC.
[[["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."],[[["\u003cp\u003eChange Data Capture (CDC) in Google Cloud Cortex Framework for BigQuery adds updated information as new records instead of modifying existing ones.\u003c/p\u003e\n"],["\u003cp\u003eA merge or upsert operation is required after CDC to avoid duplicates and keep only the latest version of each record in a new dataset.\u003c/p\u003e\n"],["\u003cp\u003eThe process relies on \u003ccode\u003eoperation_flag\u003c/code\u003e and \u003ccode\u003erecordstamp\u003c/code\u003e fields to identify whether a record was inserted, updated, or deleted, and to track the most recent version.\u003c/p\u003e\n"],["\u003cp\u003eData is replicated into a \u003ccode\u003esource\u003c/code\u003e dataset, and the merged results are inserted into a separate CDC dataset, ensuring reporting tools always use the latest data version.\u003c/p\u003e\n"],["\u003cp\u003eSome replication tools can merge or upsert records during insertion into BigQuery, making the creation of CDC scripts optional, and allowing a single dataset approach.\u003c/p\u003e\n"]]],[],null,["# Change Data Capture (CDC) processing\n====================================\n\nThis page guides you through Change Data Capture (CDC) within Google Cloud Cortex Framework\nin BigQuery. BigQuery is designed for efficiently\nstoring and analyzing new data.\n\nCDC process\n-----------\n\nWhen data changes in your source data system\n(like SAP), BigQuery doesn't modify existing records. Instead,\nthe updated information is added as a new record. To avoid duplicates, a\nmerge operation needs to be applied afterwards. This process is\ncalled [Change Data Capture (CDC) processing](/bigquery/docs/migration/database-replication-to-bigquery-using-change-data-capture).\n\nThe Data Foundation for SAP includes the option to create scripts for\nCloud Composer or Apache Airflow to [merge](/bigquery/docs/reference/standard-sql/dml-syntax#merge_statement)\nor `upsert` the new records resulting from updates and only keep the\nlatest version in a new dataset. For these scripts to work the tables\nneed to have some specific fields:\n\n- `operation_flag`: This flag tells the script whether a record was inserted, updated, or deleted.\n- `recordstamp`: This timestamp helps identify the most recent version of a record. This flag indicates whether the record is:\n - Inserted (I)\n - Updated (U)\n - Deleted (D)\n\nBy utilizing CDC processing, you can ensure that your BigQuery\ndata accurately reflects the latest state of your source system.\nThis eliminates duplicate entries and provides a reliable foundation for\nyour data analysis.\n\nDataset structure\n-----------------\n\nFor all supported data sources, data from upstream systems are first replicated\ninto a BigQuery dataset (`source` or `replicated dataset`),\nand the updated or merged results are inserted into another dataset\n(CDC dataset). The reporting views select data from the CDC dataset,\nto ensure the reporting tools and applications always have the latest version\nof a table.\n\nThe following flow shows how the CDC processing for SAP, dependent on\nthe `operational_flag` and `recordstamp`.\n\n**Figure 1**. CDC processing example for SAP.\n\nThe following flow depicts the integration from APIs into Raw data and\nCDC processing for Salesforce, dependent on the `Id` and `SystemModStamp`\nfields produced by Salesforce APIs.\n\n**Figure 2**. Integration from APIs into Raw data and CDC processing for Salesforce.\n\nSome replication tools can merge or upsert the records when\ninserting them into BigQuery, so the generation of these\nscripts is optional. In this case, the setup only has a single\ndataset. The reporting dataset fetches updated records for reporting\nfrom that dataset."]]