:thread: Help with Airbyte resource
# ask-ai
v
đź§µ Help with Airbyte resource
k
Certainly! If you need help with Airbyte resources, here are some key points and options available: - Documentation: The [Airbyte documentation](https://docs.airbyte.com/) is a comprehensive resource for setup, troubleshooting, and advanced usage. It covers both open-source and enterprise features. - Community Support: You can ask questions and get help from other users via the [GitHub Discussions forum](https://github.com/airbytehq/airbyte/discussions) and the [Airbyte Community Slack](https://slack.airbyte.com/). Start with the #ask-ai channel, and if needed, move to #ask-community-for-troubleshooting for more in-depth help. - Enterprise Support: If you are an Airbyte Enterprise or OSS support package user, you can submit a ticket through the [Help Center](https://support.airbyte.com/hc/en-us) for direct assistance from the Airbyte team, available 7AM–7PM Eastern. Please check the documentation and Help Center before submitting a ticket. Note that support is limited for certain requests, such as forked versions or custom dbt transformations. More details are available in the [Enterprise support section](https://docs.airbyte.com/platform/next/community/getting-support#airbyte-enterprise-self-hosted-support). - Scaling and Resource Management: If your question is about resource usage (CPU, RAM, etc.), Airbyte can be resource-intensive, especially with many connections. You may need to adjust environment variables related to job scaling (e.g.,
JOB_MAIN_CONTAINER_CPU_LIMIT
,
JOB_MAIN_CONTAINER_MEMORY_LIMIT
) and consider running the Airbyte database on a well-provisioned external instance for better performance. For large-scale deployments, increasing CPU and RAM may help, but there are limits to how much can be achieved by scaling alone. More details and community experiences can be found in [this forum post](https://discuss.airbyte.io/t/995) and [this resource leak discussion](https://discuss.airbyte.io/t/2309). If you have a specific resource-related question (e.g., about configuring memory, CPU, or troubleshooting resource leaks), please provide more details so I can give more targeted guidance!
v
@kapa.ai I started a Airbyte job that has been running for last 3.5 hours . It has a total of 8 stream and currently it shows 58,755,854 records loaded in Airbyte UI . Max Memory limit of replication job that started is 16GB , memory request is 2GB and memory usage is 864MB currently . Similarly , CPU usage is 2.43 , cpu request is 1 and max cpu is 8 as per grafana . My question here is when there are more than enough resources available , why is the job taking so long to run ? There is only one sync that is running currently .
k
A message from kapa.ai
When a sync job in Airbyte is taking a long time to run—even though CPU and memory usage are well below the allocated limits—resource constraints are likely not the bottleneck. Here are some possible reasons, based on Airbyte documentation and community discussions: 1. Not All Bottlenecks Are Resource-Related If your sync pods are not maxing out CPU or memory, increasing these limits further will not speed up the job. The bottleneck could be elsewhere, such as: - Network latency or throughput between source and destination - Source or destination database performance (e.g., slow queries, limited IOPS) - Connector-specific limitations (e.g., API rate limits, inefficient queries) - Serialization/deserialization overhead, especially with large or complex records Community users have reported similar situations where resource usage was low, but syncs were still slow, indicating the need to look beyond resource allocation for performance tuning [Forum: How to speed up airbyte Jobs](https://discuss.airbyte.io/t/1842). 2. Connector and Data Characteristics The number of records, their size, and the number of columns can significantly impact sync speed. For example, users have observed that tables with many columns or sparse data can slow down syncs, even if the total data size is not huge. The fetch size and how the connector reads data (e.g., batch size, adaptive fetch) can also affect performance, but these are not always configurable [Github Issue: Slow sync from Postgres to Snowflake](https://github.com/airbytehq/airbyte/issues/36967). 3. Source Worker Behavior Airbyte’s source worker reads up to 10,000 records into memory at a time. If your records are large, this can require significant RAM, but if your memory usage is low, it suggests the records are not large or the connector is throttling itself for other reasons (e.g., waiting on the source/destination) [Scaling Airbyte: What To Scale](https://docs.airbyte.com/platform/operator-guides/scaling-airbyte#what-to-scale). 4. Single Sync Limitation Since you are running only one sync, parallelism is not a factor. The speed is determined by the slowest part of the pipeline (source read, network, or destination write). What You Can Do: - Check Source and Destination Performance: Run direct queries or writes outside Airbyte to see if they are slow. - Review Connector Logs: Look for warnings or errors that might indicate retries, throttling, or slow queries. - Network Latency: If source and destination are in different regions or clouds, network speed can be a major factor. - Connector-Specific Tuning: Some connectors have advanced settings (e.g., fetch size, batch size) that can be tuned, but not all expose these options. Summary: If your Airbyte job is not resource-bound, investigate the source/destination system performance, network latency, and connector-specific behaviors. Resource allocation alone will not improve sync speed if the bottleneck is elsewhere. If you need help identifying the bottleneck, reviewing detailed logs and metrics for the sync job is the next best step.
v
@kapa.ai Will _airbyte_emitted_at column generated be always same for a particular run irrespective of how many records are loaded in that particular run ?
k
A message from kapa.ai
The _airbyte_emitted_at column is a timestamp that indicates when Airbyte sent each record to the destination. According to the knowledge sources, this value is set for each record as it is processed during the sync. While records processed in the same batch or sync may have very similar _airbyte_emitted_at values, they are not guaranteed to be exactly the same for all records in a particular run, especially if the sync takes some time or processes records in multiple batches. For example, in the raw tables shown in the tutorials, different records from the same sync can have the same or slightly different _airbyte_emitted_at timestamps, depending on when each record was emitted:
Copy code
_airbyte_ab_id            |                                _airbyte_data                                |    _airbyte_emitted_at      --------------------------------------+-----------------------------------------------------------------------------+----------------------------  2abc7493-bfc8-4493-ab62-de6ffe094a2d | {"id": 1, "name": "Eg1 IncApp", "updated_at": "2022-09-01T11:01:41.666004"} | 2022-09-01 11:12:03.301+00  06e67da7-9c6a-46b6-a2e5-e1d102e16c7e | {"id": 2, "name": "Eg2a IncAp", "updated_at": "2022-09-01T11:02:05.017416"} | 2022-09-01 11:12:03.301+00  4559d1dd-e5a6-4c86-a8b5-afa8c7f3f833 | {"id": 2, "name": "Eg2b IncAp", "updated_at": "2022-09-01T11:16:38.093877"} | 2022-09-01 11:17:11.63+00  94871526-e631-49c6-a2f8-87a78755f8ae | {"id": 3, "name": "Eg3 IncApp", "updated_at": "2022-09-01T11:23:30.195854"} | 2022-09-01 11:24:19.629+00
As shown above, records from the same sync can have different _airbyte_emitted_at values, depending on when each record was processed and written to the destination. Therefore, _airbyte_emitted_at is not guaranteed to be the same for all records in a particular run, especially for large syncs or those that take a significant amount of time to process all records [Explore Airbyte’s incremental data synchronization](https://airbyte.com/tutorials/incremental-data-synchronization#step-7).
v
@kapa.ai What is the difference between _airbyte_extracted_at and ab_source_file_last_modified ? I can see for same run , for every record , extracted_at changes based on what time it was extracted but the last modified is same for every record .
k
A message from kapa.ai
The _airbyte_extracted_at and _ab_source_file_last_modified fields serve different purposes in Airbyte: - _airbyte_extracted_at: This is a timestamp indicating when Airbyte actually extracted (read) the record from the source. It is generated by Airbyte at the moment the record is processed, so it can vary for each record within the same sync run, depending on when each record was read. This field helps you track exactly when Airbyte ingested each record from the source system [Understanding Airbyte metadata fields](https://docs.airbyte.com/platform/understanding-airbyte/airbyte-metadata-fields). - _ab_source_file_last_modified: This field represents the last modified timestamp of the source file (for example, a CSV file in S3) from which the record was read. All records extracted from the same file will have the same _ab_source_file_last_modified value, since it reflects the file's last modification time, not the time each record was read. This is useful for incremental syncs based on file changes. In summary: - _airbyte_extracted_at = when Airbyte read the record - _ab_source_file_last_modified = when the source file was last changed This matches your observation: _airbyte_extracted_at changes per record, while _ab_source_file_last_modified is the same for all records from the same file.
v
@kapa.ai So if let's say I'm moving data from gcs to snowflake and the job runs overnight and the day actually changes , the extracted_at will have different dates for each record but will last_modified be same ?
k
A message from kapa.ai
Yes, your understanding is correct. When moving data from GCS to Snowflake using Airbyte, the _airbyte_extracted_at field will reflect the exact timestamp when each record is read by Airbyte. If your sync job runs overnight and spans a date change, records processed before and after midnight will have different _airbyte_extracted_at values, corresponding to the actual extraction time for each record. On the other hand, the _ab_source_file_last_modified field represents the last modified timestamp of the source file in GCS. All records extracted from the same file will have the same _ab_source_file_last_modified value, regardless of when during the sync they are processed. This value only changes if the source file itself is modified in GCS. So, even if the sync runs across multiple dates, _ab_source_file_last_modified will remain the same for all records from a given file, while _airbyte_extracted_at can vary for each record depending on when it was read [Understanding Airbyte metadata fields](https://docs.airbyte.com/platform/understanding-airbyte/airbyte-metadata-fields) [Google Cloud Storage (GCS) Source Setup](https://docs.airbyte.com/integrations/sources/gcs#google-cloud-storage-gcs).
v
@kapa.ai How is the column _ab_source_file_last_modified extracted ? Is it the property of gcs file and extracted from gcs or airbyte creates it at runtime ?
k
A message from kapa.ai
The _ab_source_file_last_modified column is extracted from the source file's metadata in GCS. It represents the last modified timestamp of the file in Google Cloud Storage and is not generated by Airbyte at runtime. Airbyte reads this property directly from GCS and assigns it to all records extracted from that file. This ensures that all records from the same file have the same _ab_source_file_last_modified value, reflecting the actual last modification time of the file in GCS [Google Cloud Storage (GCS) Source Setup](https://docs.airbyte.com/integrations/sources/gcs#google-cloud-storage-gcs).
v
@kapa.ai Coming back to the _airbyte_extracted_at and _ab_source_file_last_modified , the column _ab_source_file_last_modified this will be same for same file as we discussed . But let's say there are multiple parquet generated from a run which are being run and moved to snowflake from gcs . Although these are part of same run , will the dates be different or same ? Because the modified_on of all these files is different as multiple parquets are generated .
k
A message from kapa.ai
Yes, if multiple Parquet files are generated in GCS and each has a different last modified timestamp, then the _ab_source_file_last_modified value will reflect the last modified time of each individual file. When Airbyte reads records from these files and moves them to Snowflake, all records from the same Parquet file will have the same _ab_source_file_last_modified (matching that file’s last modified property in GCS), but records from different files will have different _ab_source_file_last_modified values if the files themselves have different modification times. This is because Airbyte extracts this value from the file metadata in GCS, not from the sync run itself [Google Cloud Storage (GCS) Source Setup](https://docs.airbyte.com/integrations/sources/gcs#google-cloud-storage-gcs). So, even within the same sync run, if you have multiple source files with different modification times, the _ab_source_file_last_modified column will differ between records originating from different files.
v
@kapa.ai Now my question is , is there any column geenrated by airbyte while moving data from gcs to snowflake which is reliable and will only have the date at which the run actually triggered irrespecitve of the fact whether it ran the same day or carry forwarded to next day ?
k
A message from kapa.ai
Based on the available knowledge sources, there is **no default column generated by Airbyte when moving data from GCS to Snowflake that reliably and exclusively contains the timestamp of when the sync run was triggered**—regardless of how long the run takes or how many days it spans. - _airbyte_extracted_at records the time each record was extracted, which can vary throughout the run. - _ab_source_file_last_modified reflects the last modified time of the source file in GCS, not the sync run time. - _airbyte_emitted_at is the time the record was emitted to the destination, which also varies during the run. There is mention in the Airbyte community and documentation of a sync_id or similar field being stored in the
_airbyte_meta
object for some certified destinations, which could potentially be used to identify the sync run for each record. However, the knowledge sources do not explicitly confirm that this is available or reliable for the GCS to Snowflake pipeline, nor do they provide details on how to access or use it in this context [Github Issue: Track incrementally synced rows](https://github.com/airbytehq/airbyte/issues/4025). Summary: There is no single column guaranteed by Airbyte to always contain the sync run's trigger time for every record in a GCS to Snowflake sync, based on the current documentation and knowledge sources. If you need this functionality, you may need to implement a custom solution or check if your Airbyte version and destination support extracting the sync run ID or trigger time from the
_airbyte_meta
object.
v
@kapa.ai I'm moving data from mysql to gcs using CDC and I want to do a count check after moving the data . Now the problem is that the gcs data is constant once written but since mysql is contantly changing , it is possible that after the data moves and by the time I take count of records from mysql , the count can change and mismatch from gcs. Is there a cutoff timestamp in airbyte generated columns which can be used to filter data in mysql ?
k
A message from kapa.ai
Airbyte does not generate a specific "cutoff timestamp" column that you can directly use to filter data in MySQL for an exact count comparison with the data written to GCS during a CDC sync. However, when using CDC, Airbyte adds metadata columns such as _ab_cdc_updated_at (the timestamp for the database transaction that resulted in a record change) and _ab_cdc_lsn (the log sequence number or equivalent) to the records written to the destination. The _ab_cdc_updated_at field reflects the time of the change event in MySQL, not the time the record was extracted or written to GCS [Change Data Capture (CDC) documentation](https://docs.airbyte.com/platform/understanding-airbyte/cdc). You could use the maximum value of _ab_cdc_updated_at from the data written to GCS as a logical cutoff. To do a count check, you would: 1. Find the maximum _ab_cdc_updated_at value in your GCS data. 2. Query your MySQL source for the count of records with an updated_at (or equivalent CDC cursor field) less than or equal to this value. Limitations: - This approach assumes your MySQL table has a reliable timestamp column that matches the CDC cursor field. - There may be a slight mismatch if there are records with the same timestamp as the cutoff that were not included in the sync due to how CDC processes events. - If your CDC is based on log sequence numbers (LSN) rather than timestamps, you may need to use the LSN for more precise filtering, but this is more complex and not always directly supported for ad-hoc queries. Summary: While there is no explicit "cutoff timestamp" column generated for this purpose, you can use the _ab_cdc_updated_at field in your GCS data as a practical cutoff for comparing counts with MySQL, understanding the above limitations [Change Data Capture (CDC) documentation](https://docs.airbyte.com/platform/understanding-airbyte/cdc).
v
@kapa.ai When I move data from mysql to gcs , I get the column _ab_cdc_updated_at but when I move from say appsflyer using same technique , I don't get this column . Why ? Does appsflyer connector use incremental append or cdc or something els ?
k
A message from kapa.ai
The reason you see the _ab_cdc_updated_at column when moving data from MySQL to GCS, but not when moving data from Appsflyer, is due to the replication method used by each connector. - MySQL Source: When using MySQL with Change Data Capture (CDC), Airbyte adds CDC-specific metadata columns such as _ab_cdc_updated_at to the output. This column represents the timestamp of the database transaction that resulted in a record change and is present for records from DELETE/INSERT/UPDATE statements. These columns are specific to sources that support log-based CDC replication [Change Data Capture (CDC)](https://docs.airbyte.com/platform/understanding-airbyte/cdc). - Appsflyer Source: The knowledge sources do not mention Appsflyer as a CDC-capable source. Most SaaS connectors like Appsflyer use incremental append or full refresh replication modes, not CDC. In incremental append mode, Airbyte does not add CDC metadata columns like _ab_cdc_updated_at. Instead, it relies on a cursor field (such as an updated_at or timestamp field provided by the API) to fetch new or updated records, but it does not generate CDC-specific columns [Incremental Sync - Append](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-modes/incremental-append). Summary: You only see _ab_cdc_updated_at with sources that use CDC (like MySQL). Appsflyer uses incremental append or full refresh, so CDC columns are not present in its output. The replication mode and available metadata columns depend on the capabilities of the source connector and the sync mode selected.
v
@kapa.ai I want to understand one thing , what happens when I sync data from mysql to gcs . Basically , let's say the job triggers at 00:00 utc at any given date , then the job starts running and since mysql is prod db , it keeps getting data . But does airbyte also adds those records or only captures the record that were present in the db at the time when job actually started ?
k
A message from kapa.ai
When you sync data from MySQL to GCS using Airbyte, the behavior depends on the replication mode you are using: - If you are using Change Data Capture (CDC): Airbyte reads changes from the MySQL binary log (binlog). When a sync job starts (e.g., at 00:00 UTC), Airbyte will: 1. For the first sync, take a snapshot of the current state of the data at the time the sync starts. This snapshot includes all records present in the database at the start time. 2. For subsequent syncs, Airbyte reads and processes all changes (INSERTs, UPDATEs, DELETEs) that occurred in the database since the last sync, up to the start time of the current sync. Importantly, Airbyte does not capture changes that happen after the sync job has started. It only processes changes that occurred up to the start time of the sync. This means that if new records are inserted into MySQL after 00:00 UTC (after the sync has started), those records will not be included in the current sync—they will be picked up in the next sync run [Change Data Capture (CDC)](https://docs.airbyte.com/platform/understanding-airbyte/cdc). - If you are using standard incremental or full refresh modes: Airbyte queries the source database for new or updated records based on a cursor field (like
updated_at
). The records selected are those that meet the criteria at the time the sync job queries the database. Again, any changes that happen after the query is executed will not be included in the current sync. Summary: Airbyte only captures records that were present or changed in MySQL up to the start time of the sync job. Any new records added to MySQL after the sync starts will be included in the next sync, not the current one. This ensures consistency and avoids partial or duplicate data capture [Change Data Capture (CDC)](https://docs.airbyte.com/platform/understanding-airbyte/cdc).
v
@kapa.ai So is there any way I can get the timestamp when the first trigger happened or basically when the job triggered to get the cutoff timestamp and filter records in mysql ?
k
A message from kapa.ai
Based on the available knowledge sources, Airbyte does not automatically add a column to your destination data that records the exact timestamp when a sync job was triggered (i.e., the "cutoff" timestamp for the sync). The metadata columns generated by Airbyte—such as _airbyte_extracted_at, _airbyte_emitted_at, or CDC-specific fields—reflect when each record was processed or when the change occurred, not when the sync job itself started. However, Airbyte does store job metadata, including the job start time, in its internal jobs database. The
jobs
table contains a
started_at
column, which records the timestamp when each sync job started. This information is not written to your destination tables by default, but you can access it via Airbyte's internal database or API if you need to correlate it with your data [Jobs Database Schema](https://docs.airbyte.com/platform/understanding-airbyte/database-data-catalog#jobs-database). Summary: - There is no default column in your destination data with the sync job's trigger/start time. - You can retrieve the job start time from Airbyte's internal jobs database (
started_at
column in the
jobs
table) or via the Airbyte API. - If you need this timestamp in your destination data, you would need to implement a custom solution to inject it during or after the sync process. The knowledge sources do not describe a built-in way to automatically include the sync trigger time as a column in your destination data.
v
@kapa.ai How does ab_cdc_cursor work ? If a record is created , and the same record comes in because some field was updated or let's say a record was already present and then it was deleted , how are these handled using this column ?
k
A message from kapa.ai
The _ab_cdc_cursor (or sometimes _ab_cdc_lsn, depending on the database) is a metadata column generated by Airbyte when using Change Data Capture (CDC) replication. It represents the position in the database's transaction log (such as the binlog for MySQL or WAL for Postgres) where a particular change (INSERT, UPDATE, DELETE) was recorded. Here’s how _ab_cdc_cursor works in different scenarios: - Record Created (INSERT): When a new record is inserted, Airbyte reads the corresponding change from the transaction log. The _ab_cdc_cursor value for this record will be set to the log position (e.g., LSN or binlog offset) where the insert occurred. - Record Updated: If a record is updated, a new change event is written to the transaction log. Airbyte captures this event, and the updated record will have a new _ab_cdc_cursor value corresponding to the log position of the update. This allows Airbyte to track the sequence of changes for the same record over time. - Record Deleted: When a record is deleted, a delete event is written to the transaction log. Airbyte captures this event, and the deleted record will have a _ab_cdc_cursor value indicating the log position of the delete operation. In the destination, the record will typically have the _ab_cdc_deleted_at field set to the timestamp of deletion, and all other data fields may be unset except for the primary key [Change Data Capture (CDC)](https://docs.airbyte.com/platform/understanding-airbyte/cdc). How are these handled? - The _ab_cdc_cursor allows Airbyte to order and deduplicate events, ensuring that the most recent change for a record is applied in the destination. - For each change (insert, update, delete), a new record is emitted with a unique _ab_cdc_cursor value, reflecting the order of operations in the source database. - When merging data into the destination, Airbyte uses the _ab_cdc_cursor to determine which version of a record is the latest, and to handle deletes appropriately (e.g., removing the record from the final table if the latest event is a delete) [Change Data Capture (CDC)](https://docs.airbyte.com/platform/understanding-airbyte/cdc). Example: - Record inserted: _ab_cdc_cursor = 100 - Record updated: _ab_cdc_cursor = 120 - Record deleted: _ab_cdc_cursor = 140 Each event is tracked and can be replayed or merged in order, ensuring data consistency and accurate change tracking. If you need more technical details about the merge logic, Airbyte’s merge scripts use the _ab_cdc_cursor to compare and update records in the destination, always keeping the latest version based on the cursor value [Github Issue: missing new & updated records](https://github.com/airbytehq/airbyte/issues/51559). If you need further clarification or have a specific scenario in mind, let me know!
v
@kapa.ai What's the difference between incremental append and incremental append + deduped ?
k
A message from kapa.ai
The difference between Incremental Append and Incremental Append + Deduped sync modes in Airbyte is how they handle updated records and deduplication: - Incremental Append: - Only new or modified records since the last sync are replicated. - Each new or updated record is appended to the destination table. - If a record is updated multiple times, multiple versions of that record will exist in the destination (i.e., no deduplication). - This mode is useful for keeping a full history of all changes, but can result in duplicate records for the same primary key [Incremental Sync - Append](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-modes/incremental-append). - Incremental Append + Deduped: - Also syncs only new or modified records since the last sync. - Appends the delta to a history table, but also maintains a deduplicated final table. - In the deduplicated table, only the latest version of each record (based on the primary key and cursor field) is kept—older versions are removed. - This mode is useful when you want a current, up-to-date view of your data without duplicates, while still optionally retaining a history table [Incremental Sync - Append + Deduped](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-modes/incremental-append-deduped). Summary: - Incremental Append: Keeps all versions (no deduplication). - Incremental Append + Deduped: Keeps only the latest version per primary key in the final table (deduplicated view). For more details and examples, see the official documentation on [Incremental Sync - Append](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-modes/incremental-append) and [Incremental Sync - Append + Deduped](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-modes/incremental-append-deduped).
v
@kapa.ai There are 2 methods while moving data from mysql - scan using cursor column and cdc . If I use cdc , there are then 4 more options depending on destination - full refresh overwrite , full refresh append , incremental append and incremental append + deduped . If I move the data say from mysql to gcs and using incremental append and new column _airbyte_ab_id is generated , when moving the data from gcs to let's say snowflake , can we use this column to dedupe on ? I don't think it will be correct as this doesn't define the actual business PK that is supposed to be used for deduplication .
k
A message from kapa.ai
You are correct: _airbyte_ab_id is not suitable for deduplication based on business logic. This column is a random UUID generated by Airbyte for each record as it is processed and written to the destination. Its purpose is to uniquely identify each record in the raw data table, but it does not correspond to any business primary key or unique identifier from your source data. When you move data from GCS to Snowflake, if you want to deduplicate records (for example, using the Incremental Append + Deduped sync mode), you should use the actual business primary key fields from your source data—such as the original primary key columns from MySQL—not _airbyte_ab_id. Airbyte allows you to specify which field(s) to use as the primary key for deduplication, and you can select one or more fields to form a composite primary key if needed [User-Defined Primary key](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-modes/incremental-append-deduped#user-defined-primary-key). In summary: - _airbyte_ab_id is not a business key and should not be used for deduplication. - Always use the actual business primary key(s) from your source data for deduplication when moving data between destinations [Forum: _airbyte_ab_id is not a business PK](https://discuss.airbyte.io/t/2055). This approach ensures that deduplication reflects the true uniqueness of your business data.
v
@kapa.ai What is the diff between _ab_cdc_updated_at and _airbyte_emitted_at ? For my files , I can see _airbyte_emitted_at is same but _ab_cdc_updated_at is changing for every record .
k
A message from kapa.ai
The difference between _ab_cdc_updated_at and _airbyte_emitted_at is as follows: - _ab_cdc_updated_at: This column represents the timestamp of the database transaction that resulted in a record change (INSERT, UPDATE, or DELETE) in the source database. It is set based on when the change actually happened in the source system, so it can be different for every record, reflecting the true change history in your source (e.g., MySQL) [Change Data Capture (CDC)](https://docs.airbyte.com/platform/understanding-airbyte/cdc). - _airbyte_emitted_at: This column indicates the timestamp when Airbyte sent (emitted) the record to the destination. If records are processed in the same batch or very close together, this value can be the same for many records, as it reflects when Airbyte wrote the records to the destination, not when the change occurred in the source [Explore Airbyte’s incremental data synchronization](https://airbyte.com/tutorials/incremental-data-synchronization#step-7). In summary: - _ab_cdc_updated_at changes for every record, reflecting the actual change time in the source. - _airbyte_emitted_at can be the same for many records, reflecting when Airbyte processed and sent the records to the destination.
v
@kapa.ai I have multiple parquet files across which data can be duplicated as I'm using incremental append with cdc . Question is which column should I use to de-dupe the data given that I have a PK available ? And also , which column does Airbyte uses internally while moving data in incremental append + deduped scenario ?
k
A message from kapa.ai
To de-duplicate your data across multiple Parquet files when using incremental append with CDC, you should use your business primary key (PK) column(s) for deduplication. The primary key uniquely identifies each record in your source data and is the correct field to use for deduplication, not Airbyte-generated columns like
_airbyte_ab_id
. When Airbyte performs Incremental Append + Deduped syncs, it uses the primary key(s) you specify (or that are defined in the source schema) to identify unique records. Deduplication is performed by sorting records using the cursor field (such as an updated timestamp or CDC log position) and keeping only the latest record for each primary key in the final table. This ensures that, even if duplicates exist across files or batches, only the most recent version per primary key is retained in the deduplicated table [Incremental Sync - Append + Deduped](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-modes/incremental-append-deduped) and [User-Defined Primary key](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-modes/incremental-append-deduped#user-defined-primary-key). Summary: - You should use your business PK for deduplication. - Airbyte uses the primary key(s) and the cursor field to deduplicate records in Incremental Append + Deduped mode. This approach ensures accurate and reliable deduplication across all your Parquet files.
v
@kapa.ai That's my question , what is that cursor field that Airbyte uses internally ?
k
A message from kapa.ai
Airbyte uses the cursor field to determine which record is the most recent for each primary key during deduplication in the Incremental Append + Deduped sync mode. The cursor field is typically a column that can be used to track new or updated records, such as a timestamp or an incrementing ID. The process for determining the cursor field is as follows: 1. If the source defines a cursor internally (
source_defined_cursor
is true), Airbyte uses that and it cannot be overridden. 2. If you set a cursor field in the connection configuration (
cursor_field
in
ConfiguredAirbyteStream
), Airbyte uses that field. 3. If the source provides a default cursor field (
default_cursor_field
in
AirbyteStream
), Airbyte uses that unless you override it. 4. If none of the above are set, the configuration is invalid and the sync cannot proceed. The cursor field is used to sort records for each primary key, and Airbyte keeps only the latest record (based on the cursor value) in the deduplicated table [Logic for resolving the Cursor Field](https://docs.airbyte.com/platform/understanding-airbyte/airbyte-protocol#logic-for-resolving-the-cursor-field). Example: If your source table has an
updated_at
column and you configure it as the cursor field, Airbyte will use
updated_at
to determine which record is the most recent for each primary key during deduplication. For more technical details, see the documentation on [cursor fields and deduplication](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-modes/incremental-append-deduped#user-defined-cursor).
v
@kapa.ai I can see that the column _ab_source_file_last_modified is picked as a cursor automatically when moving data from gcs to snowflake . Does any of the 2 fields - _ab_cdc_updated_at or _airbyte_emitted_at be used for this purpose if we're doing de-dupe offline on our own for some purpose ?
k
A message from kapa.ai
Based on the available knowledge sources, when moving data from GCS to Snowflake, Airbyte often uses _ab_source_file_last_modified as the default cursor field, especially for file-based sources like GCS. This field reflects the last modified timestamp of the source file in GCS and is suitable for incremental syncs and deduplication in that context [Google Cloud Storage (GCS) Source Setup](https://docs.airbyte.com/integrations/sources/gcs#google-cloud-storage-gcs). Regarding your question about using _ab_cdc_updated_at or _airbyte_emitted_at for offline deduplication: - _ab_cdc_updated_at: This field is only present if your source supports Change Data Capture (CDC), such as MySQL with CDC enabled. It represents the timestamp of the change event in the source database. For GCS sources, this field is not generated, so it cannot be used for deduplication in this scenario [Change Data Capture (CDC)](https://docs.airbyte.com/platform/understanding-airbyte/cdc). - _airbyte_emitted_at: This field is present for all records and indicates when Airbyte emitted the record to the destination. While you could technically use this field for deduplication, it is not recommended because it reflects the processing time in Airbyte, not a business or source-system event time. It may not provide reliable or meaningful deduplication, especially if records are re-synced or reprocessed [Explore Airbyte’s incremental data synchronization](https://airbyte.com/tutorials/incremental-data-synchronization#step-7). Summary: - _ab_source_file_last_modified is the default and most appropriate cursor for deduplication when syncing from GCS. - _ab_cdc_updated_at is not available for GCS sources. - _airbyte_emitted_at can be used, but it is not recommended for business-logic deduplication. If you are deduplicating offline, it is best to use a field that reflects the actual business event or file modification time, such as _ab_source_file_last_modified, rather than Airbyte-generated processing timestamps.