This chapter covers the core features and capabilities of Data Sync.
Follow this guide to get Data Sync up and running in your environment.
# Sync two JSON files by a key field
python src/data_sync.py --source customers_a.json --dest customers_b.json --key customer_id
# Sync CSV to SQLite with conflict strategy
python src/data_sync.py --source orders.csv --dest warehouse.db --key order_id --strategy source-wins
# Preview changes without writing (dry-run)
python src/data_sync.py --source new_data.json --dest master.json --key id --dry-run
# Incremental sync with state tracking
python src/data_sync.py --source export.json --dest mirror.json --key id --state sync_state.json
# Full pipeline from a config file
python src/data_sync.py --config examples/data_sync_config.jsonDefine a sync job in JSON:
{
"source": "customers_export.json",
"dest": "customers_master.json",
"key": "customer_id",
"strategy": "newest-wins",
"timestamp_field": "updated_at",
"state": "sync_state.json",
"dry_run": false,
"bidirectional": false,
"source_table": "customers",
"dest_table": "customers"
}| Flag | Default | Description |
|---|---|---|
--source, -s | — | Source file path (.json, .csv, .db, .sqlite) |
--dest, -d | — | Destination file path (.json, .csv, .db, .sqlite) |
--key, -k | id | Record key field used for matching |
--strategy | source-wins | Conflict resolution: source-wins, dest-wins, newest-wins |
--timestamp-field | updated_at | Timestamp field for newest-wins strategy |
--state | — | State file path for incremental sync (.json) |
--dry-run | off | Show the sync plan without writing changes |
--bidirectional | off | Sync changes in both directions |
--source-table | data | SQLite table name for source |
--dest-table | data | SQLite table name for destination |
--config, -c | — | JSON config file (overrides other flags) |
--log-level | INFO | DEBUG, INFO, WARNING, ERROR |
| Key | Type | Required | Description |
|---|---|---|---|
source | string | yes | Source file path |
dest | string | yes | Destination file path |
key | string | no | Key field (default: id) |
strategy | string | no | source-wins / dest-wins / newest-wins |
timestamp_field | string | no | Field for newest-wins comparison |
state | string | no | Path to state file for incremental sync |
dry_run | bool | no | Preview-only mode |
bidirectional | bool | no | Two-way sync |
source_table | string | no | SQLite table name (source) |
dest_table | string | no | SQLite table name (dest) |
Get the full Data Sync and unlock everything.
Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.
Access all interactive tools with complete data, all workload profiles, and the full scenario library.
Downloadable source code, configuration files, and working examples from every chapter.
Free updates for life. Every new chapter, tool, and improvement included.