Docudb change streams, typed.
Open a change stream on any collection. Basalt flattens documents into typed columns and keeps your views current.
How it works.
Basalt opens a change stream with fullDocument set to updateLookup. It snapshots each collection first, then resumes from the stored resume token. Nested fields are flattened into columns, and new fields are added as they appear.
Set it up in three steps.
Add the source
Pass a connection string for a replica set or Atlas cluster. The user needs read and changeStream on the collections you pick.
# stream users and sessions from Atlas basalt source add accounts --mongodb atlas-prod --collections users,sessions ✓ change stream opened · updateLookup ✓ snapshot 2.1M documents · resume token stored
Shape it with a view
Write plain SQL over the source. Basalt keeps the view current with every record and tracks lineage back to the topic, partition and offset.
CREATE MATERIALIZED VIEW revenue_by_min AS SELECT date_trunc('minute', ts) AS minute, currency, sum(amount) AS revenue, count(*) AS payments FROM payments WHERE status = 'captured' GROUP BY 1, 2;
Read it from anywhere
Every view is an endpoint the moment it exists. Call it over REST, connect with any Postgres client, or use the SDK from your app.
curl https://api.basalt.dev/v1/views/revenue_by_min?limit=5 \ -H "Authorization: Bearer $BASALT_TOKEN"
What you get.
Resume tokens
Tokens are stored with each write, so a restart picks up at the exact change.
Document flattening
Nested fields become typed columns. Arrays can be kept as JSON or unnested.
Atlas ready
Works with Atlas M10 and above and with self-managed replica sets.
Document pre-images
On Docudb 6.0+, deletes and updates can carry the document before the change.
Set your data in stone.
Free up to 10M events a month. No card, no sales call. Your first pipeline is live in about four minutes.