Using Artie
Write to multiple destinations
Split an existing pipeline into a shared source reader and independently replicate its changes to two destinations.
A shared source reader captures the source’s change data capture (CDC) stream once, and each pipeline on it consumes that stream independently. This guide starts with an existing PostgreSQL to Snowflake pipeline and adds BigQuery as a second destination.
The same steps work for other source and destination combinations, with two exceptions. An S3 source reader can’t be shared, and a source reader can’t be shared while one of its pipelines writes to a Kafka destination.
Prerequisites
Sharing a source reader is configured only through Terraform. The dashboard has no setting for it. Before you start, check that you have:
- The existing pipeline and its source reader managed in Terraform, or imported into Terraform state.
- The Artie Terraform provider configured with an Artie API key.
- An
artie_connectorfor each destination. This guide usessnowflake_analyticsandbigquery_lake. - The full list of source tables that either destination needs.
- Permission to run
terraform planandterraform apply.
Shared source readers
Before the change, the source reader is dedicated to one pipeline:
After the change, the same reader publishes one change stream and both pipelines consume it independently:
Each pipeline owns its destination configuration, table settings, backfill, and stream position. Changing one pipeline’s destination settings doesn’t change the other pipeline. The shared source reader owns which source tables Artie captures.
Share the reader and add a pipeline
Make each change in your Terraform configuration and apply it before you start the next step.
Make the existing source reader shared
Add
is_shared = trueto the existingartie_source_readerand declare itstablesmap. The map must include every table in every pipeline that references the reader.This example shares the reader and captures
public.customersandpublic.orders:terraformresource "artie_source_reader" "postgres_production" { name = "Postgres Production Reader" connector_uuid = artie_connector.postgres_production.uuid database_name = "app" postgres_replication_slot_override = "artie_reader" is_shared = true # Capture every table needed by either pipeline. tables = { "public.customers" = { name = "customers" schema = "public" } "public.orders" = { name = "orders" schema = "public" } } }Keep the source reader’s existing connection and source-specific settings. Terraform rejects
is_shared = truewhen thetablesmap is missing or empty.Run
terraform planand confirm that only the source reader changes, then runterraform apply. After the update, the provider deploys the shared source reader.Verify the existing pipeline
The existing pipeline already references this source reader, so sharing the reader needs no pipeline change. Keep the pipeline’s destination configuration and table selection.
Confirm that its
source_reader_uuidstill referencesartie_source_reader.postgres_production.uuid. Don’t copy or reapply the pipeline resource only to share the reader, especially when you imported the pipeline into Terraform.Add a second pipeline for the new destination
Create another
artie_pipelinethat references the samesource_reader_uuidand a different destination connector. A pipeline can replicate a subset of the reader’s captured tables.terraformresource "artie_pipeline" "postgres_to_bigquery" { name = "PostgreSQL to BigQuery" source_reader_uuid = artie_source_reader.postgres_production.uuid destination_connector_uuid = artie_connector.bigquery_lake.uuid destination_config = { dataset = "product_analytics" } # BigQuery receives orders only. The shared reader still captures # customers because the Snowflake pipeline needs it. tables = { "public.orders" = { name = "orders" schema = "public" } } }Run
terraform planand confirm that Terraform creates only the new pipeline. Then runterraform apply.Artie backfills the new pipeline’s tables into BigQuery, then consumes live changes from the shared reader. The existing Snowflake pipeline continues from its own position throughout the backfill.
Verify both destinations
Wait for the new pipeline’s backfill to complete and its lag to reach your normal operating range in the analytics portal. Then check the new destination before you rely on it:
- Compare row counts for each newly replicated table.
- Spot-check recent inserts, updates, and deletes.
- Run representative downstream queries against both destinations.
- Confirm that the existing pipeline remains healthy while the new pipeline catches up.
Add another table later
Add a table to the shared reader’s tables map before you add it to a pipeline, unless the map already has it. The reader must capture a table before any pipeline on it consumes that table.
For example, to send public.refunds only to BigQuery:
- Add
public.refundstoartie_source_reader.postgres_production.tables. - Apply the source reader change.
- Add
public.refundstoartie_pipeline.postgres_to_bigquery.tables. - Apply the pipeline change and monitor its backfill.
A pipeline table that the reader doesn’t capture fails pipeline validation with this error:
shared source reader does not have a table config for table "public.refunds"Frequently asked questions
These answers cover what the pipelines on a shared source reader share and what each pipeline sets for itself.
Does this create another replication slot or source reader?
No. Both pipelines reference the same artie_source_reader, so Artie captures the source change stream once and fans it out to the pipelines on that reader.
Can the two pipelines replicate different tables?
Yes. Each pipeline has its own tables map. The shared source reader’s map must include the union of all tables used by every pipeline on it.
Can the pipelines use different table settings?
Yes. Destination-specific settings belong to each pipeline: an alias, history mode, column inclusion, and destination configuration. Source capture settings belong to the shared reader and apply to every pipeline on it.
The reader’s column lists limit every pipeline. When the reader’s table sets columns_to_include, a pipeline’s columns_to_include for that table must list only columns from the reader’s list.
Can I add more than two destinations?
Yes. Add another artie_pipeline that references the same shared reader. Keep the reader’s tables map aligned with the union of all pipelines on it.
Can I switch the reader back to a dedicated reader later?
Yes, once at most one pipeline references it. Set is_shared = false, remove the reader’s tables map, and apply. See online migration for the full conversion steps.
With more than one pipeline on the reader, Artie rejects the change with this error:
this source reader is being used by multiple pipelines so it cannot be set to not sharedWas this page helpful?
- Need help? Message us on Slack or email [email protected].
- Want a walkthrough? Book a demo.
- LLM? Read llms.txt.