Cloud VPS from $1.98/mo · pay with Bitcoin, Ethereum, Monero, USDT or Solana · paid in crypto
Databases

ETL, ELT and CDC: how to choose a data integration approach

ETL, ELT and change data capture compared, a checklist for choosing integration tools, and a hands-on CDC setup with PostgreSQL logical replication.

CloudSat teamNovember 18, 20267 min read
Several thin colored streams flowing out of separate cylinders and merging into one larger cylinder, drawn as clean abstract lines.
On this pageThree patterns, one goal

Data integration is the plain work of getting data out of the systems that create it (your app database, a payment processor, a CRM, log files) and into one place where it can be queried together. Most decisions come down to three patterns and a handful of practical questions. This guide explains the patterns, gives you a checklist for judging tools on your own terms, and ends with a working change data capture setup built from nothing but PostgreSQL.

Three patterns, one goal

ETL: transform, then load

Extract from the sources, transform in a separate engine (clean, join, mask), then load the finished result into the destination. ETL fits when sensitive fields must be removed before they land, when the destination is strict about schema, or when storage there is expensive. The cost is rigidity: a new question often means changing the pipeline.

ELT: load raw, transform later

Copy source data mostly as-is into the destination, then reshape it with SQL inside that database. ELT became the default as analytical databases got fast and storage got cheap. Keeping raw history means you can rebuild a model when the business logic changes. The cost is discipline: raw data, including personal data, now lives in one more place, and you need clear layers (raw, staging, reporting) so people query the right tables.

CDC: stream the changes

Change data capture reads the database's own change log (the PostgreSQL write-ahead log, the MySQL and MariaDB binary log, MongoDB change streams) and forwards every insert, update and delete. Latency drops to seconds, the source is spared repeated full scans, and deletes are captured, which timestamp-based polling misses. The cost is more moving parts and careful handling of schema changes.

ETL ELT CDC
Where transforms run Pipeline engine Destination database Anywhere downstream
Typical latency Minutes to hours Minutes to hours Seconds
Load on the source Scheduled queries Scheduled queries Reads the change log
Captures deletes Only if designed to Only if designed to Yes

How a pipeline fits together

Whatever tool you pick, every integration has the same five parts:

  1. Extract: a connector that understands the source's API or protocol, its pagination, rate limits and incremental cursor.
  2. Load: writes into the destination with retries and idempotency, so a rerun never duplicates rows.
  3. Transform: SQL or code that turns raw records into tables people can trust.
  4. Orchestrate: schedules, dependencies and backfills. Airflow and Kestra do this at scale; a systemd timer is fine for two jobs.
  5. Observe: row counts, freshness checks and an alert when a source changes shape.

Tools differ mostly in how many of these parts they cover, and in how much of each you can see and change.

A checklist for choosing tools

Run every candidate through the same questions instead of trusting a ranking:

  • Connector coverage. Does it support your exact sources and destinations, and who maintains each connector: the vendor, the community or nobody?
  • Incremental loads. Can it load only new and changed rows, and does it notice deletes?
  • Schema drift. When a source adds, renames or drops a column, does the run fail, adapt or quietly lose data?
  • Change data capture. For databases, can it read the change log instead of polling tables?
  • Where it runs. SaaS, self-hosted or both. Self-hosting keeps credentials and data inside your own network.
  • License. Open-source licenses such as Apache 2.0 and MIT differ from source-available ones such as the Elastic License 2.0, mainly on whether you may offer the software as a service to others.
  • Pricing model. Per row synced, per connector, per compute hour, or free software on your own servers. Model your real volumes, backfills included.
  • Operations. Logs, retries, alerting, secrets handling, and how hard it is to rerun one bad day.
  • Exit cost. Can you export configurations and leave without rewriting every pipeline?

Open-source building blocks

Tool Role License
Debezium CDC for PostgreSQL, MySQL, MariaDB, MongoDB and others, on Kafka Connect or standalone as Debezium Server Apache-2.0
dlt Python library for extract and load into DuckDB, PostgreSQL and warehouses Apache-2.0
Meltano Framework and CLI built around Singer taps and targets MIT
Airbyte Platform with a large connector catalog and a web UI Platform under Elastic License 2.0; connector licenses vary
Apache NiFi Visual, flow-based routing and transformation Apache-2.0
Apache Airflow Orchestration of workflows written in Python Apache-2.0
Kestra Orchestration of workflows written in YAML Apache-2.0

On CloudSat, Apache Airflow, Kestra and Apache Kafka are available as one-click apps if you want an orchestrator or a Kafka broker for Debezium running in a few minutes.

Worked example: CDC with PostgreSQL logical replication

When both ends are PostgreSQL, you may not need a separate tool at all. Logical replication streams row changes from a production database into a reporting database on another server, where analysts can add indexes and run heavy queries without touching production.

The example uses a source at 203.0.113.10 (database shop) and a reporting server at 198.51.100.20 (database reporting), both running PostgreSQL 18, which ships with Ubuntu 26.04 and is available for older releases from the PostgreSQL APT repository.

On the source server

Switch the write-ahead log to logical mode and listen on an address the reporting server can reach. Both settings need a restart:

sudo -u postgres psql -c "ALTER SYSTEM SET wal_level = 'logical';"
sudo -u postgres psql -c "ALTER SYSTEM SET listen_addresses = 'localhost,203.0.113.10';"
sudo systemctl restart postgresql

Create a dedicated role, give it read access to the tables, and publish them. Run this in sudo -u postgres psql -d shop:

CREATE ROLE reporting_repl WITH LOGIN REPLICATION;
\password reporting_repl
GRANT SELECT ON orders, customers TO reporting_repl;
CREATE PUBLICATION shop_pub FOR TABLE orders, customers;

Allow that role from the reporting server only, in /etc/postgresql/18/main/pg_hba.conf. Logical replication connects to a named database, so the second column is shop, not the replication keyword used for physical standbys:

host    shop    reporting_repl    198.51.100.20/32    scram-sha-256

Reload with sudo systemctl reload postgresql, and open port 5432 in your firewall for 198.51.100.20 alone.

On the reporting server

Logical replication copies rows, not table definitions, so create the tables first by copying the schema:

sudo -iu postgres
createdb reporting
pg_dump -h 203.0.113.10 -U reporting_repl -d shop \
  --schema-only --no-owner --no-privileges -t orders -t customers \
  | psql -d reporting

Then subscribe, still as postgres, in psql -d reporting:

CREATE SUBSCRIPTION shop_sub
  CONNECTION 'host=203.0.113.10 dbname=shop user=reporting_repl password=the-password-you-set'
  PUBLICATION shop_pub;

The subscription copies the existing rows, then applies changes as they happen. The connection string is stored in a catalog only superusers can read, which is one more reason the role should have nothing beyond SELECT on the published tables. Check progress on the reporting side with SELECT subname, received_lsn, latest_end_time FROM pg_stat_subscription; and on the source with SELECT slot_name, active FROM pg_replication_slots;.

Shape the data where it lands

The reporting database now holds a live copy, so summary tables and dashboards can run there freely. A materialized view refreshed every few minutes is often all a dashboard needs; this guide to views and materialized views shows how to refresh one without blocking readers.

Pitfalls that bite later

  • Schema changes are not replicated. Add a new column on the subscriber first, then on the source, or the apply worker stops on the unknown column.
  • Tables need a replica identity. Without a primary key or REPLICA IDENTITY FULL, updates and deletes on a published table fail on the source itself.
  • Slots hold WAL. If the subscriber disappears, its slot keeps WAL on the source until the disk fills. Set max_slot_wal_keep_size on the source and drop subscriptions you retire.
  • Sequences stay behind. PostgreSQL 18 does not replicate sequence values, so reset them before you ever promote the reporting copy into a writable database.
  • Personal data travels too. Publications accept column lists and row filters, for example FOR TABLE customers (id, country, created_at). Keep the primary key in the list and leave out what reporting does not need.

FAQ

Is ETL or ELT better?

Neither in general. ELT is the usual default when the destination is an analytical database that can transform large volumes cheaply. ETL still wins when data must be cleaned or masked before it lands, or when the destination enforces a fixed schema.

Do I need Kafka for change data capture?

No. Kafka earns its place when many consumers need the same stream of changes. For one source and one destination, native replication or Debezium Server, which runs without Kafka, is simpler to operate.

How often should batch pipelines run?

As often as the people using the data really need. Hourly or daily covers most reporting, and every extra run is load on the source and one more chance to fail. If the requirement is seconds, switch to CDC rather than shrinking the batch interval.

Can I mix tools?

Yes, and most teams do: CDC for databases, an extract-and-load library or platform for SaaS APIs, SQL for transformations, and one orchestrator to schedule and watch all of it.

Run it on CloudSat. Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. See plans or deploy a server.