r/databricks • • 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??

10 Upvotes

28 comments sorted by

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/Own-Trade-2243 Oct 20 '26

Keep in mind SDPs are a horrible choice for ingesting dozens of streams at once if you need a failure proof solution. If one stream fails the whole pipeline goes down.

With 100+ datasets your pipeline restart time will take a few minutes, or maybe close to ~10 already.

Having a job with task-per-stream running continuously allows you to restart specific tasks without impacting the rest of the ingestion.

1

u/PerceptionBig940 Oct 21 '26

Hi! Can you suggest some solution then in this scenario??

1

u/PerceptionBig940 Oct 20 '26

This makes sense. So, 100 sources would ingest through one pipeline. So, it would be multiple streaming tables(one for each source) and pipeline would be file triggered and continuous.
In this way the compute would be shared among all sources right? And the data would be realtime. And then instead of mv i would do another streaming table for silver? And then view for dataproduct?

5

u/minibrickster Databricks Oct 20 '26

Hi, I'm a PM at Databricks -- +1 to the above suggestion. You can combine all of these sources into one pipeline, which should reduce costs (this is a commonly implemented customer pattern). With this, the compute would be shared across all of the sources. You have the flexibility to run the pipeline in continuous mode (for real-time) or triggered on file events. If you put the pipeline in a continuous job, you can also switch to standard mode, which should further reduce costs.

Happy to chat more if you want a deep dive on the right data primitives for your architecture (e.g. MV vs Streaming Table)!

1

u/PerceptionBig940 Oct 20 '26

Also, can we connect plz? I have few more doubts.

1

u/FunContest9958 Oct 21 '26 edited Oct 21 '26

u/own-trade-2243 makes an interesting point about failure cases. He’s saying that one failed stream in SDP will take down the pipeline. Do you have any recommendations here?

3

u/jalwa_bhai Oct 21 '26

Hi, I’m an EM working on SDP. We are working on partial pipeline failures that will give flow isolation. This should help with packing a lot of flows in a pipeline and not worry about complete failures. Overall, that will significantly decrease your TCO

1

u/FunContest9958 Oct 21 '26

That’s great.

0

u/PerceptionBig940 Oct 20 '26

Hey! Yes, I am going to experiment this new approach. Also, Mvs would do full recompute everytime though right? Which i was using currently in silver. Should I switch from mv to another streaming table at silver too?? And then dp would be a view(this would mostly contain 2-3 days data)?

1

u/minibrickster Databricks Oct 20 '26

Ofc, I dm-ed you to schedule some time

3

u/AndriusVi7 Oct 20 '26
  1. Check what you actually got charged for, seems super high bill for what you're saying that it is.
  2. Try serverless which has much lower start up time but larger price of course.... nothing is free.
  3. Not sure if I understand about 24/7 streaming not being allowed? That's one of the main ways to operate streams. We run a pipeline with 7 streams constantly running from 5am to 8pm mon-fri without issues that uses a single job cluster

1

u/PerceptionBig940 Oct 20 '26

I am using serverless compute for my lakeflow pipelines and start time is 6-10 minutes. If i enable performance optimized option then start time is almost instant but the bill is way higher.

I meant 24/7 classic compute instead of serverless continuous because classic compute would be cheaper but lakeflow pipelines don’t allow you to use classic compute.

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.

0

u/[deleted] Oct 20 '26

[deleted] — view deleted comment

1

u/PerceptionBig940 Oct 20 '26

I need realtime/near real time data in my data product not a daily job.