> For the complete documentation index, see [llms.txt](https://v2.dataos.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v2.dataos.info/references/resources/nilus/cdc/sample-configs.md).

# CDC sample configs

Ready-to-use CDC pipeline configurations for PostgreSQL, MongoDB, MS SQL Server, MySQL, and IBM DB2 sources.

All examples below use the current Nilus pipeline shape:

```yaml
type: nilus
spec:
  type: cdc
```

Before using these samples, confirm the source-side CDC prerequisites on the connector page: replication or log settings, user permissions, retention window, and primary key or replica-identity expectations.

{% hint style="info" %}
Connector samples below keep Debezium's small default batch/queue sizes. For high-volume CDC (hundreds of events per second), use the tested 12 GiB / 30% heap / `500000`–`700000` profile in [Optimizing CDC](https://v2.dataos.info/references/resources/nilus/pipeline-optimization/optimizing-cdc.md) instead of copying `2048` / `8192` into production.
{% endhint %}

### PostgreSQL

<details>

<summary>Basic</summary>

```yaml
name: nilus-postgres-cdc
version: v1alpha
type: nilus
spec:
  type: cdc
  compute: universe-compute
  source:
    address: dataos://ncdcpostgres
    options:
      strategy: flatten
    cdc:
      schema.include.list: "public"
      table.include.list: "public.orders"
      topic.prefix: "cdc_changelog"
      slot.name: "orders_slot"
      heartbeat.interval.ms: 60000
  sink:
    address: dataos://testinglh
    options:
      dest_table: pgdb_cdc
      incremental_strategy: append
      aws_region: us-west-2
```

</details>

<details>

<summary>Working with partitioned tables</summary>

```yaml
name: nilus-postgres-partitions
version: v1alpha
type: nilus
spec:
  type: cdc
  compute: universe-compute
  source:
    address: dataos://ncdcpostgres
    options:
      strategy: flatten
    cdc:
      schema.include.list: "public"
      table.include.list: "public.orders,public.orders_ny,public.orders_sf"
      topic.prefix: "cdc_changelog"
      slot.name: "orders_partition_slot"
      publication.name: "orders_pub"
      heartbeat.interval.ms: 60000
  sink:
    address: dataos://testinglh
    options:
      dest_table: pgdb_cdc
      incremental_strategy: append
      aws_region: us-west-2
```

</details>

### MongoDB

```yaml
name: nilus-mongo-cdc
version: v1alpha
type: nilus
spec:
  type: cdc
  compute: universe-compute
  source:
    address: dataos://ncdcmongodb2
    options:
      strategy: flatten
      max_table_nesting: "0"
    cdc:
      collection.include.list: "retail.products"
      topic.prefix: "cdc_changelog"
      transforms.unwrap.array.encoding: array
  sink:
    address: dataos://testinglh
    options:
      dest_table: mdb_cdc
      incremental_strategy: append
```

### MS SQL Server

```yaml
name: nilus-mssql-cdc
version: v1alpha
type: nilus
spec:
  type: cdc
  compute: universe-compute
  source:
    address: dataos://mssqldepotnoper
    options:
      strategy: flatten
    cdc:
      table.include.list: "sandbox.customers"
      topic.prefix: "mssql"
      max.batch.size: 5000
      max.queue.size: 20000
      heartbeat.interval.ms: 60000
      poll.interval.ms: 5000
  sink:
    address: dataos://testawslh
    options:
      dest_table: sandbox.customers_cdc
      incremental_strategy: append
```

### MySQL

```yaml
name: nilus-mysql-cdc
version: v1alpha
type: nilus
spec:
  type: cdc
  compute: universe-compute
  source:
    address: mysql://{MYSQL_USERNAME}:{MYSQL_PASSWORD}@mysql.example.com:3306
    options:
      strategy: flatten
    cdc:
      table.include.list: "sales.orders"
      topic.prefix: "sales_cdc"
      snapshot.mode: initial
      heartbeat.interval.ms: 60000
      max.batch.size: 2048
      max.queue.size: 8192
  sink:
    address: dataos://analyticslakehouse
    options:
      dest_table: sales.orders_cdc
      incremental_strategy: append
```

### IBM Db2

```yaml
name: nilus-db2-cdc
version: v1alpha
type: nilus
spec:
  type: cdc
  compute: universe-compute
  source:
    address: db2://{DB2_USERNAME}:{DB2_PASSWORD}@db2.example.com:50000/sample
    options:
      strategy: flatten
    cdc:
      table.include.list: "DB2INST1.CUSTOMERS"
      topic.prefix: "db2_cdc"
      snapshot.mode: initial
      max.batch.size: 2048
      max.queue.size: 8192
  sink:
    address: dataos://analyticslakehouse
    options:
      dest_table: db2inst1.customers_cdc
      incremental_strategy: append
```

## Related docs

* [CDC pipeline config](https://v2.dataos.info/references/resources/nilus/cdc/pipeline-config.md)
* [Batch sample configs](https://v2.dataos.info/references/resources/nilus/batch/sample-configs.md)
* [Stream sample configs](https://v2.dataos.info/references/resources/nilus/stream/sample-configs.md)
* [Optimize sink datasets](https://v2.dataos.info/references/resources/nilus/pipeline-optimization/optimize-sink-datasets.md): tune `incremental_strategy`, `primary_key`, partitioning, and write batching for the destination.
* [PostgreSQL partitioned tables for CDC](https://v2.dataos.info/references/resources/nilus/troubleshooting/postgresql-cdc-partitioned-tables.md): required setup if your PostgreSQL source uses declarative partitioning.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://v2.dataos.info/references/resources/nilus/cdc/sample-configs.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
