Skip to main content
Physical replication is in betaPhysical replication is currently in beta. Contact the Prequel team to enable it for your account.

Overview

By default, Prequel queries rows from your source and writes them to the destination. This page calls that logical replication. Physical replication instead copies an Apache Iceberg table’s data files to the recipient’s bucket and commits matching Iceberg metadata. Rows are never queried or rewritten, so throughput depends on how fast files can be copied between buckets. Because files are copied as-is, every column keeps its source type, including decimal precision and scale. This also delivers types that logical replication does not support, such as string arrays.

Higher throughput

On some of Prequel’s highest-volume workloads, table-level throughput improved by 9x.

No queries against your source

Prequel reads files from your catalog and bucket, so transfers put no query load on a warehouse.

Hard deletes are propagated

Rows deleted from the source table are removed from each recipient’s copy on the next transfer.

Open format for recipients

Recipients get a standard Iceberg table they can query from Snowflake, BigQuery, Athena, and other engines.
For background on the design, read Building table-aware, partition-aware physical replication for Iceberg tables.

Comparing logical vs physical replication

How physical replication in Prequel works

Each transfer of a physically replicated model runs the following steps:
  1. Read the table metadata. Prequel reads the source table’s current snapshot (its latest version) from your Iceberg catalog. The snapshot lists every data file and delete file in the table.
  2. Filter by recipient. Prequel keeps only the files in partitions that belong to the recipient. Files in other recipients’ partitions are never copied.
  3. Copy new files. Prequel copies the files that the destination does not already have. On incremental transfers, files copied by earlier transfers are skipped.
  4. Commit to the destination. Prequel updates the Iceberg metadata to point at the destination bucket and commits it to the destination catalog as a new snapshot. Recipients see the new data all at once, after the commit succeeds.

Requirements

  • The model’s source is an Apache Iceberg source, and the destination is an Apache Iceberg destination.
  • otf_acceleration_enabled is set to true on both the model and the destination. A model with physical replication enabled can only be transferred to destinations that also have it enabled.
  • The model reads from a source_table that is an Iceberg table. Views are not supported.
  • The model still defines columns, including a primary key column and a last-modified column, like any other model. Prequel checks that the model is well-formed, but does not validate it against the source table. The columns list does not control which columns are delivered. See Limitations.
  • Multi-tenant source tables are partitioned by the model’s organization_column. See Limitations.

How to enable physical replication

Physical replication uses the same sources, models, products, recipients, and destinations as any other transfer. You enable it with one setting on the model and one on the destination, both set through the API.
1

Connect your Iceberg source

Add your Iceberg catalog as a source by following the Apache Iceberg source guide.
2

Prepare the source table

Confirm the table is partitioned by your organization column. Then compact the recipient’s partitions in your query engine so that they have no delete files before the first transfer. See Do I need to compact the source table?
3

Check your existing destinations

Make sure no recipient subscribed to the all product has a destination without physical replication that uses "enabled_models": ["*"] (All current and future models in the Prequel UI). Update those destinations to an explicit list of models first. Otherwise, the model in the next step cannot be created. See Guardrails.
4

Create the model

Create a model that reads from the table with source_table, and set otf_acceleration_enabled to true. Use the Create model endpoint.If a model for this table already exists, create the new model alongside it with a different model_name. Two models that reach the same recipient cannot write to the same table name.
Physically replicated model
5

Create the destination

Create the recipient’s Apache Iceberg destination with otf_acceleration_enabled set to true using the Create destination endpoint.To migrate an existing recipient, add this as a second destination on the same recipient and run it in parallel with their current destination. The current destination must not use "enabled_models": ["*"]. See Guardrails.
6

Add the model to a product and transfer

Add the model to a product assigned to the recipient. Transfers then run on the destination’s schedule, or you can trigger one through the API as usual.
Physical replication is set at creationotf_acceleration_enabled cannot be changed after a model or destination is created. To move an existing model or destination to physical replication, create a new one with the setting enabled.

Supported catalogs and query engines

Sources

Prequel reads source tables from the catalogs supported by the Apache Iceberg source:
  • AWS Glue Catalog
  • AWS S3 Tables Catalog
  • Iceberg REST Catalog

Destinations

Each recipient receives an Iceberg table in their own bucket and catalog, using any catalog supported by the Apache Iceberg destination. Recipients can query the delivered table from any query engine or system that reads Iceberg tables from that catalog, for example Amazon Athena, Amazon Redshift, Snowflake, BigQuery, ClickHouse, DuckDB, MotherDuck, and Spark.

Limitations

Some Prequel features are not supportedPhysical replication copies files in-place, so some Prequel features that depend on Prequel reading or rewriting rows are not supported.
  • Every column in the source table is delivered, with its source name and type. The model’s columns list, name_in_destination values, and data_type values are not applied.
    • What this means: do not enable physical replication on a table that contains columns you do not want to share.
  • The source table must be partitioned by your organization column. Prequel copies only the files in partitions where the model’s organization_column matches the recipient.
    • What this means: partition the table directly on that column (an identity partition) before enabling physical replication. A file is copied only when its partition value exactly equals the recipient’s id_in_provider_system.
    • Files that Prequel cannot match to the recipient are never copied. This is intentional, so that a table with missing or incorrect partitioning cannot expose one recipient’s data to another. In that case, transfers succeed but deliver no rows.
  • A recipient’s partitions must have no delete files before a model’s first transfer to that recipient’s destination and before any full refresh. Those transfers fail otherwise. Delete files in other recipients’ partitions do not affect the transfer.
    • What this means: compact the recipient’s partitions in your query engine first. You do not need to compact the whole table to add a new recipient. See Do I need to compact the source table?
  • Source queries are not supported.
  • Windowed transfers are not supported.
  • Row filters are not supported. Recipients are separated only by partition, and Prequel does not filter rows within a data file.
  • Partition evolution is not supported. Data files written before the table was partitioned by your organization column are not delivered.

Guardrails

To ensure a model with physical replication enabled is never sent to an incompatible destination, Prequel enforces the following:
  • Physical replication cannot be enabled or disabled on an existing model or destination. New resources are strictly required and the field is immutable after creation.
  • A model with physical replication enabled can only be transferred to a destination that also has physical replication enabled.
  • You cannot use "enabled_models": ["*"] (All current and future models in the Prequel UI) on a destination without physical replication if its recipient’s products include a model with physical replication enabled. This applies to every recipient subscribed to the all product.
    • What this means: before enabling physical replication for a customer, ensure their current destinations are not using "enabled_models": ["*"], and update them if they are.
    • While any recipient subscribed to the all product has such a destination, new models with physical replication enabled cannot be created. This check covers every recipient in your account, not only the customer you are enabling.

FAQ

Yes. A physically replicated model is assigned to recipients through products like any other model, and it runs in the same scheduled and manually triggered transfers. Transfers appear in the same API responses and webhooks, including the number of rows transferred.
Yes. You can run a full refresh on a model with physical replication enabled the same way as on any other model. Compact the recipient’s partitions first so that they have no delete files, as described below.The other core Export features also work with physical replication, including data integrity checks, orchestration, and monitoring. The exceptions are listed under Limitations. Data integrity checks are subject to the supported systems for Apache Iceberg destinations.
Yes. A destination with physical replication enabled can receive both kinds of models in the same transfer. Models without the setting are transferred with logical replication.A model with physical replication enabled can only go to destinations that also have it enabled. See Guardrails. To deliver the same table to other destination types, create a second model on the same source_table without the setting.
No. The setting is fixed when the model or destination is created. Create a new model and a new destination with otf_acceleration_enabled set to true.
Logical replication filters rows by the model’s last_modified_at column. Physical replication compares files. Each transfer copies only the data files the destination does not already have, then commits a snapshot that matches the source.
Yes. Rows deleted from the source table are removed from the destination table on the next transfer. Files that are no longer needed are then removed from the destination bucket after the destination’s retention window.
Yes, before a model’s first transfer to a destination and before any full refresh. Iceberg can record deleted rows in separate delete files instead of rewriting the data files. The first transfer and full refreshes fail if the recipient’s partitions still have any delete files, so compact those partitions in your query engine first. Delete files in other recipients’ partitions are ignored.Compaction must also remove the delete files themselves. Some engines rewrite the data files but leave the old delete files in the table, and the transfer still fails until they are removed.Incremental transfers replicate delete files and do not need compaction. Data files are copied unchanged, and position delete files are rewritten so that their file paths point at the destination bucket.

See also

Apache Iceberg source

Connect an Iceberg catalog as a source.

Apache Iceberg destination

Set up an Iceberg destination for a recipient.

Multi-tenancy

Understand how Prequel isolates data per recipient.

Change detection

See how logical replication detects changed rows.