Replications
Multiple streams in a YAML or JSON file. Best way to scale Sling.
Overview
Replications are the best way to use sling in a reusable manner. The defaults key allows reusing your inputs with the ability to override any of them in a particular stream. Both YAML or JSON files are accepted. When you run a replication, internally, Sling auto-generates many tasks (one per stream) and runs them in order.
See these pages for more details:
Here is a basic example, where all PostgreSQL tables in the schema my_schema will be loaded into Snowflake. The my_schema.* notation as the stream name is a feature possible only in Replications. Also notice how defaults.object uses runtime variables.
source: MY_POSTGRES
target: MY_SNOWFLAKE
# default config options which apply to all streams
defaults:
mode: full-refresh
object: new_schema.{stream_schema}_{stream_table}
streams:
my_schema.*:
env:
SLING_THREADS: 3Another example:
We can use a replication config with: sling run -r /path/to/replication.yaml
Last updated
Was this helpful?