Skip to main content

Kill Bill-ing? Revenge is a Dish Best Served Optimized with GenAI

Summary

  • 49% TCO Reduction: Sportsbet achieved a 49% reduction in Total Cost of Ownership using GenAI to optimize Databricks cluster configurations and resource consumption.
  • AI-Powered Optimization: Leverage generative AI to analyze cluster logs, resource usage, and code to automatically generate Spark optimization suggestions.
  • Agentic Workflows: Build intelligent automation by combining Databricks AI tools with data engineering features to continuously optimize your data platform costs.

Kill Bill-ing? Revenge is a Dish Best Served Optimized with GenAI

Watch: Kill Bill-ing? Revenge is a Dish Best Served Optimized with GenAI
Talk by Abdul Furkhan, Technical Delivery Manager, Sportsbet
In an era where cloud costs can spiral out of control, Sportsbet achieved a remarkable 49% reduction in Total Cost of Ownership (TCO) through an innovative AI-powered solution called 'Kill Bill.' This presentation reveals how we transformed Databricks' consumption-based pricing model from a challenge into a strategic advantage through an intelligent automation and optimization. Understand how to use GenAI to reduce Databricks TCO Leverage generative AI within Databricks solutions enables automated analysis of cluster logs, resource consumption, configurations, and codebases to provide Spark optimization suggestions Create AI agentic workflows by integrating Databricks' AI tools and Databricks Data Engineering tools Review a case study demonstrating how Total Cost of Ownership was reduced in practice. Attendees will leave with a clear understanding of how to implement AI within Databricks solutions to address similar cost challenges in their environments.
Databricks Named a Leader in the 2025 Gartner® Magic Quadrant™ for Data Science and Machine Learning Platforms: https://www.databricks.com/blog/databricks-named-leader-2025-gartner-magic-quadrant-data-science-and-machine-learning
Build and deploy quality AI agent systems: https://www.databricks.com/product/artificial-intelligence
See all the product announcements from Data + AI Summit: https://www.databricks.com/events/dataaisummit-2025-announcements

FAQs

How can GenAI reduce Databricks costs?

GenAI can analyze cluster logs and resource consumption to identify inefficiencies and suggest Spark optimizations. This automated analysis helps teams quickly identify cost-saving opportunities without manual code review.

What is the 'Kill Bill' approach to cost optimization?

Kill Bill is an AI-powered solution that transforms Databricks' consumption-based pricing model from a challenge into an advantage. By intelligently automating analysis and optimization suggestions, it helps organizations achieve significant TCO reductions.

Can agentic AI workflows help with ongoing cost management?

Yes. By building agentic workflows that integrate Databricks AI tools with data engineering features, organizations can create continuous, automated optimization that adapts as workloads change, maintaining cost efficiency over time.

What measurable results did Sportsbet achieve?

Sportsbet achieved a 49% reduction in Total Cost of Ownership through this AI-powered optimization approach. This demonstrates the potential impact of intelligent automation on large-scale data platform economics.

Full transcript

Hello, and welcome to Kill Bill. Revenge is a dish best served optimized. What a title. Um No Uma Thurman either. I know some of you might have been expecting that, so it's just me and a very interesting use case of GenAI to share with you all. Um now before I proceed further, I just wanted to recognize someone. Uh Ryan is a lead AI engineer at Sportsbet. Um He was instrumental in bringing Kill Bill to life. Um Unfortunately, uh because of logistical reasons, let's just leave it at that, he couldn't make it uh over here.
So I get the pleasure of sharing his amazing work with you all. Um I'm an engineering manager at Sportsbet Australia. Cool. Picture this. Reducing your costs while simultaneously maintaining your performance. Sounds like a pipe dream, doesn't it? Um but for the next 15 minutes or so, I'll show you how we leverage the power of GenAI, um build intelligent workflows, and um totally change our approach to cost management.
But before we dive into the details, a little bit of who we are and our journey with Databricks and data as overall. Uh Sportsbet is Australia's leading online wagering um bookmaker. We uh handle about 4 billion price updates every year. Um during Melbourne Cup, um what we call as uh a race that stops the nation. We peaked at about 63,000 bets per minute. We also have very fairly large active customer base, a little over 2 million of place a bet with us year on year.
Um, what basically all these numbers mean is essentially the vast compute that's required to process the data that comes through, right? And as you can imagine, even small inefficiencies can cause a lot of cost can have lot of cost implications. So our journey with data is no different than many organizations. Just like everyone else, our platforms were let's just say very traditional in nature and they had lots of challenges, right?
We went through a period of modernization and migrating our platforms on the data bricks was a huge milestone for us. Uh, post or during this migration, our main focus essentially was apart from investing in our people so that we leverage modern data practices was essentially agility, uh, scaling our platforms, meeting, sorry, performance and most importantly, meeting our SLAs. So our data data platform is built entirely on data bricks.
I won't go through the architecture detail there, that's probably for another time. Um, but some of the key things I wanted to highlight was so we achieved less than 10 minute latency, operations became very boring because we freed up few of our uh people from mundane tasks. Uh we increased and delivered uh speed in our delivery as well, and things were looking brighter and brighter. But, here is where our uh journey uh story gets interesting, right?
So, as we scaled, we faced a very classic dilemma. So, our resource utilization was growing uh a lot faster than our workload, essentially. Um sure, we could throw a lot more compute at the problem and solve it and still meet our SLAs, but was that cost necessary? Were we doing things the most efficient way, or could we do things better? Uh those were the questions we were asking ourselves. What we also realized was the problem ran a lot deeper.
Um more than just high cost, right? Like, you see we've got fairly large spread of data engineers, data science, and ML engineers within Sportsbet. Um and they're essentially spread across multiple teams and multiple geographies. Now, as you can imagine, like configuration drifts or misalignments between the teams um you know, can have a lot of tech debt, and what it led to was essentially our engineers spending a lot more time in optimizing pipelines than actually building new features, which isn't really good for business.
So, obviously, we wanted to uh take a newer approach, and we needed something an automated way to solve this. So, enter Kill Bill. Um think of it as a intelligent advisor uh that analyzes everything from, let's say, logs to your code patterns, uh and makes optimization suggestions while uh maintaining or improving your performance. Uh we essentially tried to build this to bridge the gap between what's possible and um what's practical, right?
Like uh in its first application essentially uh we were able to reduce the cost of a particular job from about 190,000-ish AUD, not USD, down to 98,000 um dollars. So, that's nearly 50% reduction. So, uh why Kill Bill? Like why not just uh do uh our traditional cost optimization? Um the answer basically lied in the need for automation and also better use of our people. Let's face it, like we've all been there. We Nobody really likes scanning through pages and pages of logs, um you know, dive into resource utilization or, you know, specs and things like that.
Um or even, you know, go through lines and lines of SQL code and try to fine-tune a SQL query. It takes a lot of time and a lot of effort, and it's not an easy job. A lot of senior engineering teams also sometimes struggle with this, right? Cool. Um so, with the growing advancements in AI and general uh and specifically in generative AI, it seemed like the most appropriate solution to go after. It essentially could recognize massive patterns across massive data sets, process years and years of historical data within minutes, and continuously learn from a lot uh the new deployments that we were doing.
All right, with all that out of the way, let's talk about the details of Kill Bill. So, at a very high level, um we can categorize it into three logical layers. So, the application layer, where the UI sits, where the engineers or the users can interact with it. The agent layer for essentially your AI analysis, and your infrastructure layer, which is literally everything from your the la- LLMs that we use, MLflow for monitoring, etc.
Here's what the high-level architecture looks like. Um the system essentially integrates five key components. Um so, the interaction layer, uh which is the chatbot UI that I mentioned, and data sources. This is essentially where we gather all the information that is needed by the system to function. Um next up, down below, it's kind of hidden by the text, but that's the knowledge base. Essentially, we create a comprehensive vector database using some of those data sources.
And on your right, the GenAI component, this is all the uh models that we use, MLflow, etc. Right? Uh the last bit, which is the most important one, the agents. Uh this essentially is your optimization brain. Let's break this down one by one. All right. Um talking about data sources, so we gather data from literally everywhere. We run a job uh on a cron scheduler to crawl um internet for Databricks best practices, um and also from Databricks website.
Uh we also supply it or supplement it with our own internal documentation and the learnings we've had fine-tuning pipelines, etc. Um we also use some system tables that give us DBU billing usage, etc. Um we also configured Overwatch data um so to get all the metrics details and Spark config and other things. Some metadata bits already, as you know, would exist in Unity Catalog that we use. Cool. The next step, and this is probably the most uh important uh thing as well, was to create a comprehensive knowledge base.
Um so essentially our job pipelines uses those data sources or some of those data sources, like I mentioned, and uh hook use uh and uh takes uh help from the Hugging Base uh embeddings model, uh and we index all of those embeddings into the vector database uh using Mosaic AI vector search. Um this was very important for us cuz we didn't just cuz the alternative was like you you'd need to end up writing all the rules for the decision-making, right?
So we didn't want to do that. Um so we wanted the system to understand why certain best practices work better than the others. Um so we incorporate all Databricks documentation and best practices, but here's all here's the key like we also supplied internal documentation, right? So that makes it a lot more comprehensive. So the challenge was making this uh knowledge base actionable. It's not enough what type of configuration works is best practice.
We needed to understand when to apply in certain situations. So these are the main GenAI components that we use. So Mosaic AI vector search, as I mentioned, for vector database. Um the AI gateway to interact with LLMs and we end up in all of this with your llama index workflow. And also MLflow for monitoring and tracing purpose. Right. Uh so, at Kill Bill's core, we've got three main agents. Um so, there's a code base analysis agent and a resources analysis agent and kind of like a main agent that sits on top that um kind of mashes everything together or gives you a comprehensive analysis.
Um we'll break this down further. All right. So, code base analysis agent. So, this performs uh code base analysis to identify any out outdated code out there and also any sub optimal uh implementation of your SQL or PySpark. Uh it also examines the underlying tables that the code has access to. Uh and it extracts the metadata real time to better understand the context and provide more targeted um sort of recommendation, right?
Uh and this bit of context awareness um is what we think the gives us an edge over for with this implementation, right? Um so, for example, like let's say um we're analyzing a query that has multiple joins across multiple tables. Um it just doesn't evaluate syntax and other things are checks and balances are right. It extracts things like um the table size, the distribution pattern, the query pattern, or the frequency of queries, etc.
Gives that context back and then supplies you an optimization suggestion like maybe in this case a broadcast join isn't good enough and you need to do a re-partitioning or redistribution etc. Uh the next one is your resources analysis agent. So, as you can see it's more on the compute side of things. So, the system conducts CPU memory DBU consumption analysis to determine whether jobs are more CPU intensive or memory intensive, right?
So, it evaluates cluster configurations. Uh it assesses jobs properly if the job is properly configured based on the code that we supply it. Uh additionally, it also um uh sort of goes through Spark logs and uh pinpoints any section of the code that may be causing any processing delays, right? So, the this analysis is critical cuz typically what you find is when somebody is implementing migration programs or anything like us, uh meeting our SLAs or sticking to them is very high priority, right?
So, we didn't and what we end up doing is over provisioning for things where sometimes it may or may not be necessary to do that uh just because we're cautious and uh going through this is a good exercise to achieve better configuration. So, the job analysis agent, like I said, sits on top of both. Um so, you might be wondering why is this important? Uh essentially think of it like strings, right? Like you pull one, the other thing breaks.
So, this analysis kind of brings everything together and gives you a more comprehensive or a holistic approach. So, I've got the 5-minute signal, so I'll hurry up. Um So, I'll keep this one brief. It's just a UI layer and any questions I can answer on this a bit later. So, under the hood, so this what a typical workflow would look like. I won't go through all of this again, but I just wanted to highlight that the agents obviously aren't very strict.
Like, you can expand this. We are thinking about like a document analysis agent, which is specific to answering best practices, which may or may not be related to your pipeline. Um which might be helpful. All right, this is one of the case studies or uh one of the jobs where we uh asked Kill Bill to optimize. Uh it pointed out three main issues with the job. So, the cluster that it was running on was very memory optimized.
Uh while the workload was telling us that we needed us more CPU intensive. We were using very um deprecated join patterns, which was causing a lot of uh shuffling in the data. And also our partition strategy was not the best for those tables that were uh being used. I'm not sure if you can see the text, but that's what the analysis looks like. Um So, Kill Bill provided suggestions for each of the section, and ultimately it gives you like a comprehensive um report.
But, and in reality, you could ask follow-up questions and then try and inspect for any particular area you wanted to. And then get gain a bit more deeper insights into the problem. So, in the end, this is what the results look like. Um so, like I mentioned in the beginning, so the cost dropped down for this particular job nearly 50% and we kind of maintained the execution time as well. So, uh which was a really good outcome for us.
Cool. Uh which brings me to the my last slide. So, what's next for Kill Bill? Well, we are looking at, you know, trying to make it as autonomous as possible. Um so, it can continuously monitor jobs and make recommendations. But, we are also looking at um more a end-to-end approval flow. Um so, that let's say you ask um a question and it'll log um the recommendation into a Delta table until someone goes in and just verifies or follows your change uh management practices and approves the CR and uh implements it and then the whole pipeline can actually um uh make the changes into your Spark configs, etc. automatically, right?
And on that, so we're also heavily indexing on trying out for Spark configs rather than just the cluster configs, etc. Beyond that, really, uh sky's the limit. Like, we're at one point um thinking about having in Databricks Marketplace, so it's more shareable or have it open source as well. Um but, the concept really is that like leveraging GenAI um sort of giving it that power uh to understand deeper knowledge and give us insights readily uh on our pipelines.
Um with that, um thank thank you so much for taking time and uh listening to the talk. And please do complete the survey.

Learn more about the Databricks Data and AI platform.

The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.