Sources Overview
Sources are the databases from which EZ-CDC captures changes. EZ-CDC connects to your source database's change stream and captures every INSERT, UPDATE, and DELETE operation in real-time.
Supported Sources
| Source | CDC Method | Status | Documentation |
|---|---|---|---|
| PostgreSQL | Logical Replication (pgoutput) | ✅ Stable | Setup Guide |
| MySQL | Binary Log (binlog) | 🔜 Coming Soon | - |
| Oracle | LogMiner | 🔜 Planned | - |
| SQL Server | Change Tracking | 🔜 Planned | - |
How Sources Work
Change Data Capture (CDC)
CDC captures changes by reading the database's transaction log:
Event Types
EZ-CDC captures these event types:
| Event | Description | Data Included |
|---|---|---|
| INSERT | New row added | All column values |
| UPDATE | Row modified | New values + primary key |
| DELETE | Row removed | Primary key |
| BEGIN | Transaction start | Transaction ID |
| COMMIT | Transaction end | Transaction ID, LSN |
Normalized Format
All sources emit events in a normalized CdcRecord format:
enum CdcRecord {
Insert {
schema: String,
table: String,
values: HashMap<String, Value>,
},
Update {
schema: String,
table: String,
values: HashMap<String, Value>,
key: HashMap<String, Value>,
},
Delete {
schema: String,
table: String,
key: HashMap<String, Value>,
},
// ...
}
This allows any source to work with any sink.
Source Configuration
Common Settings
All sources share these configuration options:
| Setting | Description | Default |
|---|---|---|
| Connection URL | Database connection string | Required |
| Tables | Tables to replicate | Required |
| SSL Mode | TLS connection settings | prefer |
Source-Specific Settings
Each source has additional settings:
- PostgreSQL: Replication slot, publication name
- MySQL: Server ID, binlog position
- Oracle: LogMiner settings
Adding a Source
Via Portal
- Go to Datasources → New Datasource
- Select source type (e.g., PostgreSQL)
- Enter connection details
- Test connection
- Save
Best Practices
1. Use Dedicated CDC User
Create a user specifically for CDC with minimal permissions:
-- PostgreSQL example
CREATE USER cdc_user WITH REPLICATION LOGIN PASSWORD 'secret';
GRANT SELECT ON ALL TABLES IN SCHEMA public TO cdc_user;
2. Enable SSL/TLS
Always use encrypted connections:
{
"ssl_mode": "require"
}
3. Monitor Replication Lag
Set up alerts for replication lag to detect issues early.
4. Plan for Schema Changes
- Test schema changes in staging first
- Use compatible changes when possible (add columns, not remove)
- Monitor jobs after schema changes
Next Steps
- PostgreSQL Setup - Configure PostgreSQL source