Docs

Log in to read the version of docs relevant to your site, or use the dropdown versions

Incremental Sync in Automatic Exports

Automatic Exports is in early access. Request access to enable this feature for your site.

Chargebee supports Incremental Sync, enabling you to export only the changes (create, update, delete) that occurred since the last successful export. Incremental sync supports efficient Change Data Capture (CDC) workflows and reduces data processing and transfer costs by eliminating redundant full exports.

How Incremental Sync Works

  • First Export (Snapshot):
    The initial export for each dataset is a full snapshot. All records are included with change_type = read.
  • Subsequent Exports (Incremental):
    Each subsequent export includes only the records that changed—created, updated, or deleted—since the previous export run.
  • Metadata:
    The metadata column definitions remain consistent across snapshot and incremental sync. Each record includes:
    • change_type: Indicates the type of change (create, update, delete, read) and can be used to load data into the warehouse accordingly.
    • record_extracted_at: Timestamp when the updated data became available in Chargebee’s data lakehouse.
    • record_exported_at: Timestamp when the data was exported to the configured destination.

How to Use the Data

The data is available in year, month, day, and hour-level partitions. The hour corresponds to the UTC hour when the export was scheduled. For example:

s3://<your-bucket>/<your-subfolder>/<your-domain>/incremental_sync/data/invoices/year=2025/month=08/day=15/hour=3

Use the change_type field to determine the appropriate operation to perform in the destination system (for example, insert, update, or delete).

  • Deleted records will have change_type = delete.
  • Sort by record_extracted_at to preserve the correct event order if multiple operations occur on the same row in a batch.
  • A schema file is also included for each dataset and updated when changes occur. This schema defines the structure of the underlying data. The schema file is available at the following path:
s3://<your-bucket>/<your-subfolder>/<your-domain>/incremental_sync/schema/<dataset-name>.json

Record Journey in Incremental Sync

Chargebee’s incremental sync tracks data changes over time, enabling downstream systems to maintain accurate, up-to-date datasets.

Full Snapshot Sync (First Sync)

The first export provides a complete snapshot of all existing records:

idfirst_namelast_namechange_typerecord_extracted_atrecord_exported_at
1JohnDoeread2025-08-18T00:00:00Z2025-08-18T03:00:00Z
2AliceBrownread2025-08-18T00:00:00Z2025-08-18T03:00:00Z
3CarlosRiveraread2025-08-18T00:00:00Z2025-08-18T03:00:00Z

change_type = read indicates a point-in-time snapshot. The first sync for every table is always a snapshot of the dataset (full export).

Incremental Sync (Subsequent Syncs)

Over time, the following changes occur:

  • John Doe’s last name is updated.
  • Alice Brown has been deleted.
  • Carlos Rivera remains unchanged.
  • A new record for Maria Chen is created, updated, and deleted all at once.

The following table shows how the records appear in the next export:

idfirst_namelast_namechange_typerecord_extracted_atrecord_exported_at
1JohnSmithupdate2025-08-18T06:45:00Z2025-08-18T08:00:00Z
2AliceBrowndelete2025-08-18T07:10:00Z2025-08-18T08:00:00Z
4MariaChencreate2025-08-18T07:30:00Z2025-08-18T08:00:00Z
5MariaChenupdate2025-08-18T07:45:00Z2025-08-18T08:00:00Z
6MariaChendelete2025-08-18T07:55:00Z2025-08-18T08:00:00Z

Schema Changes in Incremental Sync

Chargebee handles schema evolution gracefully:

Change TypeBehavior
New column added

A full export is triggered automatically to populate historical data with the new column.
All records will have change_type = read.

Column removed

The column is excluded from future exports.
No full export is triggered.

New table added

A full export is initiated for the new table as a part of historical backfilling.
All records will have change_type = read.

Table removed

The table is no longer exported.
No change is triggered in existing exports.

Was this article helpful?