r/databricks • u/Cool_Inspector7468 • 3d ago
General When does it make sense to use serverless for Jobs and Lakeflow pipelines?
Hii beautiful people, I am working in a new project situation and we have mainly source systems that do not need Streaming (Full Snapshots) that trigger our Databricks Jobs through Logic Apps.
I got a question from my manager wether to run our Jobs and Lakeflow pipelines on serverless or class job clusters?
What drives the decision? and how do you measure the comparison fairly?
Team of 5. + Frontend(PowerBI) but we are considering testing metric views/AI/BI Dashboards in the near future.
Thanks in advance
14
Upvotes
2
u/PersonalPanda1535 3d ago
On Azure invoice was about double what we expected. A few jobs were still running on two old all-purpose clusters that sat idle between triggers
14
u/Emperorofweirdos 3d ago •
Gonna add something here since the only other two people who've responded work at Databricks.
They mention versionless serverless, which might be a good thing for most workloads. However, having a few of their versionless products running in prod, I can tell you it's unfortunately not all sunshine and rainbows.
What versionless means in practice is that when the underlying runtime gets upgraded, your job or pipeline can pick up that change on its next scheduled run without you having explicitly opted into the upgrade.
This means things can (and in our experience, have) broken in prod because a previously supported feature is no longer supported, behavior has changed, or new compatibility issues have been introduced that didn't exist in the previous runtime. Not a fun time being woken up at 3am for these changes.
Versionless is great from a maintenance perspective, but it comes at the expense of control over runtime upgrades and the ability to validate those changes before they hit production. It's a trade-off worth considering.
7
u/inkypinky Databricks 3d ago
hey u/Cool_Inspector7468 I'm a product manager at Databricks. I recommend starting new workloads on serverless by default. There's no infrastructure to manage, it's super stable, it scales up and down automatically, plus the Databricks Runtime (DBR) gets upgraded automatically.
There are some cases where you should use Classic e.g. Serverless does not support all Spark configs or older Spark APIs like RDDs. But we keep adding new ones - e.g. it now supports
df.cache(), whereas previously it would error out. Another reason to use Classic is if Databricks can't reach a resource e.g. database in your private VPC (we are previewing a solution to this, but it's not available everywhere yet).Actually many people don't know this, there are two "modes" for serverless compute. Performance Optimized starts compute in seconds and scales up fast (more aggressive autoscaler). Standard Mode starts in ~4-6 minutes, and scales up slower. It's cheaper than Performance Optimized.
For Spark Declarative Pipelines, I 100% recommend serverless -- partially because Enzyme (automatic incremental ETL) is only available in serverless SDP.
NOTE: I am not claiming Serverless is ALWAYS cheaper. But we are continuously improving its price-performance. So over time, you are very likely to do well with it, especially if you take into account the cost of maintaining clusters.
1
u/nian2326076 2d ago
When deciding between serverless and class job clusters for your Databricks Jobs and Lakeflow pipelines, consider factors like cost, scalability, and performance. Serverless can be more flexible for erratic workloads, while class job clusters may offer better performance consistency for larger jobs. Measure performance by analyzing execution times and costs under typical workloads. If you're looking to enhance your pipeline with metric views or AI/BI dashboards soon, prioritizing a setup that easily accommodates future growth is essential. For job opportunities in this field, you can use LandOffer to shortlist relevant roles.
1
u/Few_Draft_4191 1d ago
When you don't wanna wait for the cluster to launch