Lakeflow Connect: Smarter, Simpler File Ingestion With the Next Generation of Auto Loader
Summary
- Cloud storage ingestion simplified: Auto Loader's new observability features provide out-of-the-box pipeline health monitoring and data quality validation, reducing time engineers spend debugging file ingestion.
- Schema evolution automation: Auto Loader automatically detects and adapts to changing data schemas, handling format variations and additions without manual intervention—critical for handling real-world data complexity.
- Performance and cost optimization: this video shares best practices for optimizing Auto Loader performance, reducing cloud storage costs, and preparing for REST API and UI capabilities coming to the roadmap.
Lakeflow Connect: Smarter, Simpler File Ingestion With the Next Generation of Auto Loader

Talk by Chavdar Botev, Sr Staff Software Engineer, Databricks ; Sandip Agarwala, Staff Software Engineer, Databricks
Auto Loader is the definitive tool for ingesting data from cloud storage into your lakehouse. In this video, we’ll unveil new features and best practices that simplify every aspect of cloud storage ingestion. We’ll demo out-of-the-box observability for pipeline health and data quality, walk through improvements for schema management, introduce a series of new data formats and unveil recent strides in Auto Loader performance. Along the way, we’ll provide examples and best practices for optimizing cost and performance. Finally, we’ll introduce a preview of what’s coming next — including a REST API for pushing files directly to Delta, a UI for creating cloud storage pipelines and more. Join us to help shape the future of file ingestion on Databricks.
Here’s more to explore:
Production ready data pipelines for analytics and AI: https://www.databricks.com/solutions/data-engineering
The Big Book of Data Engineering: https://www.databricks.com/resources/ebook/big-book-data-engineering-2nd-edition
See all the product announcements from Data + AI Summit: https://www.databricks.com/events/dataaisummit-2025-announcements
Chapters
0:00Introduction to Auto Loader3:31Configuration and Discovery9:12Managed File Event Features15:58Performance and Optimization31:15Data Sources and Formats36:09Schema Evolution and Quality43:11Observability and Monitoring1:04:03Future Managed Connectors
FAQs
What does Auto Loader's new observability enable?
Observability dashboards show pipeline health, data quality metrics, and alert conditions in real-time—eliminating blind spots and letting engineers quickly identify and fix ingestion problems.
How does Auto Loader handle schema evolution?
Auto Loader detects when new columns appear or data formats change, automatically adapting transformation logic—eliminating the need for manual schema management.
What cloud formats does Auto Loader support?
Auto Loader ingests data from S3, Azure Blob Storage, Google Cloud Storage and other cloud providers in multiple formats including Parquet, CSV, JSON, XML and more.
What's coming next for Auto Loader?
The roadmap includes a REST API for pushing files directly to Delta, a UI for building cloud storage pipelines without code, and continued performance improvements.
Full transcript
0:00 Introduction to Auto Loader
Good morning, folks. Thank you so much for joining us in this first session of the summit. As they say, early birds gets all the worm. Thank you. So, I'm joined with my colleague Chaudhry. And together we are going to talk about file ingestion and how we have made it simple and more efficient. This session is for informational purposes only. And the road map that we discuss may change based on the feedback from customers like you.
So, in this uh talk, we have a very interesting agenda. We're going to talk about data ingestion, in particular focus on file ingestion. And then uh we are going to talk about uh some of the challenges, innovations, and best practices uh for file ingestion. After that, uh Chaudhry is going to dive deep into uh the observability uh for ingesting uh files from cloud in production. And then we're going to share some exciting new items that we have in our road map to make uh file ingestion even more simpler and efficient.
So, let's dive right in. So, as you know, like every journey uh of uh from data to insight uh starts with a data source. And there can be many of them. Like you can have data in your SAS cloud, it can be in the cloud storage, it can be in the external databases, or it can arrive from uh sources like message buses. And it can be really difficult to uh sometimes get the data reliably in from all these sources in an efficient way.
So, at Databricks, we have built a lot of technologies that help you uh ingest the data from many different sources. And at the most basic layer, we have the structure streaming, which provide a very scalable, reliable, and efficient way to write queries to ingest data from many different sources, including cloud, message buses, and so and so forth. So, while it is a very efficient and fault tolerant, but uh users wanted uh more efficiency and uh better fault tolerance and uh being able to use that in a very simple way.
So, to do that, we uh made Delta Live Tables available, which is the way to just specify your transformation in a very declarative way, and DLT can automatically figure out how to configure the pipeline and how to uh do all the failover and how to do the scheduling. So, all of that uh is abstracted out from users. But then we heard from the users that they are they want more simplicity. They want to handle more data sources, and they don't want to deal with complex APIs.
They don't want to deal with uh 10 different third-party solutions just to ingest data. So, for that, last year we announced Lake Low Connect, which is essentially a whole uh ecosystem of uh managed connectors that makes your life very easy to ingest data reliably. And in this uh particular uh session, we're going to focus on the cloud file sources and how we are simplifying it. So, at Databricks, we have many different ways uh to ingest uh file data from cloud storage.
3:31 Configuration and Discovery
And what we recommend is that the Autoloader is the single most uh uh way to ingest data efficiently and in a very fault tolerant way. And it is being used by a large number of our customers to ingest multiple petabytes a day in total. So, what is Auto Loader? It's basically a a structure streaming data source that can help you ingest data incrementally from the cloud. It does so in a exactly once fashion, meaning once a file is ingested, we're not going to read it again and create duplicate records in your destination.
It can handle many types of structured and unstructured data like whether it is parquet files or JSON or CSV. So, it can understand those different formats and it can parse its schema and evolve that schema as necessary. You can use either Python, Scala, or SQL to write your Auto Loader queries and can run it in any platform of your choice whether it is DLT or it is DB SQL or just vanilla notebook. So, while Auto Loader is a great we continuously strive to make it even better after getting feedback from users like you.
And in this session, we're going to focus on what are the challenges that we have heard, what are the innovations we have made to address those challenges, and recommend some of the best practices that you can use in your production workloads. So, first let's focus on some of the configuration complexity feedback that we have gotten and we are addressing it. So, the first thing you do when you define your ingestion data pipelines is how often you schedule your ingestion pipelines.
And typically you do that using jobs and workflows. And it provides multiple way to select at how often you ingest data from your cloud. And that scheduling can be just a periodic scheduling. You can define a periodic cron like a job as to like how often your query runs. Or you can define something called file trigger, which basically trigger your job when the file actually arrive in your cloud storage. And the third option is a continuous uh uh trigger, which basically means that your query runs continuously and picks up the data as it arrives.
And finally, there is a manual mode where you either click the manually uh your job to run, or you can choose whether uh this job has to be run programmatically using your other tools. So, that's the way how you run your job. And then the second is uh how do you discover the files? So, Autoloader provides uh today two ways to discover the file. One is uh uh through vanilla directory listing, which is basically very simple to set up.
All it does is basically scan your directory in the cloud storage and find all the new files that were arrived since the last time the query was run. And start ingesting those files. So, this work fantastically well for small directories, but for very large directory where you might have uh hundreds of millions of files, it can end up uh a little costly solution because it is scanning those directory every time it has to run to pick up the new files.
So, for that the reason, uh we uh uh the feedback that we have gotten from our customers is that they want to ingest data incrementally using event-driven approach as opposed to running it continuously. And for that, they are using the file arrival triggers to schedule the jobs. And they're using autoloader with file notifications. So, what file notification does is basically subscribing to the cloud queues and get notification from the cloud provider whenever the new data arrives.
But, this has been sometimes very difficult to configure and scale. So, for example, the file arrival trigger, you could only set those trigger for a a directory which has just 10,000 files. So, that was a serious limitation. The issue with the file notification was that there were a lot of permissions that you need to provide to set up the autoloader query. And those permission can uh be hard to get, especially for a data engineer whose company policies may not allow them to uh put those permissions in for every autoloader query.
So, to address that, uh what our users ended up doing is use less efficient approaches, like for example, in case of the workflow, they just use the schedule periodic periodically running the job instead of a event driven job event driven trigger. And for autoloader, they ended up using a directory listing to discover new files in the cloud storage. So, how do we address this? So, the solution that we are proposing is a file event.
9:12 Managed File Event Features
So, this is a new way to discover the files with autoloader and a new way to schedule your job in your pipeline. So, let's see how it works. So, the way you configure file is basically first to grant permissions to create a file notification queues in your external location. So, external location is a Unity Catalog managed object which is which wraps your cloud storage with the security credentials. So, once external location is created, you can enable the file events and every time uh some data arrives in that external location, uh we get a notification about that data arrival.
So, once you get that location once you give us the permission and then we have to enable the file event for these external location. So, it's just as simple as clicking a checkbox in your uh uh external location UI whenever you create external location. And you can also enable it later once it is created. And then the third is in the auto loader instead of specifying a large number of uh uh credentials options, all you have to do is specify this one single option that says, "Okay, use file events for file discovery."
And in fact, we are working on even making that options redundant by making file event the default subsequently down the line. So, this file event is like I said, it's much simpler than the legacy notification where you have to specify a lot of the uh options previously. Uh a whole bunch of 15 to 20 options to say which queue we want or what the credentials are. And with the new file event, all you have to do is specify a option to enable that file event.
So, how does that help? So, so one is your incremental file discovery from your cloud storage becomes much simpler, much more efficient. So, in this example, what I was saying is like the if you have to discover 10 million files from a typical cloud provider, it may end up taking roughly 40 minutes if you're just listing those 10 million files. And with uh file events, just uh getting uh ingesting uh incrementally uh one one thousand files out of the 10 million directory, it will end up taking only minute or less.
The other thing about the limitation I talked about about setting up the file arrival trigger, which had a 10,000 files per directory limitation, that limitation has is no longer there. It can have unlimited number of files in in your directory, and we are going to be able to serve the notification from that directory and trigger your job based on those events. Another cool thing about using the file event is that uh with uh file notifications, you have to go and create event subscription and cloud queues for each autoloader source that you create.
So, if you have uh like three autoloader sources that are reading from the same cloud bucket, you may end up creating a large number of event queues and quickly run into the cloud provider limits that can impact uh some of the very large users. With file events, we just create one uh subscription and one queue to read from your cloud bucket, and each autoloader query that you run will ingest uh from that queue. So, that significantly uh simplifies uh your event queues and subscription for your cloud.
So, let's uh see this in a real demo and how it works. So, in this demo, what I'm showing is like enabling the file event as we talked about before in an external location. And then we are going to create a autoloader uh query that is going to read from the cloud, okay? And we have set this managed file event option. So, after that, we're going and creating a job that is going to create a notebook task. And that notebook task is going to be triggered using the file arrival trigger that we just saw.
So, as you can see, there are multiple trigger choices and we have selected the file arrival trigger and specified the storage location from where the events are going to come from. uh we are going to generate some data and write to that uh cloud directory. So, I'm In this case, I'm just writing 10 files that are uh going to be written to the directory that we specified in the autoloader. And as soon as we write those uh files there, it starts and triggers uh the job that we configured.
Because uh we got an immediate notification from uh the cloud provider about the existence of new files. So, once that job is done, we go and check whether the data has been ingested and sure enough we see some data in the data table. So, this is a very simple demo, but imagine you can now create a very large deterministic production pipeline using these file events and uh uh both in the auto loader as well as scheduling your job.
15:58 Performance and Optimization
So, let's look at what are the different options do you have regarding scheduling. Regarding scheduling and configuring auto loader. So, if your latency requirement is a very stringent, like you want to ingest data in real time and make sure that the data arrives in your target tables as soon as they are produced. So, in this case you can choose to run your pipeline in continuous mode and configure auto loader to use the file events that we just saw.
But if you are uh relaxed on uh the uh latency requirement, like if your latency requirement is in minutes and not seconds, then in that case uh the file arrival trigger type provide a good balance in the cost and efficiency. You no longer have to run your job in always continuous mode or sometimes if your data is arriving in a irregular fashion, meaning like uh there is no periodic interval your data is arriving, then the file arrival trigger can make a very good use of your resources because it is not keeping your cluster running continuously.
And finally, if you really don't have a good uh latency requirement like you are okay ingesting data in hours or maybe even a day, then in that case running some periodic pipeline in that frequency can uh is also fine. You don't necessarily have to use uh the other trigger type. But at the end, what we recommend is for most of the use cases the file arrival trigger coupled with the file events in the autoloader give you the best combination of cost and efficiency.
So now uh what if you cannot use uh uh the file event for some reason. And that it can happen because of a number of reason. One is your organizational policy may not allow to configure your external location with all the secret credentials that enable the file events. And if that is the case, then in that for that reason, we have worked hard for the last 1 year to make sure even the existing autoloader directory listing performance and the performance of processing the file is optimal for your use cases.
So let's talk about some of those improvement we have done over the last 1 year. So the first uh innovations I'm going to talk about is how we have made even the directory listing very efficient. So normally the directory listing the way it works is that uh it will uh go and scan your cloud directories and try to find out all the new files that have not been ingested before. And that can take significant amount of time.
Especially if your directory size is very large. Like you can have 100 million. In fact, I ran into customer last month who had 1 billion files in their cloud directory. So for that, um if you look at how this whole directory listing work is normally you have a directory and in this new directory listing mechanism, what it does is it partition the directory into smaller blocks and then schedule the listing job for each of those partition in parallel using Spark.
And by doing so, it is able to significantly improve the run time of discovering the new files. So what this graph is showing is that the red line is something that is the new directory listing, which is almost three times better at discovering all the files in your cloud versus our previous directory listing. The second improvement that we have done is that when we partition this directory into different parts, we prioritize listing those directory first that may have the potential to have the new files.
So for example, if you have thousands of subdirectories in your directory, then we'll try to find out which one may potentially have the new files. For example, there may be time stamp directory and we can based on the time stamp determine, okay, this directory makes sense to list it first. And by doing so, it help start your ingestion much sooner. We don't have to wait for the entire directory to be listed before starting to process the files.
So in this graph, what it is showing is that the red line is able to which is our newer direct listing, it can discover the new files up front and doesn't have to wait for the whole directory to be listed. And that improves the performance significantly. So, if you have a large number of files in your directory, we are able to get that in it's much lesser time. So, some of you may have a noticed that when you run the auto loader query, it there is a some startup uh time involved before your query actually runs.
And during that startup, what it is essentially doing is it is loading its state from the cloud. And this state in the auto loader helps it to guarantee the exactly one semantics that I was talking about earlier. Uh so, for very large directories, the state can be pretty large like and downloading the state can takes from tens of seconds to even tens of minutes, especially in scenarios where you may have to track 100 millions or more files in that state.
So, this synchronous loading of that state used to earlier block the data from processing. So, unless that state is loaded, we cannot start processing the file because we have to uh refer to that state to figure out whether that file is actually ingested or not. So, what we have done recently is that instead of loading that state synchronously, we load it in an asynchronous way. So, kind of a on-demand paging like depending on which files we are deciding to uh ingest, based on that, we determine, okay, what state need to be loaded in our system.
And by parallelizing this state load and the processing, we significantly improve our startup time as well as the total time of processing. So, this uh feature we uh released in the Databricks runtime uh 15. 4 release, and this is a snapshot of our of our own analytics that we got from our customer environment. And what you can see is in the prior Databricks releases, uh the startup time could have been very large, like compared to hundreds of seconds.
But, in the newer ones, uh it is just a few seconds. And what we recommend is that you upgrade to a newer Databricks runtime release, uh 16. 4 or newer. Or even better, just switch to serverless, where you don't have to worry about any of these releases. You get all these innovation as soon as they are available. So, the next uh improvement I'm going to talk about is about ingesting the small files. So, interestingly, like what we have observed is that more than 80% of the files that our users ingest today are less than 100 KB.
And when you're ingesting lots of them, like maybe like in your one batch, you're ingesting 1 million small files, it's generally uh may end up taking a lot of time because uh you're not uh ingesting bulk data, or rather you're just ingesting small small amount of data. And to be able to make it more efficient, a lot of our users uh who have advanced knowledge of Spark, they would go and fine-tune different knobs like the Spark partition size or they will tune Auto Loader options like max files per trigger, max bytes per trigger, and that way they would eke out better efficiency.
And more often than not, they would run into some kind of problems because that may end up changing the memory footprint of the driver and cause some severe issues. So, what we did uh is that we made this uh common case of workload much more efficient by changing how Spark processes these jobs. So, Spark is very good at uh partitioning your workload into different tasks and process those tasks in parallel. But, within those tasks, the ingestion job runs sequentially.
So, essentially, if you have like 100 files to be ingested within a task, those 100 files used to be processed one after the other. What we did was we instead of processing them sequentially, we made them to process in parallel. And that gave a significant performance boost uh to an extent of like two times to four times uh depending on how large the number of files you were ingesting. A related improvement that we did was uh regarding the compressed files or or multi-line files like JSON, for example, which can span where single record can span multiple rows.
So, those kind of files have to be processed in just one Spark task because uh we cannot reliably split them to process them in parallel. And uh because of that uh uh some of the very large processing very large compressed file could have taken a large time. So, what we did in this case was that instead of, uh, restricting a compressed file processing to just one task, we, uh, added a new stage that is going to first decompress and, uh, create multiple smaller portion of that file.
And then those smaller, uh, files are going to be processed in parallel across different Spark tasks. So, this increased parallelism and improved, uh, performance, uh, significantly, especially when your, uh, files compressed file size is very large, like a gigabyte or 2 gigabyte or even more. So, you'll see that we're ending up creating a large number of, uh, Spark tasks to process them. So, after your data is ingested, one of the common, uh, thing that we have heard from our customer is that how do we, uh, handle the ingested data at the source.
So, do you leave them there? Do you move them somewhere or do you delete them? Or, uh, you may want to use, uh, the your cloud provider's ILM policies to move them to a different tier. One challenge of doing so was that the user doesn't reliably know whether that data has actually been ingested by Autoloader. So, what we did was build this a new cool feature called Clean Source that is going to reliably move or delete data based on your choice.
So, uh, essentially, once the data is ingested, Autoloader knows that, uh, these data is, uh, already processed and based on your retention duration, it can make a choice whether, this data needs to be moved to a different location or if you choose delete it from your source cloud. So, to enable this new feature, all you have to do is set this option called clean source in auto loader. And it has a few different options.
So, one is of course off by default. We don't want to delete any data that is in your cloud storage unless you tell auto auto loader specifically that it need to be deleted or you can choose to specify a move location. So, the default retention duration is a 30 days, but you can choose to have it for a smaller duration also. So, one thing to note and notice that if your move location is not in the same bucket as your source, then it can result in actually downloading the files and then copying it to the new location.
So, that can be inefficient. So, the move location ideally should be in the same bucket. So, auto loader has this entity provide this entity we have called cloud file state which you can look up to analyze the state of your file processing. Whether that file has been ingested or whether it is when it was discovered, what was the size of the file, so what state of processing it is in. And with clean source, we added these four new fields that now tells you when was the data moved, whether it was is deleted.
And uh it you can also look at the time when it was archived. So, one thing I would like to bring to your attention about the clean sources that if you have multiple auto loaders reading from the same cloud directory, then in that case you want to be careful about enabling this option because it can conflict with different readers. And the same is true if you have readers outside of auto loader both within and outside databricks that may be reading from the same source locations.
So, you don't you may not want auto loader to delete it automatically. So, that was about the cost and efficiency and performance. So, now let's talk about the data sources and formats. So, we have been talking about that okay, auto loader is very good at about ingesting data from different cloud providers. And it supports all major cloud provider that we are familiar with today. And it can also ingest a data from databricks own file system as well as a volumes.
31:15 Data Sources and Formats
But the files that we ingest are not only present in these cloud storage provider, but they may be available in other types of entities like for example, SFTP servers. So, we have been hearing a lot of the users ingest data from SFTP using their own home grown solution. And that prevented them from taking advantage of the auto loader capabilities like exactly once ingestion, incremental ingestion, and schema inference and evolution.
So, to address that we build in a native support for SFTP, which uh is a pretty simple to use. All you have to do is first define a SFTP connection in the Unity Catalog. You can either use a UI or you can use the sequel to define the connection either using the private key or using the password. And once that connection is defined you can specify the SFTP data source in auto loader just like you specify your cloud data source.
And all the features that are available with auto loader become available with the SFTP data sources as well. So earlier I mentioned that we auto loader is able to consume a large variety of data formats whether it is a structured or unstructured like a parquet files, JSON, CSV and others. And it does so by first processing those files, infer the schema, and then evolve the schema as and when new fields or any changes happen.
And by ingesting, converting that structured and unstructured data into a structured format, it helps you run your analytical queries. But we keep on hearing the interest of about other file formats as well and last year we added the support for XML. So already XML has a large number of users using it in a production. And now next month we are going to make Excel available natively for auto loader. So you will be able to ingest both multi sheets as well as more complex Excel files directly using the auto loader or using DB sequel which can be read as either files or as blog because if they are embedded in your sequel columns.
So let's look at the how the Excel injection may look like in our UI, so uh, not only you can ingest Excel using our own uh, uh, queries using Autoloader, you can also see a quick short demo of how our you can use that using our add data UI. So, I'm using a small sample Excel file and uh, upload it to the Databricks uh, platform. And select uh, this uh, file uh, that is automatically ingested in the in our warehouse.
So, as you can see uh, it basically is running a SQL query and you can set a bunch of attributes of how to do the schema inference and make sense of your fields. And the data gets automatically ingested. And uh, you can now see the data in the table. So, all the fields that were there in that Excel file were available in the target table. So, one of the common issues that we have heard uh, from our users is how to deal with the schema changes.
So, not all the data that comes in conforms to a fixed schema. And for that reason, Autoloader from the very beginning it supported automatic schema inference. So, let's take a look take a look at the example. Uh, like let's say you have a parquet file at the source or it can be some other format like it can even be a CSV file or JSON file. And in this uh, file we have a very simple two field scenario where we have I have one field ID which is an integer column, and then the other another is name, which is a string.
36:09 Schema Evolution and Quality
So, Autoloader will infer the schema when ingesting this file, and then adds a special column called rescue data, and the purpose of that rescue data is to be able to store the values of a particular field that doesn't conform to the previously inferred schema. So, in this case, that file gets ingested as normal, uh and the rescue data is null. But now let's say you have another source file which has a new field, um which was not in the previously inferred schema.
So, here we have this special schema evolution mode called add new columns, which will allow you to uh evolve your schema, and then update the target Delta table with these newly added field. The problem arise when one of these field may have a type change. So, for example, the field ID, earlier it was just an integer, and now it is long. So, when such a type change happened, then uh uh Autoloader would earlier go and rescue that data because we cannot fit in a long type field in a smaller integer type column.
So, uh if you run the Autoloader today, uh what you'll find is that these new value is going to be stored in the rescue data column. So, uh so this was a constant pain for a lot of our users. So, what we did was that we added in this new mode called add new columns with type widening, and this take advantage of the Delta type widening feature to make sure that if a conforming type change happen for a particular field, we should be able to widen the destination schema as well.
So earlier without type widening, we used to rescue that field ID. But now with type widening, we are going to evolve it to the wider type and make sure that the data instead of getting rescued, it goes in its regular column. So you no longer have to go and deal with the rescue data. You don't have to run a post processing job to find out whether the data has made it into the regular column or the rescue data column.
So Note that only the type changes that are supported by Delta today are supported by autoloader. So if you have a non-conforming data type change, like for example, if your integer column becomes a string, that is not what Delta supports today. And so that will continue to get rescued if that happens. Now that doesn't mean that you have to get stuck with the rescue data because the type widening did not handle that.
If your schema is really messy, if it changes in a non-conforming way, or you you have many different kind of data coming in that doesn't conform to a specific schema, then the variant type provide a good alternative to just that data. So what is a variant? It is essentially a new data type that we introduced last year and it doesn't have any predefined schema. So there is really no schema inference and evolution at the time of the read.
And it is available for all the text based of file format that we support today, whether it is JSON, CSV, and XML. So, there are a couple of ways that you can ingest our data as a variant. You can ingest the whole record as a variant. So, for example, if you have a JSON record, um ingest that whole record as a variant, or you can specify a specific field of the JSON to be inferred as a variant type using either the schema hints, um which is an Auto Loader option, or you can specify uh your own schema and indicate which particular field need to be a variant type.
So, the schema, uh instead of uh being inferred at the time of ingestion, we it basically gets specified at the time of the read. So, when you are actually making a query and reading the variant data, at that time you indicate which field you want to read and what is the type of that field. So, the problem of uh the schema is deferred uh later when you write the query. So, what are the choices? And let's review some of the best practices in dealing with the schema changes.
So, if your uh data conforms to some specific schema, and if your schema changes in a additive way, or query performance is really important for you. So, in this case, we recommend that you use the struct data type. And if your uh data conform doesn't conform to any specific schema, then in that case, the variant provide a good alternative to handle uh very messy schema. And in case of the struct type, uh if your use case warrants uh a fixed schema, you cannot tolerate any schema changes.
So, in that case, you can go specify uh that particular schema at the time of ingestion. But, if that schema is unknown, and you want to evolve the schema as and when it arrives. So, enabling schema inference uh maybe a better choice. And this is what our most of our customer do, enabling schema inference. And in once you enable schema inference, you have the choice of not allowing any further schema changes because it maybe your downstream doesn't support any of those changes or you know for sure that your schema is not going to change, but you just want that initial schema inference.
So, there are a couple of options there to do so. But, if you want to support uh some limited set of changes like addition of new columns or type widening changes, then you have two new schema evolution mode that allows you to do that. So, so that kind of bring us uh to the end of how we can deal with the data quality and the schema changes with Autoloader. Next, uh is going to talk about and discuss the observability for Autoloader in production and share some exciting new stuff that we have in our road map.
43:11 Observability and Monitoring
Thank you. Thank you. Thank you, Sandeep. Um good morning, everyone. Uh. I'm an engineer on the data ingestion team at Databricks. I'll be joining Sandeep today to talk about uh Autoloader and uh observability in particular. So, as as uh Sandeep just described over the past year, we have made a a number of improvements to Autoloader in terms of new features, improved performance, usability, and observability. So, I will now demonstrate how we can use some of those new features, uh and also combine them with existing capabilities such as Delta Live Tables, uh pipelines, and ABI dashboards to build a practical solution for Auto Loader observability.
Uh Auto Loader observability has been a uh frequent topic of interest, and we're working on a number of tracks to improve that. First, uh we're enhancing our documentation with more examples and practical uh how-to guides. Uh we're working on a uh quickstart data Databricks asset bundle for Auto Loader. That will allow you to start your uh file ingestion with a preconfigured Auto Loader that you can further customize to meet your needs.
Uh we're constantly trying to um add more uh uh additional observability data into the uh Delta Live Tables event log and system tables. And we're also very excited to share with you that we're working on a managed connection for connector for file ingestion in the context of Lake 4 Connect. Uh today, I'm just I'm going to focus on two of those uh tracks. One is uh going to start first with um describing how uh observability will be packaged into our uh Auto Loader Databricks uh asset bundle.
Uh and then we're also going to talk a bit about our file ingestion connector. Um just uh a word of caution. Uh I will try I will give a high-level overview of the observability recipe, uh but and we'll share more details after the eyes uh with the specifics and also share the specific Databricks asset bundle. All right. So, uh uh what what are the key flavors that we want to get from our recipe for observability? Uh we want we want to get a taste for any errors or latency.
Uh we want to detect uh performance issues or data quality issues. And of course, we want to make triaging those issues easier. Uh I will spare you the typical story in online recipes where I talk how I got this recipe from my grandma's or aunt twice removed. Uh although it's not grandma level simple just yet. Although we're trying to get there. Uh so, let's just click on the jump to recipe button and get straight to cook uh straight to cooking.
What are the ingredients for our observability dish? Uh first, we're going to use Databricks Runtime 16 for later. This is to enable uh some of the enhanced file state observability that Sandeep talked about. That's available through the cloud file states table valued function. Of course, we need our main ingredient, which is Autoloader. Uh we are going to use Delta Live Tables pipelines for the declarative ETL capabilities and Python meta programming.
Uh we are going to use the DLT event log as a key ingredient for our observability. Uh we're going to use the cloud file state table valued function to get an insight of the uh state of file ingestion that's being maintained by Autoloader. Uh we're going to use the API dashboards for the presentation of our dish to make it visually appetizing. Uh and we're going to throw in a little bit of monitoring ETL uh as a secret sauce to bind everything together.
Uh as I just mentioned, a key part of our recipe is the auto programming capabilities of GLD. And I want to apologize if the text is a bit blurry. We should have tested this in production earlier. But as they say, it worked on my computer. Um and so the we have the auto load ingest function, which essentially establishes a a repeatable pattern for file ingestion. It It builds a GLD sub graph that reads the data auto from using auto loader in a source view and then materializes it in a bronze streaming table.
After that, we utilize the quarantine pattern so that we on one side we want to isolate any corrupt data that uh needs to be further triaged. Uh and we want to expose a cleaner view of the bronze table for consumption in downstream layers. Uh before we proceed, uh first as I mentioned, we need to enable the enhanced file state observability. Uh as Sandeep just uh mentioned earlier today, uh this comes out of the box if you use the clean source data retention feature in auto loader.
But you can also enable it manually through these Spark settings. Uh it's important to note that uh uh enabling this enhanced observability does incur some performance overhead depending on the workload. So we recommend to deploy and test in a pre-production environment to make sure that it meets your observability your performance needs. Uh and we are working on uh minimizing that overhead. Now, let's move to autoloader preparation.
Uh to simplify the management of autoloader configuration, we have isolated it in a in a view. Uh and we have further tried to uh separate the con- tion that effect to uh auto for the observability recipe from the rest of the autoloader configuration. Uh there's still a lot stuff going on on this uh uh page, so I'm going to zoom in into the specific parts. First, we want to track any uh unexpected schema changes or corrupted data in the rescue data column and the corrupt record columns.
Uh Sandeep already talked about how uh rescue data column is used in connection of with autoloader uh schema evolution. I suspect that many of you are already familiar with it. Uh and for dealing with unparsable corrupted data, uh there generally two options. One is the bad record path option, the other one is the column name of corrupt record option. The former stores any unparsable data into files in the specified path.
And uh latter you uh stores that data into a column that's included as part of the output data frame. We recommend that you use the cloud name of corrupt record column to to avoid some of the uh race conditions that are inherent in in the uh um corrupt uh um data path. Uh and that can lead to actually loss of some of the uh observability trail for the corrupted data. It's a best practice to include uh um metadata about the source file as part of your ingested data.
This significantly can im- improve your observability and also ability to triage files. Uh to include that metadata, you you use underscore metadata column. For example, uh you can use that to pinpoint where a specific schema change is coming from or where a specific corrupted record is coming from. So, it can further triage. Uh the underscore metadata column includes a number of metadata fields, but here we include only two of them, the file path and the timestamp, because those are the two most pertinent to our recipe.
Um next, let's let's move on to the Delta Live Tables preparation. Uh first, it's it's important to enable the DLT event log and store it in a Delta table that access easily accessible from our uh for our recipe. This can be done either through the advanced settings in the UI, or it can also be done through the API. Ingesting the data into the bronze streaming table is trivial. Just read the source view that we already defined.
But, I want to emphasize on the use of DLT expectations. Uh as I already mentioned, we use the corrupt record and uh respective uh data uh columns to track unexpected schema changes or uncorrupt uh rows. Typically, most of the time those columns should be null. But, when they're not, that can be an indicator of a problem that we want to debug. So, that's where the DLT expectations come extremely handy. They instruct DLT to continuously monitor the data is being ingested and validate those conditions.
If it detects that any of those conditions is violated, it's going to generate an observability trail in the event log that we can then detect. Uh expectations also have ability to uh do automatic actions such as dropping the data or uh failing a pipeline, but here we're mostly interested in the observability aspect uh of the expectations. We also want to quarantine any records that contain corrupted data. We don't want to expose that to downstream layers.
Uh and the way we do that is by appending those to a GOT Delta sink, which is what it does is just writes those to a Delta table. Uh that can And the important part here that can be shared across multiple pipelines, so you can have all your information in one place. Finally, uh we want to provide a cleaner view of the bronze data to downstream uh layers. Uh and you may want to remove any metadata columns that we used for uh operational data ingestion pipeline, and also make sure that we remove any rows for which the corrupt record column is not null, for which contain corrupted data.
All right. Uh in the previous two steps, we described how we configured the Delta the data ingestion uh ETL, which will provide the necessary observability data for our recipe. Now, it's time to uh use the data. Uh and there three main sources for uh observability data that we use. One is what we already mentioned, the cloud file states uh table valid function, which contains information about the state of ingestion that's being maintained by Auto Loader.
The next observability source, this is the event logged for all the pipelines our ingestion pipelines. And finally, we also use the tables themselves. We use a monitoring ETL that will combine all this data into a set of aggregated observability tables. They contain information about the pipeline execution, about the uh progress of ingestion data in each table, the file states, and so on. We use those observability tables to power our AIBI dashboard.
You can also use the same tables to define SQL alerts to get automatic notifications whenever there's a condition that doesn't meet your SLIs. Okay. Uh so, I I will not have time to go into great details about the monitoring details. We just uh we don't have enough time for that. As I mentioned earlier, we're going to share the the quick start guide and also more documentation examples later after this. In this I should have probably rather talked through it.
So, we mentioned that we have uh several sources of uh observability data that we aggregate into a observability tables. The first observability table is the pipeline updates our table. Uh it aggregates information about the Delta pipeline from uh all the pipelines that we monitor and gives us information when they executed, the start and end time. It uh gives us information about how long the specific execution took, uh whether it completed successfully or failed.
If it failed, what was the error. Oops. In this brief demonstration, the next uh table is the table stats act table. Uh that aggregates uh information about the progress of in ingestion for each uh table that we want to monitor. Uh it contains row level metrics uh for for that table. Uh the next table is the file states act table. That aggregates information from the cloud file states uh for all the monitor tables and put it in one delta table that's easier to query uh and use.
Uh it contains information about uh latencies and uh state of the ingestion. Finally, we have the corrupt records uh table that aggregates information about all the corrupted data that needs to be further reacted. Using those four tables, uh we can build a ABI dashboard to monitor uh the state of ingestion. Uh because those tables observability tables contain aggregated information from across all our pipelines and tables, uh it's very easy to set up filters that allow you either to look at the big picture across all tables and pipelines or try to zoom in into specific pipelines or specific tables to look for particular issues.
And on the right-hand side, we have the filter tab, which kind of also based on the filter allows you to see what are the tables and pipelines that are currently being observed and also get an idea of when the specific pipeline execution happens so that they can correlate issues to specific pipeline runs. Uh the errors tab allows you to see information about all the recent execution of your pipelines and see whether they succeeded, they failed, how long it took.
If there any errors, you can see what was the specific error that happened so they can very quickly understand the nature of the issue. And at the bottom of the screen, you can see the any aggregate information about corrupted data, which you want to act on. Uh the latency tab gives information about the latency of the data ingestion. Currently, we track the time from when the data lands on on your cloud storage to the data gets ingested into the data table.
So, this is what we call the ingestion latency. Very soon, we're working on adding a capability for you to also track latency with respect to event time. You'll be able to tag a column in your target table and say this column contains the event time for my for when the record was created so you can monitor the time from when the record was created to the when it was ingested. The performance tab tracks high-level metrics about like how many rows were ingested, how many files, bytes.
It also allows you to drill in to some more performance-related metrics like for example, how long it took takes to discover the files, how long it takes to process the files so they can actually uh look at performance uh the triage performance issues. Finally, the data quality tab gives you information about uh any unexpected schema changes or any corrupted data that has been detected using the DOT expectations. Uh and because we of the annotation into the source tables, we can actually zoom in and for a specific corrupted data instance, you can go and check oh what does that corrupted look like the data look like?
Why is it not possible? We can correlate to the specific files and then you can decide oh do I need to re-ingest the data again? Can I fix it? Uh and so on. Uh similarly, for example, if you want to triage issues with unexpected schema changes, again, uh using expectations, you can detect those. Then, using the graph on the right-hand side the breakdown by table, you can see for which tables the issue happened. And then, you can use the filters to isolate and look for the specific changes.
Uh you can select the table for which the uh for which the schema was detected. And then, you can actually zoom in and see uh where in which file files caused that schema change and what does the new schema look like. Uh so that then you can decide oh is this a schema change that I want? Uh and then I have to go and modify the schema here so the schema configuration of Auto Loader. Or is this a schema change that I want to ignore?
Or maybe I uh another option maybe to uh modify the source the view from the bronze table to the silver layer and coalesce any data from the rescue data with your normal columns so that kind of provides you a unified view of the data. Uh right now, all of those activities need to be done manually, but this is actually one area that we're actively looking uh as part of our managed file ingestion connector to see how can we simplify those kind of operations so that you don't have to spend uh time too much in doing too much manual maintenance.
So, uh to recap, I give a very uh brief high-level overview of how one uh can build a practical observability solution from Auto Loader using existing features. As I mentioned, uh we're going to share a lot more details uh after DICE. Next, uh let let's talk about uh the managed file ingestion connector. As as we saw, uh even though the data bricks asset bundle that we're going to share is going to simplify the monitoring setup, it it still takes a few steps.
1:04:03 Future Managed Connectors
The same thing also applies with for Auto Loader in general. Uh the initial configuration and operations does require some uh effort. Uh and we want to see can we simplify that? Uh unfortunately, because Auto Loader is used in a variety of use cases, uh and we need to maintain backwards compatibility, it's not always easy to do it in the context of uh generic Auto Loader. So, that's why we're working on a more uh managed solution, which is going to take a large part of the Auto Loader configuration and uh allow to kind of provide more out of the box, more seamless experience.
Uh I want to uh a word of caution. Uh this is still uh work that's very early in the in the development stages and many things are subject to change. So, the following slides are meant more to kind of show you the directions that where we're going and hopefully get us some feedback from you and kind of if to see if that aligns with your needs, please please come talk to us. Again, everything is subject to change including the name of the connector.
Uh, all right. So, uh at a very high level, we just build a connector that allows you to have file ingestion that just works. And this requires uh, to have to for us to kind of take on a number of responsibilities. We want to automate the bucket setup cloud bucket bucket setup that's historically has been a a point of uh a kind of contentious point for the setup. Uh, we want to simplify automate the ingestion pipeline setup, auto load the configuration.
Uh, we want to expose simpler APIs for dealing with file file ingestion. Uh, we want to simplify and automate the continuous operations and of course performance tuning, everyone's favorite. Uh pastime. So, what are the design goals for our connector? First, we want it to be declarative. We want you to focus on the desired outcomes not the steps to get there. I want it to be simple. We don't want everyone to become a auto loader expert or GOT expert or expert of all the other related technologies.
Uh, another thing people just want to get their their job done and move on. Uh, we want this connector to be opinionated. Uh, which means that uh, we uh, are managing the configuration for you. We utilize the best practices kind of the kind of the our learnings from how Auto Loader should be configured to provide you a seamless out-of-the-box experience. And finally, uh, we want to this to be automated. We want to automate and simplify as much as of the routine tasks that you have to take on both the initial configuration and also the continuous operation of the file ingestion.
Uh, let's uh, try it to see how it works at a very high level. Uh, we've designed the connector with two personas in mind. First, this is the resource or the ingestion owner that interacts with an API to define the ingestion uh, pipeline. And if this includes just defining the destination table where you want you want to uh, ingest your data. The other persona is the data producer persona. They They may be the same person or different persons with a resource owner.
The data producer uses API to push file data into the destination tables. They don't need to worry about where the data lands, how the data is getting ingested. They go they pay just push file to a table. Uh, and then the file ingestion connector just is built on top of Auto Loader and DLT and kind of automates the activities uh, around initial setup, around uh, configuration. Uh, we it provides out-of-the-box uh features such as uh observability, schema evolution, uh schema management, data quality management, uh and others.
For example, the clean source data retention feature that uh Sundip talked about today, that's going to come out of the box. You don't have to worry about configuring it. Our initial focus is to be uh API-first connector. Uh although we do have plans to also uh provide a UI that integrates with the Lakehouse UI kind of provide you a similar experience to what you currently get with the Lakehouse Connect for database CDC or SaaS systems.
All right. So, uh kind of what are some of the tasks that are being managed by the connector? Uh we automate the volume provisioning by utilizing Databricks' default storage. So, it means that there's zero steps about configuration, including configuration of managed file batches that Sundip talked about. Just comes out of the box. We also take over the optimization of the file and directory layout so that you achieve the best performance.
Uh we the connector is represented as a as a Delta Live Table pipeline, which offers a declarative syntax of just specifying, "These are the tables that I want to ingest." And uh you don't have to worry about too much about Auto Loader options. It The experience will will be very similar to what the you kind of get the experience right now with the CDC connector or the SaaS connector for Lakehouse Connect. Uh all of that is powered by Databricks' serverless uh platform.
Again, to minimize the number of knobs that you have to turn to get going. We also manage the Auto Loader configuration and incorporate the best practices. We support all existing file formats, and this is really probably the only mandatory option that you have to do for Auto Loader, which is specifying what is the file format of the files to be ingested, and potentially customize the parsing logic. I already talked about the two APIs.
One is for managing the uh ingestion pipeline, configuring and managing the ingestion pipeline. The other The other one is for pushing the file data to tables. Uh and the push API is going to support both uh at least once and also exactly once semantics at the file level. Continuous operations. This is probably one of the areas that I'm most excited about this connector. Uh historically, Auto Loader has been very flexible and very powerful.
And I think that's hopefully that's why you all use it, but it's also that comes at a cost. It's not easy to configure and operate. Uh if you kind of have to figure out what are my operational work workflows and how to run Auto Loader in production. Uh with the managed connector, because we are going to be responsible for Auto Loader configuration, uh we have the provide we have the ability to provide you a more seamless, more out-of-the-box experience for operating uh Auto Loader.
Uh so, we are going to incorporate like you get as I mentioned out-of-the-box observability, uh schema management, data quality management, uh retention management. So, to just give you a flavor, uh traditional autoloader, you can specify the schema evolution mode. Uh we want to with the managed connector, we want to look at the whole journey. Starting from notification when the schema changes expectedly or unexpectedly.
Then, uh be able to triage why the schema change. Then, being able to take action, whether changing the schema manually, whether trying to use some of the data from the rescue data column. We want to look at the whole journey and hopefully automate it and make it a lot easier for you. And here is kind of one of the places I really like to ask for feedback from you uh to kind of understand how do you use autoloader in production?
Right now, what are your best practices? Are they effective? Are there any areas and challenges? So, uh areas for improvement and challenges. Uh we would like to hear which parts you would like to see automated versus where you'd like to kind of retain manual control. So, please please come talk to us and share your thoughts. And of course, uh last but not least, uh performance tuning. Uh as as I mentioned already, uh we automatically configure managed file events to kind of get the best file discovery uh performance.
And we also want to automate and make make the managed file connector work and provide good performance out of the box with minimal uh getting no configuration knobs. Uh of course, if if you have a challenging workload that requires careful manual tuning then probably the base auto loader still your your best choice. We don't want to promise that we're going to solve all the performance problems magically. All right, that concludes the structured part part of the presentation.
Uh and we want to open up for uh questions and answers. Uh please use the microphones because we're recording, so uh we want to make sure that all the questions are heard. Thank you. Thank you so much.
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.