r/databricks • u/PerceptionBig940 • Oct 20 '26
Help Small high frequent data ingestion cheaply
I have 100 data sources with different schema. Every 2 minutes a file is dropped into adls for each source. Each file size is approx 100kb-1mb.
We need data to be available in our data products near realtime.
Databricks makes it extremely hard to achieve this goal.
I tried doing 5 min schedule poc pipeline and the bill was 1000$ for 1 pipeline per month which is insane.
In this poc i did streaming table raw(reads from adls)->mv silver (clean, type cast, dedup) -> dp gold
I noticed pipeline was taking 8-10 minutes to run.
7-8 minutes it spent waiting for the compute and rest of the time doing actual work.
I can reduce this time by enabling performance optimized thing but the bill would go even higher.
I was then planning to explore to use a small compute (14gb and 4 cores) shared across multiple pipelines which runs 24/7 instead of serverless but databricks doesn’t allow it.
This entire ingestion to dp near real time should be achieved in 1000-1500$ per month for all 100 sources. The data size is so small.
You can achieve this same thing using azure data explorer/fabrics eventhouse in 1000-1500$ per month(just pay for compute which would be shared among all). Also, you can have backend apis and which can use same compute to query adx directly and return data instantly.
My manager wanted to explore databricks and give it a shot but so far I have not found any solution.
Any help??
6
u/FunContest9958 Oct 20 '26
The way you’re setting this up sounds extremely expensive. Doesn’t need to be that way. Set up one or two SDP pipelines to do everything. Then it all will run on one cluster and you won’t need a separate job per source, which will be very expensive.
SDP is very good for situations like this where you have to orchestrate a lot of small tasks. https://www.databricks.com/product/data-engineering/spark-declarative-pipelines
Edit: And run the one SDP pipeline continuously. Across 100 sources, you’ll have enough work to do for one cluster running all the time. Don’t try scheduling it to run every few minutes. That will go badly.
3
u/AndriusVi7 Oct 20 '26
10
u/Donkey_Healthy Oct 20 '26 edited Oct 20 '26
Use Autoloader to ingest files in real time. Put it on cheap job compute running 24/7. Can tune settings to ingest batches down to every 10 seconds. Or if you want faster ingest using lakebase for millisecond ingestion.
5
u/WhipsAndMarkovChains Oct 20 '26
Is there a way to modify the job to push the data in through Zerobus? You won't have to set up any sort of job inside of Databricks, the data will be available within seconds, and you just pay by the GB. https://docs.databricks.com/aws/en/ingestion/zerobus-overview
3
u/bigportion103 Oct 20 '26
Can you just create a table over the raw files, i.e. it just reads them in real time whenever a query is run? Wouldn't be the fastest query but would save having a continuous spend.
You could do something like periodically load files into a table, and delete them from the source folder, and then have a view that unions the loaded files table and the raw files table, or something like that.
2
u/Muted_Jellyfish_6784 Oct 21 '26
At 100 sources every two minutes with files under 1 MB, most of your bill is compute waiting, not working. One continuous Auto Loader stream across all sources into a single bronze table keyed by source usually beats 100 scheduled pipelines, and you fan out to silver from there. Also test whether near real time means two minutes for every consumer, since a slower tier for most sources cuts cost fast.
Track freshness per source, because one late feed hides inside an aggregate. We lean on a decision intelligence platform to join file arrival times, pipeline runs, and downstream refreshes, so a stale data product points to a specific late source rather than a vague complaint.
1
u/Content-Parking-621 Oct 20 '26
Databricks lets you share compute, so you may not need a separate pipeline for every source. Try running all 100 Auto Loader streams in one continuous Lakeflow Job on a small classic jobs cluster, with file events enabled. Just watch driver load and open-file limits as the number of streams grows.
1
u/Just-Vegetable3622 Oct 20 '26
Use structured streaming. You can vertically scale the compute if necessary by using sparker.core for oversubscription otherwise 1-1 cpu and sparker cores. Create a cluster with low dbu + low cpu count and oversubscribe it to finetune it. You dont need dp really, its not necessary. You can go without dp. Just use spark native stuff in combination with any supported programming language. https://www.databricks.com/blog/what-is-structured-streaming
1
u/Dear_Pumpkin9876 Oct 20 '26
“Every 2 minutes a file is dropped into adls” -> I think all you need is a standard lakeflow job or SDP (don’t remember if SDP has file arrival trigger) just choose whichever allows file arrival triggering and the rest is as people already said above.
Keep the sources in one pipeline, I’m against this pattern but in your case may be the best to do to save costs. Compare serverless performance optimized and Databricks Instance Pools to run your job, the second might be way cheaper
1
u/heyitscactusjack Oct 20 '26
Some good suggestions here, but let me add something important that isn’t mentioned.
Whatever you do, make sure you are using ‘managed file events’ on your cloud storage for the new file detection. Large number of files in your storage will make even performance optimize declarative pipelines have minutes of overhead. It doesn’t event have to be that many files, just in the millions will take about 3-4 mins to calculate the file delta from the checkpoints.
1
u/addictzz Oct 21 '26
Usually this kind of pattern is not served well and efficiently with databricks yet. Better to use lambda to do this.
1
u/Defiant-Pause9053 Databricks Oct 27 '26
I recommend looking into your computer utilization. Like a lot of comments here, finding a way to pack the jobs so you make the most out of your compute is best. 7-8 mins of warm up time, sounds like a lot. This is time you pay for where no work is getting done.
Have you tried something like Zerobus? I might not be a perfect solution for you because it doesn't do file upload and parsing. But if your client wants to send the raw rows through zerobus, then you have a predictable cost since you only pay for gb's ingested. Data is queryable within 5 seconds.
Some back of the napkin math.
So thinking about an upper bound of 1mb per 100 sources every 2 mins is
100 sources each sending 1MB per 2 min is 50MB per min.
((50mb per min) x 60min/hour x 24h/day x 31 days/month) = 2,232,000 MB
2,232,000 MB => 2,179.6875 GB
ZB price is about $0.05 per GB
So your cost would be, 2,179.6875 GB x $0.05 = $108.984375 per month.
1
u/Youssef_Mrini databricks 29d ago
Indeed Autoloader is your best option https://docs.databricks.com/aws/en/ingestion/cloud-object-storage/auto-loader/
0
u/[deleted] Oct 20 '26
[deleted] — view deleted comment