- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2026 03:16 AM
Hi @Khasim_1
Worth flagging that the tradeoff you describe is the older one. There is now a third option that removes the management overhead: enable file events on the Unity Catalog external location and set cloudFiles.useManagedFileEvents. Databricks then runs one shared notification service per external location instead of a queue per stream, so you are not provisioning SQS or SNS yourself. Needs DBR 14.3 LTS or above, works on S3, ADLS and GCS, not on Azure Blob Storage. Databricks now recommends this over directory listing for most workloads, so at your scale I would not treat it as a close call.
On your questions.
There is no published file count threshold, and listing cost scales with total objects under the path rather than with new arrivals, so the same directory keeps getting slower even at a flat arrival rate. The signal to watch is listing time per microbatch growing while input rate does not. Lexically ordered filenames help a lot here. Do not build around incremental listing, it is deprecated.
For missed or dropped events, the mechanism is cloudFiles.backfillInterval, which triggers an asynchronous full listing at a set interval as a safety net. Worth setting in production regardless of mode.
The hybrid works. You can switch discovery modes across stream restarts and keep exactly once guarantees. One gotcha for your design: changing the input path without a new checkpoint is supported in directory listing mode from DBR 11.3 LTS, but not in file notification mode, where files already present in the new path may never be ingested. With thousands of prefixes, settle the path strategy before switching.
Separately, millions of small files per day is expensive to ingest whatever mode you pick, since per file overhead dominates. If the producer can batch into larger objects, that will help more than any Auto Loader tuning.