> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Sync to ClickHouse with WalShadow

> Replicate your Postgres data to ClickHouse with WalShadow, a native replication engine that reads directly from the PostgreSQL WAL

export const Image = ({img, alt, size = "lg", background}) => {
  const normalizedSize = ["sm", "md", "lg"].includes(size) ? size : "lg";
  const backgroundColor = background === "white" ? "white" : background === "black" ? "rgb(31 31 28)" : undefined;
  return <div className={`ch-image-${normalizedSize}`}>
      <Frame>
        <img src={img} alt={alt} style={{
    backgroundColor
  }} />
      </Frame>
    </div>;
};

export const PrivatePreviewBadge = () => {
  return <div className="privatePreviewBadge">
            <div className="privatePreviewIcon">
            <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
                <path d="M5.33301 6.66667V4.66667V4.66667C5.33301 3.194 6.52701 2 7.99967 2V2C9.47234 2 10.6663 3.194 10.6663 4.66667V4.66667V6.66667" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
                <path d="M8.00033 9.33337V11.3334" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
                <path fillRule="evenodd" clipRule="evenodd" d="M11.333 14H4.66634C3.92967 14 3.33301 13.4033 3.33301 12.6666V7.99996C3.33301 7.26329 3.92967 6.66663 4.66634 6.66663H11.333C12.0697 6.66663 12.6663 7.26329 12.6663 7.99996V12.6666C12.6663 13.4033 12.0697 14 11.333 14Z" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
            </svg>
        </div>
            {'Private preview in ClickHouse Cloud'}
        </div>;
};

<PrivatePreviewBadge />

`WalShadow` is a native replication engine for ClickHouse Managed Postgres that reads directly from the PostgreSQL Write-Ahead Log (WAL). It is optimized for lower latency and high-throughput workloads, delivering sub-second replication lag from Postgres to ClickHouse. It is developed in the open at [ClickHouse/walshadow](https://github.com/ClickHouse/walshadow).

`WalShadow` is one of two replication methods available under **Sync to ClickHouse**. The other, [ClickPipes](/docs/cloud/managed-postgres/clickpipes), is a fully managed data pipeline. Choose `WalShadow` when you need the lowest latency and the least replication overhead.

When `WalShadow` is available for your service, a **Private Preview** banner appears on the **Overview** page. Click **Configure WalShadow** to get started.

<Image img="https://mintcdn.com/private-7c7dfe99/1IUPNo0kgSNuyelj/images/managed-postgres/walshadow/overview-banner.webp?fit=max&auto=format&n=1IUPNo0kgSNuyelj&q=85&s=868266fa6f2514dcdbdaef9696e53327" alt="Postgres service overview page showing the WalShadow private preview banner with Learn more and Configure WalShadow links" size="md" border width="3680" height="2392" data-path="images/managed-postgres/walshadow/overview-banner.webp" />

<Note>
  Before you proceed, ensure that your Postgres service is accessible to ClickHouse. `WalShadow` connects to your destination ClickHouse service directly, so you will need a ClickHouse user and password with permission to create databases and tables.
</Note>

To set up replication, click **Sync to ClickHouse** in the sidebar of your Postgres instance, then click **Replicate data in ClickHouse**.

<Image img="https://mintcdn.com/private-7c7dfe99/1IUPNo0kgSNuyelj/images/managed-postgres/walshadow/sync-landing.webp?fit=max&auto=format&n=1IUPNo0kgSNuyelj&q=85&s=5932d900f2bd6438fa1ce524a3bc7979" alt="Sync to ClickHouse landing page showing the ClickPipes and WalShadow replication methods" size="md" border width="3680" height="2392" data-path="images/managed-postgres/walshadow/sync-landing.webp" />

<Steps>
  <Step title="Select the replication engine" id="select-replication-engine">
    Choose **WalShadow** as the replication engine, then click **Next**.

    <Image img="https://mintcdn.com/private-7c7dfe99/1IUPNo0kgSNuyelj/images/managed-postgres/walshadow/select-engine.webp?fit=max&auto=format&n=1IUPNo0kgSNuyelj&q=85&s=4c8138e85677394c695cc11a9455730b" alt="Select replication engine step showing ClickPipes and WalShadow options with WalShadow selected" size="md" border width="3680" height="2392" data-path="images/managed-postgres/walshadow/select-engine.webp" />
  </Step>

  <Step title="Configure the replication service" id="configure-replication-service">
    Fill in the replication settings:

    * **ClickHouse service**: Select an existing ClickHouse service or create a new one
    * **Postgres database**: Select the source database to replicate from, or create a new one
    * **Replication method**: Choose one of:
      * **Initial load + CDC**: Import existing data and keep tables updated with new changes (recommended)
      * **Initial load only**: One-time import of existing data with no ongoing updates
      * **CDC only**: Skip the initial import and only capture new changes going forward

    <Image img="https://mintcdn.com/private-7c7dfe99/1IUPNo0kgSNuyelj/images/managed-postgres/walshadow/configure-service.webp?fit=max&auto=format&n=1IUPNo0kgSNuyelj&q=85&s=df2a577cb52e60eefc1fca5f887492f6" alt="Configure replication service step showing ClickHouse service, Postgres database, and replication method options" size="md" border width="3680" height="2392" data-path="images/managed-postgres/walshadow/configure-service.webp" />

    Click **Next** to proceed.
  </Step>

  <Step title="Select tables to replicate" id="select-tables">
    Choose a destination database and select which tables to replicate:

    * **Destination database**: Select an existing ClickHouse database or create a new one
    * **Tables**: Expand each schema and select individual tables, or toggle **Select all tables**. For each table you can customize the **Destination table name** and adjust **Column settings**.
    * **ClickHouse user** and **ClickHouse password**: `WalShadow` connects to the destination ClickHouse service directly, so it needs credentials with permission to create the target database and tables.

    <Image img="https://mintcdn.com/private-7c7dfe99/1IUPNo0kgSNuyelj/images/managed-postgres/walshadow/select-tables.webp?fit=max&auto=format&n=1IUPNo0kgSNuyelj&q=85&s=03d6e3f80a706c99f2082408ba3e7832" alt="Select tables step showing schema and table selection, destination table names, and ClickHouse credentials" size="md" border width="3680" height="2392" data-path="images/managed-postgres/walshadow/select-tables.webp" />

    Click **Replicate data to ClickHouse** to start the replication.
  </Step>

  <Step title="Monitor WalShadow" id="monitor-walshadow">
    After you start replication, `WalShadow` appears on the **Sync to ClickHouse** page. Its status is **Creating** while the pipeline is being provisioned and the initial load is prepared.

    <Image img="https://mintcdn.com/private-7c7dfe99/1IUPNo0kgSNuyelj/images/managed-postgres/walshadow/walshadow-creating.webp?fit=max&auto=format&n=1IUPNo0kgSNuyelj&q=85&s=caead405c1e77d03f529034584be0289" alt="Sync to ClickHouse page showing WalShadow in the Creating state" size="md" border width="3680" height="2392" data-path="images/managed-postgres/walshadow/walshadow-creating.webp" />

    Once provisioning completes, the status changes to **Running**. The page reports live metrics for the replication:

    * **Status**: The current state of the pipeline (for example, `Running`)
    * **Rows synced**: The total number of rows replicated to ClickHouse
    * **Backfills pending**: The number of tables still waiting for their initial load
    * **Lag**: The volume of WAL data still to be applied
    * **Lag time**: How far behind Postgres the destination currently is
    * **Uptime**: How long the pipeline has been running
    * **Last updated**: When the metrics were last reported

    <Image img="https://mintcdn.com/private-7c7dfe99/1IUPNo0kgSNuyelj/images/managed-postgres/walshadow/walshadow-running.webp?fit=max&auto=format&n=1IUPNo0kgSNuyelj&q=85&s=2bb2a79206e83ac4ef801f944b97602f" alt="Sync to ClickHouse page showing WalShadow in the Running state with rows synced, lag, and uptime metrics" size="md" border width="3680" height="2392" data-path="images/managed-postgres/walshadow/walshadow-running.webp" />
  </Step>
</Steps>

<h2 id="caveats">
  Caveats
</h2>

A few things to note while `WalShadow` is in Private Preview:

* Only one `WalShadow` per Postgres service for now.
* Operations and more detailed metrics are on the roadmap.
