Replace mode : Delete and insert
How it works
REPLACE Mode follows a two-step process: delete existing data within a defined scope, then insert new data.
This ensures clean data for each synchronization by removing old values before writing new ones.
Technical implementation:
The key distinction is the deletion scope, which differs based on table type.
Visual representation:
Step 1 - DELETE: Remove data matching the scope
Step 2 - INSERT: Add new data
Result: Only new data remains in the scopeDeletion scope by table type
The scope of deletion is critical to understand in REPLACE Mode:
Fact tables (metrics)
Scope: Only the reference date being synchronized
Example with a daily metrics table:
Dimension tables (attributes)
Scope: The entire table
Example with a campaign attributes table:
Advantages
✅ Clean data guaranteed
No duplicates possible within the sync scope
Each synchronization provides a clean slate
Data consistency ensured for each reference date
✅ Handles source corrections
If source platform recalculates metrics, new values replace old ones
Perfect for metrics that may be adjusted retroactively
Ideal when combined with lookback windows
✅ Snapshot accuracy for dimensions
Dimension tables always reflect the current state from source
Deleted entities in source are automatically removed
No stale or obsolete records
✅ Predictable table size
Fact tables: size is stable per partition (one date = fixed row count)
Dimension tables: size reflects current source entity count
No uncontrolled growth
✅ Simple queries
No need for deduplication logic
Direct access to the most recent data
Straightforward aggregations
Disadvantages
❌ Complete loss of historical data on dimensions
Previous attribute values are permanently deleted
Cannot track how a campaign status evolved over time
No audit trail of changes
Impossible to answer "what was the value on X date?"
❌ Risk during partial failures
If deletion succeeds but insertion fails, data is lost
Requires robust error handling and transaction management
Backup/recovery strategies essential
❌ Higher processing costs
DELETE operations require scanning data (WHERE clause evaluation)
More expensive than INSERT mode
Impact increases with table size
❌ Performance impact on large dimension tables
Deleting entire table can be slow
Insertion of large datasets takes time
Can create locks during synchronization
❌ No historical analysis for dimensions
Cannot perform time-based analysis on attribute changes
Cannot reconstruct past states
Limited analytical capabilities for business intelligence
Use cases
Ideal for:
📊 Fact tables with recalculated metrics
📊 Dimension tables requiring current snapshot only
📊 Aggregated data that may be reprocessed
📊 Data quality fixes
Not suitable for:
❌ Dimension tables requiring historical tracking
❌ High-frequency synchronizations on large tables
❌ Event logs or immutable transactions
❌ Compliance or audit requirements
Best practices
Example: REPLACE with lookback window
Scenario: Google Ads metrics with 7-day attribution window
Without REPLACE mode: You'd have duplicate rows for 2025-01-15 with different conversion values.
With REPLACE mode: Clean data with the most accurate values.
Comparison: Fact tables vs Dimension tables
Deletion scope
Reference date only
Entire table
Data preserved
Other dates untouched
Nothing preserved
Historical tracking
✅ Yes (by date)
❌ No
Typical size
Very large
Small to medium
Sync frequency
Daily
Daily to weekly
Performance impact
Low (partition-level)
Medium to High (full table)
Use case
Metrics with corrections
Current state snapshots
Last updated