<@U04S8PLJWMT> if I select the "full refresh and o...
# ask-ai
p
@kapa.ai if I select the "full refresh and overwrite" and schedule a sync every 2 hours(source is aws rds and destination is snowflake), does it delete all data in snowflake first and then start populating data via sync? (airbyte version 1.6.0)
k
Yes, if you select the "Full Refresh - Overwrite" sync mode in Airbyte (version 1.6.0), each scheduled sync will first destroy (delete) all data in the existing destination table in Snowflake, and then repopulate it with the data pulled from your AWS RDS source. This means that any data previously in the destination table will be removed before the new data is written during each sync. The mechanism for this operation may vary depending on the destination connector. For certified database and data warehouse destinations like Snowflake, Airbyte typically recreates the final table on each sync. This is done by writing to a temporary table during the sync, and at the end, dropping the old final table and renaming the new one into place. However, in some cases, Airbyte may simply erase the existing data at the start of the sync if recreating the table is not possible for that destination connector. In all cases, the end result is that the destination table contains only the latest data from the source after each sync, and any data not present in the source will be deleted from the destination after the sync completes [Full Refresh - Overwrite (v1.6)](https://docs.airbyte.com/platform/1.6/using-airbyte/core-concepts/sync-modes/full-refresh-overwrite). So, to directly answer your question: yes, all data in Snowflake is deleted (or the table is replaced) before new data is populated during each "Full Refresh - Overwrite" sync.
p
@kapa.ai what if I select "incremental | append + deduped"? sync is based on last_modified cursor
k
A message from kapa.ai
If you select "Incremental | Append + Deduped" sync mode and use a
last_modified
cursor, Airbyte will: - Sync only new or modified records since the last sync, based on the value of the
last_modified
field (the cursor). - Append the new or updated records to a history table in your Snowflake destination. - Deduplicate the data in the final table: for each primary key, only the latest record (according to the cursor field) will be present in the final table. This means that if a record with the same primary key is updated in the source, the final table in Snowflake will reflect only the most recent version of that record. Key behaviors: - The final table will have unique records per primary key, always showing the latest data according to the cursor. - Old versions of records are not kept in the final table, but may exist in the history table. - Records are never deleted from the final table unless they are replaced by a newer version (or if the source emits delete events, which is only possible with certain sources like CDC-enabled databases). This mode is useful when you want your destination to always reflect the latest state of your source data, without accumulating duplicates, and without deleting all data on each sync ([Incremental Sync - Append + Deduped](https://docs.airbyte.com/platform/1.6/using-airbyte/core-concepts/sync-modes/incremental-append-deduped), [Rules](https://docs.airbyte.com/platform/1.6/using-airbyte/core-concepts/sync-modes/incremental-append-deduped#rules)). Summary: With "Incremental | Append + Deduped" and a
last_modified
cursor, Airbyte will keep your Snowflake table up to date with the latest version of each record, based on the cursor, without deleting all data on each sync.