anagilla
Databricks Employee
Databricks Employee

The best pattern I can think of is to put a streaming bus between DocumentDB and Databricks and consume it with Structured Streaming. You are most of the way there already.

Lowest-disruption path, since you already capture changes in Lambda:

  1. Repoint your Lambda to publish DocumentDB change events to Amazon Kinesis Data Streams (or MSK) instead of, or alongside, Redshift.

  2. Read that stream in Databricks Structured Streaming (native Kinesis and Kafka/MSK sources) into an append-only Bronze Delta table. Keep the document payload as VARIANT or string so an upstream schema change does not break ingestion.

  3. Fold inserts, updates, and deletes into a current-state Silver table with a MERGE in foreachBatch, or AUTO CDC (APPLY CHANGES INTO) in a Lakeflow declarative pipeline, keyed by _id.

If you would rather drop the Lambda, AWS DMS supports DocumentDB as a source and can land CDC to Kinesis or MSK (then stream as above), or to S3 read with Auto Loader for a micro-batch option.

Two things to plan for: enable change streams and watch their retention window (a consumer that falls behind past retention needs a snapshot backfill plus the stream), and pick your trigger by latency need, Trigger.AvailableNow for cheap incremental batches or a continuous / short processingTime trigger for true near-real-time.