Latest / The Data Flowcast: Mastering Apache Airflow ® for Data Engineering and AI / Scaling to 1,000+ Airflow Dags at Descartes / Idelic
Transcript
- 0:28SPEAKER_02: Just go to astronomer.org slash airflow minus survey minus twenty twenty-six or click the link in our show notes.
- 0:35SPEAKER_02: Now let's get into the show.
- 0:38SPEAKER_00: Okay, hi everyone.
- 0:39SPEAKER_00: Welcome to the Data Flowcast.
- 0:40SPEAKER_00: I'm your host, Kenton Danis, and today I'm joined by Matt Stavinga, who is a data engineer at Idelic, which is now a part of Descartes.
- 0:48SPEAKER_00: Matt, how are you doing?
- 0:50SPEAKER_01: Yeah, I'm doing really good.
- 0:51SPEAKER_01: Uh how are you doing today?
- 0:52SPEAKER_00: I'm good.
- 0:53SPEAKER_00: It's great to have you on and to see you again.
- 0:56SPEAKER_00: We met in person.
- 0:58SPEAKER_00: It was this week at the time we're recording.
- 1:00SPEAKER_00: We'll have been many weeks ago by the time this is published, but at Airflow Summit.
- 1:04SPEAKER_00: So that was great.
- 1:06SPEAKER_00: And yeah, I'm excited to dive in.
- 1:09SPEAKER_00: For our listeners for today's podcast, we're going to discuss how idelic scaled to over a thousand Airflow DAGs and how they're enabling customers to run pipelines on their own.
- 1:18SPEAKER_00: So definitely a popular topic, scaling Airflow.
- 1:21SPEAKER_00: We always love to dig into this.
- 1:23SPEAKER_00: But before we get into that, maybe let's start with some backgrounds.
- 1:27SPEAKER_00: So tell me about what idelic does and I guess your parent company now, Descartes.
- 1:31SPEAKER_01: Yeah, uh, so Descartes Systems Group is a global company focusing on logistics and supply chain management software.
- 1:38SPEAKER_01: Uh so Descartes acquired Idelic um a few months ago, uh, so probably uh first end of first quarter or so of this year.
- 1:48SPEAKER_01: Um, Idelic was a startup based out of Pittsburgh.
- 1:52SPEAKER_01: Um it was founded around 2016.
- 1:55SPEAKER_01: Our product is called Safety Suite, and what we do is we collect data uh relating to trucking fleets in North America and then use that data to feed our machine learning algorithms to predict risk-feed drivers so that fleets can uh take some action uh in the form of normally like trainings and stuff to hopefully prevent these drivers from getting into accidents.
- 2:15SPEAKER_00: Yeah, that's great.
- 2:17SPEAKER_00: I uh so I'm based in Seattle.
- 2:19SPEAKER_00: I do a lot of road tripping.
- 2:21SPEAKER_00: It's one of my favorite things.
- 2:22SPEAKER_00: I often spend a good chunk of the winter in Colorado.
- 2:25SPEAKER_00: So I drive from Seattle all the way to Colorado all the time.
- 2:27SPEAKER_00: And you see a lot of yeah, delivery like long haul trucks on those like remote highways.
- 2:35SPEAKER_00: So it's great.
- 2:36SPEAKER_00: I I love to hear that there are companies behind making them safer.
- 2:40SPEAKER_01: Yeah, that's uh that's our goal.
- 2:42SPEAKER_00: Yeah, really cool.
- 2:44SPEAKER_00: And so what does your team do?
- 2:46SPEAKER_01: Yeah, so I'm part of the uh data engineering team.
- 2:49SPEAKER_01: Uh so what we do is we actually work with these fleets uh to try to gather their data and put it into our system.
- 2:55SPEAKER_01: So we do collect it for safety reasons, but we also uh try to just gather as much of their uh data as possible just to kind of put it into like a single pane of glass.
- 3:06SPEAKER_01: So they basically have to log in Safety Suite and they can see all of the data that they have.
- 3:10SPEAKER_01: So they don't have to log into four or five different systems to see that.
- 3:13SPEAKER_01: Um, so we will connect with uh 30-party API endpoints, uh, pick up spreadsheets that customers send to us either through SFTP or they can email us as well.
- 3:25SPEAKER_01: Uh, and basically we do whatever we can to pull that data into our system.
- 3:30SPEAKER_00: Okay, great.
- 3:31SPEAKER_00: And tell me about where Airflow fits into that picture.
- 3:35SPEAKER_01: Yeah, so uh we use the Astronomer uh version of Airflow, and uh basically uh we use it as the job orchestrator, so it kind of organizes these pipelines.
- 3:45SPEAKER_01: Um so every um customer uh integration kind of combination is like a different bag for us.
- 3:53SPEAKER_01: So um it kind of adds up pretty quickly, as you can probably kind of imagine.
- 3:58SPEAKER_01: You continue to sign uh new fleets with six or seven partners, uh, and then we basically add those to uh to our um the environment.
- 4:07SPEAKER_00: So okay.
- 4:08SPEAKER_00: Yeah, I can definitely see where that would grow a lot, and we'll touch on that.
- 4:13SPEAKER_00: I guess before we get into the scaling piece, uh you mentioned collecting data from a lot of different vendors and that you're taking um, you know, everything for all of your customers and pulling it into a central system.
- 4:27SPEAKER_00: Can you tell me a little bit more about what that looks like, you know, on the technical side with Airflow?
- 4:32SPEAKER_00: Sure.
- 4:32SPEAKER_01: Yeah, uh it's basically a lot of working uh with the customers directly.
- 4:38SPEAKER_01: So trying to figure out like where their data is stored and just trying to figure out ways of getting that data to us.
- 4:45SPEAKER_01: Um so with Airflow, that's just gonna be like uh extract tasks.
- 4:50SPEAKER_01: Uh so we run Python scripts um basically just to pull that data in.
- 4:56SPEAKER_01: So uh I mentioned uh third-party APIs uh and SFTP and email, but uh we do other ways that are a little bit more um unique, I guess.
- 5:07SPEAKER_01: So we do screen scrape some websites that don't natively provide uh exporting reports, uh stuff like that.
- 5:16SPEAKER_01: Um we've even you know installed some like agents or executables on customers' uh servers that basically just run on a schedule and just query their database and send that data to us um through SFTP and stuff.
- 5:32SPEAKER_01: So uh it's uh it's it's really it's fun figuring that out, but luckily we're we're kind of through a lot of the the harder uh integrations, I think.
- 5:40SPEAKER_01: Uh and mostly it's just uh like enabling these customers on what we've already built.
- 5:44SPEAKER_00: Okay, interesting.
- 5:46SPEAKER_00: It's always kind of wild to me to encounter platforms that don't have data export functionality or an API.
- 5:54SPEAKER_00: I just encountered one of these myself uh on our side a couple of weeks ago and was like, what do you mean you don't have an API?
- 6:02SPEAKER_00: That seems crazy, but yeah, at least at least you're able to manage that with airflow.
- 6:09SPEAKER_00: And yeah, so I would love to dig into the scaling piece.
- 6:13SPEAKER_00: So you've talked about how you know you're getting data from all of these different systems and for all of these customers and having kind of a DAG for each one of them, or maybe multiple DAGs.
- 6:23SPEAKER_00: Uh, and that kind of quickly blows up.
- 6:27SPEAKER_00: And so I mentioned at the beginning you've talked about how you went through this period of scaling to now over a thousand active DAGs, which is quite a lot.
- 6:35SPEAKER_00: Tell me about kind of how that happened and you know what what issues you encountered as the number of DAGs has gone up.
- 6:46SPEAKER_01: Yeah, it it kind of happened uh fairly gradually.
- 6:51SPEAKER_01: Um, we, you know, as part of a startup, your goal is to get essentially as many customers as you can in a quick amount of time so you can get some funds to move on to the next uh you know round of funding.
- 7:03SPEAKER_01: Um so that kind of just kept going and going for a little bit, and we were building uh kind of custom uh pipelines and stuff.
- 7:13SPEAKER_01: So it just kind of got out of hand for a little bit.
- 7:16SPEAKER_01: Um so uh just being able to keep track of these DAGs ended up being a little bit challenging.
- 7:24SPEAKER_01: Uh we are a small team.
- 7:25SPEAKER_01: Um we only have like three or four data engineers at a time.
- 7:30SPEAKER_01: Um, I think the whole company or the idyllic team is are sitting around 20 or 30 people at this point.
- 7:36SPEAKER_01: So we're a pretty small team.
- 7:38SPEAKER_01: Um yeah, we just could it was a little tough to kind of keep up with that volume.
- 7:45SPEAKER_01: Um and naturally during a sales cycle, like sales will slow down and they'll get they'll speed up at a certain point, just depending on you know, funds available for fleets.
- 7:55SPEAKER_01: Um, so during those down periods, it was kind of where we kind of looked back at our product and decided, you know, we need to scale this better.
- 8:03SPEAKER_01: We need to do a better job of making this so we don't have to spend as much energy on each uh pipeline uh as we have in the past.
- 8:11SPEAKER_01: So um that's kind of how we got to where we are today.
- 8:15SPEAKER_01: Uh we re we kind of you know grew a lot and then we kind of look back at at what we had and just kind of improved on that.
- 8:23SPEAKER_01: Um yeah.
- 8:24SPEAKER_00: Yeah, definitely.
- 8:25SPEAKER_00: That makes sense.
- 8:26SPEAKER_00: And I guess uh to clarify, so you mentioned earlier, you're running on Astro, Astronomers Managed Airflow platform, which often helps small teams with scaling, but you're also talking about this aspect of simply just managing that number of DAGs.
- 8:42SPEAKER_00: You imagine making sure that they're all running when they should and on time and also creating them.
- 8:48SPEAKER_00: Uh she said you, you know, I assume they can't all be the same if sometimes you're dealing with web scraping and sometimes you're just you know grabbing something from a database.
- 8:58SPEAKER_00: So maybe tell me about the creating DAGs aspect of it, because I think if I remember correctly, you mentioned that you have built some sort of standardized framework, but also you have these different types of you know problems that you have to solve within the DAG.
- 9:14SPEAKER_00: So, what does that look like?
- 9:16SPEAKER_01: Yeah, so um a big a kind of a problem that we had just kind of managing those in general was uh observability of that, like you mentioned.
- 9:25SPEAKER_01: Um, so we had a lot of DAGs, but we didn't really standardize how we logged anything.
- 9:30SPEAKER_01: So each each uh pipeline.
- 9:32SPEAKER_01: So if we had a vendor that had you know 30 customers on it, they would kind of all be kind of standardized for that pipeline, but it couldn't, we couldn't really compare that to another uh vendor or something like that.
- 9:44SPEAKER_01: So um one of the things that we did was standardizing our framework, and um that basically uh was building some like abstract methods that just kind of act as wrappers around some of the air common airflow functions.
- 9:58SPEAKER_01: Uh these functions would generate like task groups uh for each phase of the ETL uh process.
- 10:04SPEAKER_01: So um before when we would build DAGs, we'd have to build you know the extract task, the maybe data quality checks, uh, the transform, build the load, we'd have to build the dependencies into the DAG file, uh kind of stuff like that.
- 10:19SPEAKER_01: And and now it's basically like, oh, we get a new vendor, um, we already have this standardized framework, and you know, uh we could potentially just enable them on an extraction method that we've already kind of encountered uh through uh config, configuration.
- 10:36SPEAKER_01: Um and maybe we have to write a custom transformer.
- 10:39SPEAKER_01: Most of the time we have to write custom transformers just because the nature of the data between vendors is a lot different, um, even though they have kind of similar uh data sets.
- 10:49SPEAKER_01: Um so now it's kind of just writing a couple custom things potentially and then just building it into the actual framework that we have built in.
- 10:58SPEAKER_01: Uh that kind of takes care of all the logging as well.
- 11:01SPEAKER_01: So everything is kind of standardized how we log now.
- 11:04SPEAKER_01: Um so now we can kind of see everything, um, you know, compare them across different integrations as well for the same types of data.
- 11:14SPEAKER_00: Got it.
- 11:15SPEAKER_00: So I if I'm understanding you correctly, this is both, you know, reduce the amount of code that you have to write.
- 11:21SPEAKER_00: So made the process a little more repeatable, minus the parts that need to be customized per customer, and also standardize the logging aspect so that you know what to expect out of each one of them.
- 11:34SPEAKER_01: Yeah, that's exactly right.
- 11:35SPEAKER_01: Yeah.
- 11:35SPEAKER_00: Got it.
- 11:36SPEAKER_00: Yeah, that seems like it would be very beneficial for such a small team.
- 11:40SPEAKER_01: For sure.
- 11:41SPEAKER_01: Yeah, I wish we did it a long time ago.
- 11:44SPEAKER_00: As is always the case with these sorts of projects, right?
- 11:48SPEAKER_00: Yeah.
- 11:49SPEAKER_00: And then I'm curious how you're also handling like the CI CD aspect of it.
- 11:55SPEAKER_00: So you mentioned that observability is really important, and you know, the testing aspect is part of why you wanted to standardize things.
- 12:02SPEAKER_00: What does that look like for you?
- 12:04SPEAKER_01: Yeah, so we um pretty much our entire CI CD process is uh is kind of connected to a Jenkins uh setup.
- 12:12SPEAKER_01: Um, so um I think this is a kind of a fairly standard uh setup where we have a production environment and a staging environment.
- 12:22SPEAKER_01: Um production is obviously production level data.
- 12:24SPEAKER_01: Staging is kind of where you do some QA or checks before you push it into production to make sure everything's correct.
- 12:30SPEAKER_01: Um but we also have uh a kind of a unique setup for our testing environments uh with uh a couple you know developers that you know potentially are sharing code or um you know making changes pretty quickly.
- 12:45SPEAKER_01: Uh, we needed a way to basically um isolate uh new uh like airflow environments with changed code.
- 12:52SPEAKER_01: Um so we have our you know you can run airflow locally to test like kind of locally, but then we're we don't want to mix all that into the staging environment and until it's kind of fully QA'd by uh another person.
- 13:04SPEAKER_01: Um so we have automated testing deployments that we can spin up for each PR that we can open up.
- 13:11SPEAKER_01: And we actually have like our QA team uh is able to enable these as well and spin these in testing environments up as well.
- 13:18SPEAKER_01: Uh, because we have a JIRA hook that basically is just like a almost like a link and a couple config parameters that you plug it in there, and then it'll automatically create it.
- 13:26SPEAKER_01: So if they're not ready to QA a specific code change uh for a few days, that instead of having a testing deployment just sitting there, not really doing anything, taking up space, they can go in there and say, Okay, I'm ready, let me just spin this up real quick, test everything I need to test, and then they can spin it down as well.
- 13:43SPEAKER_00: So yeah, that sounds very streamlined.
- 13:47SPEAKER_01: Yeah, it's pretty cool.
- 13:50SPEAKER_02: This episode is brought to you by Astronomer, the team behind Astro, a managed airflow platform built for data engineering teams.
- 13:59SPEAKER_02: From batch pipelines to training models and wiring up agents.
- 14:10SPEAKER_02: Check it out at astronomer.io.
- 14:14SPEAKER_00: Awesome.
- 14:15SPEAKER_00: Well, I also want to touch on uh something that or a slightly different topic.
- 14:20SPEAKER_00: I guess you mentioned that you are now working on letting customers create and enable their own DAGs.
- 14:28SPEAKER_00: Uh so what does how does that work?
- 14:31SPEAKER_01: Yeah, so this is kind of an initiative that has kind of been in our minds for a few years, but we really never had the time or the resources to do so uh until kind of recently, a few months ago, we started kind of tackling this subject.
- 14:45SPEAKER_01: Uh, but in our platform safety suite, we essentially have a section that uh admins will be able to kind of work through a wizard uh to correctly fill out like configurations for specific vendors.
- 14:56SPEAKER_01: So they would essentially fill the configuration out.
- 14:59SPEAKER_01: That would create the when they submit it, that would create a DAG in Airflow.
- 15:03SPEAKER_01: Um, and then uh that's kind of where we're at today, but um, we would also want to build in uh functionalities to where the customer can now seeing their their DAG or job, uh, they can trigger that uh from our UI as well.
- 15:18SPEAKER_01: Um then what they would actually do is review some results in in our platform, just kind of see what the results of the job was.
- 15:26SPEAKER_01: You know, if we if a lot of our um vendors, they have a lot of events that customers don't really like to see in our platform.
- 15:33SPEAKER_01: It doesn't really provide a ton of information because we're just getting fed a ton of information from uh these trucks.
- 15:40SPEAKER_01: So a lot of it is not super relevant to like what we need.
- 15:43SPEAKER_01: Uh so they have different filters that they can set up so that they don't even we don't even pull it into our system, they don't see it.
- 15:49SPEAKER_01: Um so what they can do is they can review those lists of what was what was uh filtered out or what was errored out.
- 15:56SPEAKER_01: Maybe they have another they don't have all their employees in our system yet and they didn't realize.
- 16:01SPEAKER_01: Um so they can review all that and then um eventually we will build in human of the loop into that as well, so they can review it, take a look at it, approve it, or deny it, and then that that'll be kind of like a check and balances so they can uh get it into our system or or they can go back and update the config as well.
- 16:19SPEAKER_00: Cool.
- 16:19SPEAKER_00: And so the end user is only interacting with this through your platform.
- 16:26SPEAKER_00: So Airflow is just acting as the back end that makes everything happen.
- 16:31SPEAKER_00: Pretty much, yeah.
- 16:32SPEAKER_00: Yeah, cool.
- 16:34SPEAKER_00: And how have you set that up using Airflow?
- 16:40SPEAKER_00: Like, are you using the Airflow API on the back end and DAGs are being triggered based on what the user requests on your platform?
- 16:50SPEAKER_01: Yeah, so we can generate DAGs through configuration through our internal configuration uh service that we have.
- 16:57SPEAKER_01: Um, so that kind of just kind of creates the DAG, and then we would use the Airflow API uh to trigger that DAG as well.
- 17:06SPEAKER_01: Um, but we also kind of um created like a database um on our end that would basically we push data from our DAG runs into this database to kind of pull like the job run information.
- 17:20SPEAKER_01: Um we started looking at the Airflow API, like the logs API to kind of pull all that as well.
- 17:27SPEAKER_01: Um, but it it kind of was a it was an over information, I would say, and we'd have to like do a lot of uh string matching.
- 17:35SPEAKER_01: And um, we didn't love the format that it came in, so we decided, you know, let's just push it to our own database in a format that works well for our UI.
- 17:44SPEAKER_01: Um so that's the kind of the aspect that we're working on right now is getting that database um uh fully functioning and built into our pipelines so that we could do that.
- 17:54SPEAKER_00: So okay, interesting.
- 17:57SPEAKER_00: And you mentioned that you may end up building some human in the loop into this as well.
- 18:02SPEAKER_00: Tell me more about how that would work.
- 18:05SPEAKER_01: Yeah, so that's kind of just um I believe that's uh an API endpoint as well.
- 18:10SPEAKER_01: And I'll be honest, I haven't I haven't worked too much on that part of it.
- 18:14SPEAKER_01: Um, but we uh we do have it built into our DAGs uh where it's just a configuration essentially.
- 18:21SPEAKER_01: Um uh said basically you would just um mark that you know this DAG is uh do not load or so.
- 18:30SPEAKER_01: Um and then once the um customer goes through, they can, you know, that would trigger the human in the loop, which is already kind of hooked up to our load or to our safety suite uh backend.
- 18:42SPEAKER_01: Um so uh again, not fully flushed out yet, but uh essentially we would have the initial setup, it would automatically uh turn on as you know, human loop turned on.
- 18:55SPEAKER_01: Uh that would trigger uh like a response on the UI for the customer to review their their data and then hit approve, and then that would send an API request um to um from the DAG run.
- 19:07SPEAKER_01: So we would have that information uh that we would need to send back to the Airflow API.
- 19:12SPEAKER_00: Got it.
- 19:13SPEAKER_00: So mostly to implement the functionality of if the end user needed to change some of the data that they were seeing or something like that.
- 19:20SPEAKER_01: Yeah, and that's that's we our design is to hopefully only do that on a first run.
- 19:25SPEAKER_01: Um it's more the first runs are usually like uh let's load 60, 90 days of historical data into our platform.
- 19:32SPEAKER_01: And then the the further runs are only you know a couple days of look back just to catch any glitches or anything like that or changes to the data in the source system.
- 19:42SPEAKER_00: Okay, got it.
- 19:43SPEAKER_00: Yeah, that's really cool.
- 19:44SPEAKER_00: I feel like I'm hearing more and more about people using Airflow as the back end for actual user-facing applications as opposed to just kind of data orchestration.
- 19:55SPEAKER_00: So yeah, that's really neat to hear about.
- 19:58SPEAKER_01: Yeah, we're excited to get that uh that rolled out.
- 20:01SPEAKER_00: So yeah, definitely.
- 20:03SPEAKER_00: I would love to check in, you know, a year from now or something, see how that's going for you.
- 20:09SPEAKER_00: Uh, but I think that's a good tie-in, maybe to my standard final question that I ask all my guests is what would you most like to see from the Airflow project in the near future?
- 20:19SPEAKER_01: Yeah, uh there's a couple things I think that we that we had.
- 20:23SPEAKER_01: Uh, one, um we would love to see some sort of like trend tracking at like a task or a DAG level, uh, just so we can kind of see, you know, one example would be like how long it takes to run a particular task on a day-to-day basis or a run-to-run basis, I should say.
- 20:40SPEAKER_01: Um, or the same thing with the at the DAG level as well.
- 20:43SPEAKER_01: I think that would be really cool.
- 20:45SPEAKER_01: Um, and then another thing uh we've talked about is um at the Airflow conference, I heard a lot about auto and using auto in a self-healing DAG process.
- 20:54SPEAKER_01: So nothing's particular with that, just more of I'd love to hear more information and and you know keep up to date with the progress on that.
- 21:02SPEAKER_00: Yeah, definitely.
- 21:03SPEAKER_00: I think I don't know about an open source airflow, but on the task level metrics, that is something that Astronomer has started to roll out.
- 21:10SPEAKER_00: Uh it's one of our most like requested features ever.
- 21:14SPEAKER_00: Uh, people are really excited about it, especially for the like resource consumption.
- 21:18SPEAKER_00: I think that can be really helpful for people to see.
- 21:20SPEAKER_00: Yeah, that'd be cool.
- 21:22SPEAKER_00: Task by task basis instead of just the DAGs.
- 21:25SPEAKER_00: And then yeah, auto, as you mentioned, is Astronomer's data engineering agent uh that's been trained on all of the airflow stuff.
- 21:34SPEAKER_00: So it is definitely pretty helpful in debugging.
- 21:36SPEAKER_00: I use it for debugging my own DAGs that are running to support my team.
- 21:40SPEAKER_00: And I've been like pretty impressed with how quick it is, where things that I probably would have taken a long time to figure out.
- 21:49SPEAKER_00: It just is like, oh, this is the issue.
- 21:51SPEAKER_00: Here's a PR.
- 21:52SPEAKER_00: And I'm like, oh great.
- 21:53SPEAKER_00: I don't even need to understand what the issue is.
- 21:56SPEAKER_00: Uh so yeah, uh yeah, definitely.
- 22:00SPEAKER_00: And that's available um in our CLI as well for folks who are not customers yet.
- 22:06SPEAKER_00: Um, if you start a trial for anybody listening.
- 22:09SPEAKER_00: So yeah, those are those are great answers.
- 22:12SPEAKER_00: Uh well, Matt, thanks so much for coming on.
- 22:15SPEAKER_00: It's been really great speaking with you and learning more about your use case.
- 22:18SPEAKER_00: Uh just to close out, what is the best way for folks to get in touch with you?
- 22:22SPEAKER_01: Yeah, thanks for having me.
- 22:24SPEAKER_01: Um, yeah, if anyone wants to reach out, uh I'm on LinkedIn, so uh just my first and last name.
- 22:29SPEAKER_01: Um I'd love to hear if uh people are interested and you know keep up with everything.
- 22:34SPEAKER_01: So thank you.
- 22:34SPEAKER_00: Yeah, absolutely.
- 22:35SPEAKER_00: We'll throw a link to that in the show notes.
- 22:37SPEAKER_00: Well, thank you again.
- 22:38SPEAKER_00: It's been really great chatting with you.
- 22:40SPEAKER_01: All right, thank you.
- 22:41SPEAKER_02: Thank you for listening to the Data Flowcast.
- 22:44SPEAKER_02: Check the show notes for links to everything mentioned today.
- 22:48SPEAKER_02: If you're enjoying the podcast, subscribe so you never miss an episode.
- 22:53SPEAKER_02: And it's a five-star review.