Sources
A source is where a pipeline reads data: a database, files in object storage, a stream, or a SaaS API. You declare sources under data_sources: in mfd.yml, give each one a name, and point a pipeline at it.
Choose a source
| Kind | Connectors |
|---|---|
| Databases | ClickHouse, Delta Lake, DynamoDB, MongoDB, MotherDuck, MySQL, PostgreSQL, Redshift, SQL Server |
| Files and object stores | Local file, S3, SFTP |
| Streaming | AMQP, EventBridge, Kafka, Kinesis, MQTT, SNS, SQS, WebSocket |
| HTTP and network | HTTP client, HTTP server, OTLP, PCAP, Socket, StatsD, Stdin |
| Marketing and ads | AdRoll Ads, Apple Search Ads, Bing Webmaster Tools, Google Ads, Google Analytics (GA4), Google Search Console, LinkedIn Ads, Meta Ads, Meta Instagram Ads, X Ads |
| Commerce, finance, and CRM | HubSpot CRM, Revolut Business, Shopify Admin, Stripe, SumUp, Xero Accounting |
Each connector page lists the fields you can set, what Mfd reads, and how to troubleshoot it.
Add a source to a pipeline
This example reads two Postgres tables into a pipeline called orders.
Write the source entry and the pipeline that uses it:
pythonfrom mfd import Config, DataSourcePostgres, EnvRef, LocalStorage, Pipeline cfg = Config().workspace("analytics").storage(LocalStorage()) app_db = cfg.data_source( "app_db", DataSourcePostgres( host="db.internal", user="mfd_reader", password=EnvRef("APP_DB_PASSWORD"), database="app", tables=["orders", "customers"], ), ) cfg.pipeline("orders", Pipeline(data_source=app_db)) cfg.save("mfd.yml")bashmfd --workspace analytics --storage-mode local connect data-source postgres \ --pipeline orders \ --name app_db \ --host db.internal \ --user mfd_reader \ --password '${APP_DB_PASSWORD}' \ --database app \ --tables orders \ --tables customersyamlmfd: workspace: analytics mfd_el_storage_mode: local pipelines: orders: data_source: data_sources.app_db data_sources: app_db: Postgres: host: db.internal user: mfd_reader password: ${APP_DB_PASSWORD} database: app tables: [orders, customers]app_dbis a logical name.Postgresis the connector type; write it with the casing shown on the connector page.mfd connectcreates theorderspipeline if it does not exist and sets itsdata_source.Provide the secret:
bashexport APP_DB_PASSWORD='your-postgres-password'Discover the source's schema:
pythonimport mfd session = mfd.Session(mfd.Config.discover().get_pipeline("orders")) session.discover()bashmfd discover --pipeline orders
Check it worked
Show the schema discover saved for the pipeline:
mfd metadata show --pipeline ordersYou should see the orders and customers tables with their columns. If they are missing or the command fails, see the Troubleshooting section of the connector page and Troubleshooting.
The pipeline has no destination yet, so a sync keeps the data in the write-ahead log, where mfd query can read it. Add a destination next.
Credentials
- Put every secret in
mfd.ymlas a${NAME}reference. Secret fields reject plaintext. The mfd.yml reference covers the rules and.envfiles. - AWS sources (S3, DynamoDB, Kinesis, SQS, SNS, EventBridge) use the standard AWS credential chain: environment variables, a shared profile, or the instance or task role.
- Give Mfd a read-only account where the source supports one.
One source, several pipelines
Several pipelines can reference the same data_sources entry. Each pipeline keeps its own progress, so each reads the source independently.
Next steps
- Destinations — land the data in a warehouse or lake.
- Transforms — split, partition, or flatten records.
- Schema discovery and evolution — what
discoverrecords and how changes are handled. - How sources land
