Latest / Talk Python To Me / #365: Solving Negative Engineering Problems with Prefect
Transcript
- 0:00How much time do you spend solving negative engineering problems?
- 0:03And can a framework solve them for you?
- 0:05Think of negative engineering as things you do to avoid bad outcomes in software.
- 0:09At the lowest level, this can be writing good error handling with try-accept.
- 0:13But it's broader than that.
- 0:15Logging, observability, like with Sentry Tools, retries, failovers,
- 0:20as in what you might get from Kubernetes, and so on.
- 0:23We have a great chat with Chris White about Prefect,
- 0:26a tool for data engineers and data scientists, meaning to solve these problems automatically.
- 0:31It's also a conversation I think is applicable to the broader software development community as well.
- 0:36This is Talk Python To Me, episode 365, recorded May 9th, 2022.
- 0:55Welcome to Talk Python To Me, a weekly podcast on Python.
- 0:58This is your host, Michael Kennedy.
- 1:00Follow me on Twitter, where I'm @mkennedy,
- 1:02and keep up with the show and listen to past episodes at talkpython.fm.
- 1:06And follow the show on Twitter via at Talk Python.
- 1:09We've started streaming most of our episodes live on YouTube.
- 1:13Subscribe to our YouTube channel over at talkpython.fm/youtube
- 1:17to get notified about upcoming shows and be part of that episode.
- 1:21This episode is sponsored by Microsoft for Startups Founders Hub.
- 1:25Check them out at talkpython.fm/founders hub to get early support for your startup.
- 1:31And it's brought to you by us over at Talk Python Training.
- 1:34Did you know we have one of the largest course libraries for Python courses?
- 1:39They're all available without a subscription.
- 1:41So check it out over at talkpython.fm.
- 1:44Just click on courses.
- 1:47Transcripts for this and all of our episodes are brought to you by Assembly AI.
- 1:50Do you need a great automatic speech-to-text API?
- 1:53Get human-level accuracy in just a few lines of code.
- 1:56Visit talkpython.fm/assemblyai.
- 1:58Chris, welcome to Talk Python To Me.
- 2:01Yeah, thanks for having me.
- 2:02Happy to be here.
- 2:03I'm happy to have you here.
- 2:04It's going to be a lot of fun.
- 2:05We're going to talk a lot of data engineering things.
- 2:08Try to loop that back to the more traditional software development side.
- 2:12You have a really cool open source project and startup in Prefect.
- 2:16And we're both going to talk about the product as well as, you know, making an open source successful business model, which is really cool.
- 2:24Yeah.
- 2:24I'm very into that and very, you know, that's very important to me.
- 2:27And I love to highlight cases of people doing that.
- 2:29Well, it looks like you all are.
- 2:30Yeah, excellent.
- 2:31Yeah.
- 2:31It's a, as we'll see as we get into it, it's a core part of how we view the world.
- 2:35Yeah, that's awesome.
- 2:36Before we get to all that, though, let's start with your story.
- 2:38How'd you get into programming in Python?
- 2:40So I think like a lot of, so I was born in the 80s.
- 2:44I feel like a lot of people in my generation, right?
- 2:46We got into HTML and building websites on AngelFire and GeoCities.
- 2:50So, you know, from the early days, I was into playing around with computers.
- 2:54I would say didn't really get into Python until probably high school is when I first started dabbling.
- 3:03And it was really just, I was working at a bank.
- 3:06I was like trying to automate some small things.
- 3:08And to be clear, I did not get very far.
- 3:11It was a mildly successful undertaking.
- 3:14And then college, kind of similar story.
- 3:16Like it was one of those things that I just would, I had a couple of books.
- 3:19I would play around with it.
- 3:20It was always just a fun activity for me, but I never had any serious focus on it.
- 3:25I think in college, when it started to get into really econometrics, it's when I started to play more seriously and start to try to understand some of the performance implications of what I was doing and things like that.
- 3:37And then taking kind of the next level in grad school, a friend of mine and myself thought that we were smart enough to build some machine learning models for trading.
- 3:47And we did all of that in combination of Python and Otter.
- 3:50Surprise.
- 3:51Okay.
- 3:51That's amazing.
- 3:52Yeah.
- 3:53Lost some money.
- 3:54But it was a great lesson in understanding data and exactly what you're doing.
- 4:00And genuinely, so I was studying pure math in grad school.
- 4:04And that experiment and kind of the actual like visceral outcome of it is what really got me into studying machine learning more deeply.
- 4:12Because I was like, wait a second, there's something interesting here.
- 4:14And so I started to dig in more.
- 4:16That must have been a really cool experience.
- 4:18Even if you did lose money.
- 4:19It's important to put some skin in the game.
- 4:21Exactly.
- 4:22Right.
- 4:22Like it's a hobby until you start to take it seriously and try to get real outcomes.
- 4:27Because there's always these layers of these levels, right?
- 4:30Like I'm going to learn this thing and poke around and kind of get it to work.
- 4:34Or I'm going to learn this thing so that it actually works.
- 4:37Or I'm going to learn this thing so I can explain it when there's three ways.
- 4:41They all kind of do the same thing.
- 4:42I can explain when to choose which one, right?
- 4:45And the more seriously you take it and the more is on the line, the more you kind of, you get that real understanding of it.
- 4:50I mean, this is a little off of Python, but I think that resonates with me so much on every dimension when it comes to learning something.
- 4:57You have to, it's not a passive activity.
- 5:00You have to engage with it.
- 5:01Right.
- 5:02And it's in my opinion, the only way to learn anything.
- 5:03Math, programming, business, whatever.
- 5:06Totally agree.
- 5:06Speaking of math, you have a math background, right?
- 5:09I do.
- 5:10Proudly so, yes.
- 5:11Yeah, awesome.
- 5:12Yeah.
- 5:12So do I.
- 5:12I just last episode spoke with the SymPy, S-Y-M-Py guys, about doing symbolic math with Python.
- 5:20And that was pretty fascinating stuff.
- 5:23Have you played with any of the symbolic stuff?
- 5:25I have played with it, yeah.
- 5:26I had no serious project.
- 5:28Like genuinely just playing around with it to see kind of what it's capable of.
- 5:31It is really cool.
- 5:33I would definitely go look up that episode, yeah.
- 5:35Awesome.
- 5:36What kind of math did you study?
- 5:37So I started my PhD program focusing on arithmetic geometry, which for people out there, it's one of the more abstract forms of math.
- 5:46I still really like that stuff a lot, honestly.
- 5:48But what I found was that-
- 5:51Is it like manifolds and stuff like that?
- 5:53Not quite.
- 5:55It's a little bit-
- 5:56So they use a lot of the same-
- 5:58A lot of their arguments are kind of by analogy with things like manifolds.
- 6:02But you're studying geometric structures that are way more discrete than a manifold.
- 6:08And so like the spectrum of prime numbers on the integers is like a geometric object for the purposes of arithmetic geometry.
- 6:16Wow.
- 6:17Okay.
- 6:17Hard to visualize, but it just turns out a lot of the formal definitions of geometry have these really deep analogs and arithmetic.
- 6:24And you can actually learn a lot.
- 6:26And the most famous example of this that I think a lot of people will probably be familiar with is Fermat's last theorem.
- 6:31Yeah, that's right.
- 6:32So that was all arithmetic geometry.
- 6:34It was all using some of those techniques.
- 6:35Yeah, that's right.
- 6:36So they're really heavy duty to solve very simple two-state problems.
- 6:39There was a really good book about Fermat's last theorem by this guy named, something like Amol or something like that.
- 6:49Maybe you'll find it for the show notes.
- 6:50It's just absolutely fascinating book.
- 6:52Oh, that's awesome.
- 6:53It just talks about the struggle that guy-
- 6:54Yeah, yeah.
- 6:55It really talks about the struggle that guy who solved it went through.
- 6:58Cool.
- 6:58Well, how about now?
- 7:00You're at Prefect, right?
- 7:01What do you do day to day?
- 7:02I didn't finish where I went with grad school, which is relevant to how I got to Prefect, which I ended up going into optimization theory, still on the pure side.
- 7:10So still very much proof-based.
- 7:11But that was right when machine learning was becoming a thing, right after I had done this experiment with my friend and started getting into it.
- 7:17And so that's kind of how I started to head more towards industry.
- 7:22And for me, I consider myself a problem solver.
- 7:24And so I was always very good at solving problems.
- 7:27But I'll admit, I wasn't always the best at maybe justifying a grant proposal or something like that.
- 7:32And so that's kind of when I started to think more about industry and started doing some consulting and test the waters.
- 7:38And so anyways, long story short, got into data, got into machine learning, got into tooling for machine learning, got into backend engineering for hosting the tooling, et cetera, et cetera.
- 7:50And then met with Jeremiah, who's the CEO of Prefect.
- 7:52Yeah.
- 7:53Just sucks you in, right?
- 7:55Exactly.
- 7:55It's a black hole.
- 7:56Yeah.
- 7:57Yeah.
- 7:57Yeah, cool.
- 7:58So you started out working at banks doing sort of homegrown data engineering, right?
- 8:06Is that maybe a good way to describe it?
- 8:08Homegrown a lot of things, yes.
- 8:10So homegrown data engineering, one of them.
- 8:12Homegrown model building was another big, big thing.
- 8:15Homegrown data governance at one point.
- 8:18Homegrown data platform.
- 8:20And actually, the data platform was particularly interesting because looking back, it kind of felt like a microcosm of a lot of the,
- 8:27the tool explosion we've seen lately.
- 8:28Where the platform we were building was for data scientists to deploy their model to and connect it up to data sources that, you know, we would keep up to date.
- 8:36And so that's where the data engineering comes in.
- 8:38And then business analysts are the actual downstream users.
- 8:41And they would interact with these models through an API that we would build for them on top of the models.
- 8:45It was still in Python.
- 8:47So they would actually have to write Python, which was really interesting.
- 8:51So you got to teach them classes on it.
- 8:53That is interesting.
- 8:53Yeah.
- 8:55Yeah.
- 8:55I've seen, you know, non-developer types do that before.
- 8:58I've seen it in like real-time stock trading, you know, like brokerages and hedge funds.
- 9:03Right.
- 9:04And yeah, it's, you're going to learn Python because you need to talk to the tool.
- 9:08I've also seen people learn SQL who have no business knowing SQL otherwise, but for sort of a similar reason.
- 9:13Yeah.
- 9:13Yeah.
- 9:14And SQL is a little bit more approachable, I think.
- 9:16Yeah.
- 9:16But Python, Python is just a little, it's easier to kind of shoot yourself in the foot with Python, I think, if you don't really know it well.
- 9:22It's just more open-ended, right?
- 9:24It's just, it's way more open-ended.
- 9:26Cool.
- 9:26All right.
- 9:27So you talk a lot about negative engineering concepts and how you've structured Prefect to help alleviate, eliminate, solve, prevent some of those problems.
- 9:39So maybe we should start the conversation and sort of twofold, like maybe give us a quick overview of what you might call data engineering.
- 9:47And then what are these negative engineering things that live in that space?
- 9:51So, yeah, and I think these two concepts are related, but also, but I think negative engineering is definitely more general.
- 9:55So for, well, let me start with negative engineering and then we'll kind of, kind of drill in.
- 9:59Yeah.
- 9:59So negative engineering, we've got a blog post that we published, I think three years ago at this point on negative engineering.
- 10:06Encourage anyone who's interested, go read it.
- 10:08I think since we have released that blog post, we have refined kind of our own understanding and thinking about this.
- 10:14And one thing that I kind of noticed is negative engineering got this sentiment, like it's just anything I don't really like to do.
- 10:20And that's not accurate.
- 10:22There's a lot of things.
- 10:22Those are negative engineering.
- 10:23I'll tell you what.
- 10:24Yeah, exactly.
- 10:25Got nothing done in those meetings.
- 10:26Yeah.
- 10:26Exactly.
- 10:26And like, I don't think so.
- 10:28And so, yeah, to be really precise with the way we think about this, positive engineering is code or interacting with software systems that you do explicitly to achieve an outcome.
- 10:38So I run a SQL query to populate my dashboard or something like that.
- 10:45It's a very concrete connection to some sort of outcome.
- 10:48And then negative engineering are code you write systems you interact with that ensure those outcomes.
- 10:55I am sort of like insurance.
- 10:58And so defensive code is a great example of negative engineering.
- 11:02It's something that you're writing.
- 11:04When you're writing those try accepts and everything, you're really hedging against anticipated failure modes that you're trying to account for right now.
- 11:12If the data was always well formed, it would never crash.
- 11:15If the servers was always up, it would never crash.
- 11:18Exactly, exactly.
- 11:19But then you get the reports, the sentry messages or whatever.
- 11:23Exactly.
- 11:24And so observability, I think.
- 11:26Complete negative engineering.
- 11:28Observability is not something you do for its own sake.
- 11:30You do it in anticipation of an unknown future failure mode.
- 11:35It allows you to recover the outcome.
- 11:37That you want to avoid.
- 11:38Yeah, failure is only like the first class citizen here, right?
- 11:40Something failed and you want to figure out what happens so that you can fix it.
- 11:45To really tie it to insurance even more directly, all of the things we're talking about are situations where a small error has a disproportionately large negative impact on an outcome.
- 11:57So scheduling is an example here.
- 11:59If you have Cron running on a server, running a Python script, and something you do, maybe you load just far too much data in your script and the machine crashes out of memory.
- 12:09You don't get an alert.
- 12:10You wake up the next morning and 30 jobs have not run.
- 12:14You don't know why.
- 12:15You have to figure out why.
- 12:16By the time you figure it out, you're five hours deep.
- 12:18Maybe not that long, but two hours deep.
- 12:20And using a service or a system, and we'll talk about the details, like Prefect or some other type of observability negative engineering tool, you would potentially get a text alert.
- 12:29Or at a minimum, you would wake up and immediately see, oh, that happened at 1 a.m.
- 12:33I know what happened.
- 12:34Let me just fix it really quickly.
- 12:35And you're back up to speed.
- 12:36Yeah, interesting.
- 12:36Yeah.
- 12:37Frank out in the audience says, defensive programming, that means good handling on exceptions and so forth.
- 12:43And I think that's interesting, Frank.
- 12:45I think I do agree.
- 12:47But it sounds to me, Chris, like you're even talking like way broader.
- 12:50Like, do you, if you're writing an API, do you have to even think about hosting that or making sure that it's scaled out correct?
- 12:58Or like, you know, observability as tracking error reporting in the broad sense of sure, you should be doing the small defensive programming, but also to deal with these negative engineering problems.
- 13:08But like, there's whole businesses around dealing with segments of it.
- 13:12Exactly, exactly.
- 13:13And I think putting a word to it, as simple as it may seem, really helps, especially for building a company and a product like refine and target.
- 13:23Like, what are the features that are important to us and which ones are not important, at least at this time?
- 13:27And especially in orchestration and data engineering.
- 13:30I mean, it's very tempting to build cool stuff because there's lots of cool stuff you can build.
- 13:34But are you guaranteeing an outcome?
- 13:36Are you ensuring against some outcome?
- 13:38Like, are you sure you know exactly what you're providing here when you build that cool thing?
- 13:42Right.
- 13:42So you guys use, you try to identify some of these areas of negative engineering that data engineers run into.
- 13:49And you're like, how do we build a framework such that they don't have to worry about or think about that?
- 13:53Exactly, exactly.
- 13:54And so for data engineering, I think of this as it's any software engineering that you do that either moves data, cleans data, or prepares data.
- 14:06Either for another person to ingest or maybe another system to ingest, but it's all the activities surrounding that.
- 14:12And I think for, I know, maybe not everyone listening is in the data space specifically.
- 14:18So just as the easiest example, we have a production database running behind some web server, some API, and you want to do analytics on it.
- 14:25Well, maybe you're using Postgres, not the best analytics database.
- 14:29And also you don't want to actually write a query that takes down the database.
- 14:31So what do you do?
- 14:32You take the data out, you put it into BigQuery or Snowflake or somewhere else.
- 14:36You run your analytics over there.
- 14:37The schema is there.
- 14:38Right.
- 14:39You probably totally change the schemas because you want to, in a relational database, somewhat in the document database, maybe a little less, but definitely in a relational database, your job is third normal form.
- 14:50Like, how do I not have any data that repeats?
- 14:53I'll have a 10-way join rather than have something repeat.
- 14:56But when you want to do reporting, those joins are killers.
- 15:00You just want, like, I want to do a straight query where, you know, this column is that and just, like, wreck the normalization for performance reasons, right?
- 15:07Right.
- 15:07You just want to have fun.
- 15:08Yeah.
- 15:08Exactly.
- 15:09So you can ask the questions in very interesting ways, like many ways, in simple queries rather than being a SQL master.
- 15:18Exactly.
- 15:18Exactly.
- 15:19And keeping that system running, keeping the data fresh, keeping the schemas in sync, that's a lot of work, actually.
- 15:25And that's one of the classic examples of data engineering.
- 15:28There's a lot of other stuff, too, but that's the classic.
- 15:30This portion of Talk Python To Me is brought to you by Microsoft for Startups Founders Hub.
- 15:37Starting a business is hard.
- 15:39By some estimates, over 90% of startups will go out of business in just their first year.
- 15:44With that in mind, Microsoft for Startups set out to understand what startups need to be successful and to create a digital platform to help them overcome those challenges.
- 15:53Microsoft for Startups Founders Hub was born.
- 15:56Founders Hub provides all founders at any stage with free resources to solve their startup challenges.
- 16:03The platform provides technology benefits, access to expert guidance and skilled resources, mentorship and networking connections, and much more.
- 16:11Unlike others in the industry, Microsoft for Startups Founders Hub doesn't require startups to be investor-backed or third-party validated to participate.
- 16:21Founders Hub is truly open to all.
- 16:23So what do you get if you join them?
- 16:25You speed up your development with free access to GitHub and Microsoft Cloud computing resources and the ability to unlock more credits over time.
- 16:33To help your startup innovate, Founders Hub is partnering with innovative companies like OpenAI, a global leader in AI research and development, to provide exclusive benefits and discounts.
- 16:44Through Microsoft for Startups Founders Hub, becoming a founder is no longer about who you know.
- 16:48You'll have access to their mentorship network, giving you a pool of hundreds of mentors across a range of disciplines and areas like idea validation, fundraising, management and coaching, sales and marketing, as well as specific technical stress points.
- 17:02You'll be able to book a one-on-one meeting with the mentors, many of whom are former founders themselves.
- 17:07Make your idea a reality today with the critical support you'll get from Founders Hub.
- 17:12To join the program, just visit talkpython.fm/foundershub, all one word, no links in your show notes.
- 17:19Thank you to Microsoft for supporting the show.
- 17:21One of the things I see stand out, I don't want to get the API right away, but I just see like coming out of the API that you all build is there's like retries like right front and center.
- 17:32Like here's a task and I wanted to retry with this plan, right?
- 17:36You have this number of times or there's probably like a back off story and stuff.
- 17:40Exactly.
- 17:41And that's another great example of small error, the tiniest network blip.
- 17:46Kubernetes, I don't know, I've seen kubedms sometimes just doesn't do what it's supposed to do.
- 17:50Somebody was flipping over the load balancer and you hit it at just the wrong time and there it goes, right?
- 17:55Exactly.
- 17:55And now next thing you know, I mean, a lot of different things can happen depending on the script you wrote.
- 17:59Maybe you did a lot of good defensive programming yourself and the try accept was a little bit too much.
- 18:04And so your next task actually runs despite the first one failing.
- 18:08And maybe it passes the exception downstream.
- 18:10And now you have this cascade of errors that you have no idea what they mean.
- 18:13And another thing in negative engineering is dependency management, making sure that if this fails, things that depend on it do not run unless they are configured to run only on failure.
- 18:23Yeah.
- 18:23Worst case scenario, they say, yes, this is a good investment.
- 18:26You should buy it.
- 18:26Or yes, this is a good decision.
- 18:28And they like.
- 18:28Exactly.
- 18:29Exactly.
- 18:30It's really cheap.
- 18:31Well, it's zero because the task failed to find the price.
- 18:33So, of course, you should buy it.
- 18:34Exactly.
- 18:35Exactly.
- 18:35And you want to know that it happened and make sure that the effect, the blast radius is minimized.
- 18:39And that's really what it's all about.
- 18:40And like retry is a perfect example of just one of those small things that can cascade weird, unexpected ways.
- 18:45Yeah.
- 18:46What are some of the other areas of crufter of these problems you see in data engineering?
- 18:50Logging is a big one.
- 18:52Just having a place where you can see some centralized set of important logs.
- 18:56Any and all.
- 18:58The more you use like Kubernetes are more like you kind of.
- 19:00Oh, yeah.
- 19:01Distributed systems.
- 19:02Microservice it out.
- 19:03The harder it is to know what's going on in the logging story.
- 19:06Well, right.
- 19:06And the definition we work with in the modern data stack are data tools that deliver their feature over an API.
- 19:12And so if you think about that, you're dealing with inherently this giant microservice system that you want to like coordinate and see in some centralized place.
- 19:21In some meaningful way.
- 19:22And collaboration, versioning, those are all other things.
- 19:26Caching.
- 19:26So just configurable like storage locations for things.
- 19:31And then maybe the biggest one that is simple, but I see people building this internally all the time, which is just exposing an API, a parametrized API, which is triggering some type of job.
- 19:43Next thing you know, it needs to be available, you know, throughout your whole network.
- 19:47It needs to be up.
- 19:48It needs to be monitored and tracked and audited and all these things.
- 19:51Maybe versioned.
- 19:52Maybe versioned.
- 19:53Exactly.
- 19:53Exactly.
- 19:54Oh my gosh.
- 19:55Yeah.
- 19:55It just gets, all of a sudden you're like, okay, I'm building an entire system.
- 19:58My job is not this.
- 20:00Yeah.
- 20:01It's one of those things that seems so simple.
- 20:03Like I would love it if you would just really help us out, you know, Michael here, if you could just give me a quick little, little API that we could just call that API.
- 20:11I mean, look, I'll just, here's the JSON.
- 20:13It's like that big.
- 20:14And if I could just call it, boy, things would just unlock.
- 20:17And then, then it's like a holiday and it's not working.
- 20:20And now I'm dealing, like, how did I get this job?
- 20:23Right.
- 20:23Right.
- 20:24Right.
- 20:24Yeah.
- 20:25And the second someone says just anything, you're like, oh, I'm on edge.
- 20:28What do you mean?
- 20:29Are you sure?
- 20:30Exactly.
- 20:31I don't want it.
- 20:32Give it to someone else.
- 20:33Give it to someone else.
- 20:34Awesome.
- 20:35All right.
- 20:35Well, you know, maybe that's a good time to talk a little bit more in detail about Prefect.
- 20:40So you all have on the GitHub page, if I track it down, you've got an interesting way to discuss it.
- 20:48It says Prefect is the new workflow management system designed for modern infrastructure and powered by the open source Prefect core.
- 20:56Users organize tasks into flows and Prefect takes care of the rest.
- 21:00So there's a lot of stuff here that I thought might be fun to dive into.
- 21:03So new workflow management system, as opposed to what was there before.
- 21:08So maybe we could sort of take this apart a bit.
- 21:10Yeah.
- 21:11So we actually.
- 21:12What do you mean by new workflow?
- 21:13We have.
- 21:14I know you also have a new, new one coming as well, right?
- 21:16Yeah.
- 21:17Yeah.
- 21:17We have new, new.
- 21:18You always got to keep rebuilding.
- 21:19We have a great post on at least part of this that encourage people to go check out called the history of data flow automation that really will get our head of product wrote it.
- 21:27And it's just a great kind of tour through the history.
- 21:29But so for us, a lot of the different workflows, so workflow management, right?
- 21:34You have some set of businessy business logic tasks that are stringed together with some dependency.
- 21:40It could be a lot of conditionals or something like that.
- 21:42You want to run it usually on a schedule, but sometimes ad hoc or maybe event based.
- 21:46And there's a lot of different systems for managing these quote unquote workflows.
- 21:51Okay.
- 21:51Many of them.
- 21:52I guess one way to think about it is they're cut by context.
- 21:55What context are you operating in?
- 21:57Is this like a data context or like Zapier, for example, is a very consumer facing?
- 22:01And what is the user persona?
- 22:03Right.
- 22:04If you think about Zapier with all these different automations, all these triggers, and then all these actions, it's just like.
- 22:09Right.
- 22:10I mean, if that must be insane.
- 22:11Yeah, exactly.
- 22:12And that's a workflow.
- 22:13It's totally valid.
- 22:14And their user persona is a no code person.
- 22:16Also totally valid.
- 22:17And so for us, new workflow management system means kind of the next generation after a lot of the Hadoop tooling.
- 22:26So Hadoop, as you can kind of see in this post too, Hadoop caused an explosion of just really cool new tools.
- 22:34And Airflow, Luigi, Azkaban, I like this another one, maybe Uzi.
- 22:40A lot of these kind of came out of that error to manage these distributed jobs.
- 22:45And so they're kind of like, I think of them as like distributed state-based Cron.
- 22:51You can put them on a well-defined schedule.
- 22:54They manage the depend.
- 22:55So it's actual dependency management, which Cron does not do.
- 22:58And they can do it kind of across multiple computers, which is really convenient.
- 23:03Yeah.
- 23:04In a real simple way, it's like kind of the Cron.
- 23:06It is kind of like Cron, right?
- 23:07Like just look here for data and then just run this process against it.
- 23:11But it's so much more with the dependencies and then pass it to here.
- 23:16And then, yeah, right.
- 23:17It's just the flow of it.
- 23:18Exactly.
- 23:19And you would be insane to try that with just timing.
- 23:21Exactly.
- 23:22Exactly.
- 23:22And so new for, I mean, new for us can mean a lot of different things, but I'll just, I'll
- 23:27just say, we just talked about it.
- 23:28It's really taking approach of scheduling is important and alerting on failures of scheduling
- 23:33is important, but we're like expanding the vision there.
- 23:35And it's much more about this negative engineering, which includes observability, configuration management,
- 23:40event-driven work, not just scheduled work.
- 23:43Scale is really important because data scientists have a lot of the same needs as data engineers
- 23:47and those tools were not meant for data scientists.
- 23:50Right.
- 23:50Yeah.
- 23:50Yeah.
- 23:51You were talking, I heard you speak about wanting to run a bunch of experiments, like hundreds
- 23:55of thousands of experiments as a data scientist.
- 23:58And some of the other tools would talk about running operations in tens per minute or tens,
- 24:05something like that.
- 24:06And you're like, I need something that does it in tens or hundreds per second.
- 24:09Yeah.
- 24:09I mean, anything that, you know, allows you to just explore a search space of hyper parameters
- 24:15and do so in a way that is easy to quickly find, you know, some subset of those parameters
- 24:20and see whether they succeeded or failed.
- 24:21You can define that criteria.
- 24:23You can raise an exception, for example, if like some output just violates some assumption
- 24:28you have.
- 24:28And then that way it shows up as red is like, you're not going to look at that.
- 24:31And managing an interface to the infrastructure is another big part of this.
- 24:36So I guess maybe I'm jumping ahead, but the next part is design for modern infrastructure.
- 24:40And I think modern infrastructure can mean a lot of different things.
- 24:44For us, it means first off that there's a diverse array of infrastructure people use.
- 24:50And so creating a system that can plug and play with a lot of them.
- 24:53So we support, for example, some of the more popular ways of deploying prefig flows are in
- 24:57Kubernetes and Fargate.
- 25:00So kind of like a serverless style model.
- 25:02So you can do it on your local machine.
- 25:03And so just having that kind of unified interface to interact with all these things is one aspect of modern.
- 25:08Another is that local development to cloud development story.
- 25:14That's really important, right?
- 25:15You want to make sure that these are as close as possible to each other so that you can debug things locally and things like that.
- 25:23And so that's another aspect as we try really hard.
- 25:26And 2.0 gets this way better than 1.0 for the record of mirroring what code is exactly running in prod versus your local.
- 25:34Something that always makes me nervous when I hear people talking about, oh, this is cloud native.
- 25:40And you can just, there's like 50 different services in this particular cloud.
- 25:44And so why don't you just leverage like nine or 10 of them?
- 25:46And I just always think, you know, well, what is the development going to feel like for that?
- 25:51You know, how, if I'm on a spotty internet connection or something like that, is it just inaccessible to work on?
- 25:58Do I have to just completely sort of live in this cloud world?
- 26:01And it sounds like there's a more sort of local version that you can try and work with as well here.
- 26:07Yeah.
- 26:08And one of the things that we achieved with 2.0 is we refactored kind of where orchestration, different aspects of orchestration takes place.
- 26:15And so all of the true orchestration logic that we want to own runs behind an API.
- 26:21And the reason that I'm saying, I'm like emphasizing that is in 1.0, that's not 100% true.
- 26:27And so when you run a workflow locally, it's talking to an API.
- 26:31Maybe it's your self-hosted open source API.
- 26:33So it's maybe responding slightly differently.
- 26:36But the code path running on your machine and its requirements and everything else is exactly the same as what's going to run in production.
- 26:44It just might talk to a different URL.
- 26:45Sure.
- 26:45Let me stick on this.
- 26:46We were halfway through your sentence.
- 26:48I do want to talk more about like the cloud and stuff.
- 26:51So powered by the open source preflect prefect core workflow engine.
- 26:56Tell us about that.
- 26:58So since day one, always wanted to put as much open source as is reasonable.
- 27:03And one of kind of the ways that we think about what we put in the open source, and then I'll tell you what kind of this workflow engine is, are like, what are the things that we are maximally leveraged to support extensions of and, you know, new configurations of?
- 27:18And our core workflow engine is definitely one of those things, right?
- 27:21We're the experts in it.
- 27:22And that engine is the thing that manages, for example, that a downstream dependency can't run if it's upstream failed or maybe just hasn't completed yet.
- 27:31The caching logic is a part of that workflow engine.
- 27:34The triggering logic for the workflow, the scheduling of the workflow, all of that stuff is open source.
- 27:39That's the UI visibility sort of tracking bit as well, right?
- 27:44A hundred percent.
- 27:45Yep.
- 27:45That is all open source.
- 27:46And we build it as a part.
- 27:47So we actually have a dedicated front-end team and we build the UI and package it up in the packages of pre-built website.
- 27:55Yeah.
- 27:56I'm not sure of where I would.
- 27:57Oh, here we go.
- 27:58I found a cool little UI picture.
- 28:00Oh, there we go.
- 28:01That's, yeah, that's the 2.0 one.
- 28:02Yeah.
- 28:02Yeah.
- 28:03So, I mean, this UI to see what's working, what's not working, how often has it succeeded, you know, what's succeeded, what's failing, what jobs are unhealthy, for example.
- 28:13Like, that's all negative engineering, right?
- 28:15Your job wasn't to start out to build this observability web front-end.
- 28:19Your job was to get the data in and then get it into the database and start doing it for analysis or whatever.
- 28:25Exactly.
- 28:25Predictions.
- 28:26But here you are in Vue.js going after it, right?
- 28:30Or whatever it is.
- 28:30No, it is Vue.
- 28:31Good call.
- 28:32Good call.
- 28:32Yeah.
- 28:32Right on.
- 28:33And one of the ways I think about this dashboard view is it gives you this landing page to, you have some mental model of your expectations.
- 28:39You can check quickly if they are violated here.
- 28:42And then if so, dig in further, click around.
- 28:44And if not, you know, we are more than happy when people exit out of the UI and are like, we're moving on.
- 28:49It's like, perfect.
- 28:50We did our job then.
- 28:51Yeah, that's good.
- 28:52But yeah, that's pretty neat.
- 28:53So that's part of the core engine.
- 28:55Yep.
- 28:56A hundred percent.
- 28:56And so things like auth, for example, are not part of that.
- 28:59So in that case, like a lot of ways auth can get extended.
- 29:03There's a lot of different ways that we might implement it.
- 29:05And that's not exactly right.
- 29:07Our competitive advantage, supporting different ways that you might deploy auth securely.
- 29:11And so it's like, nope, that's our platform feature.
- 29:13We can do it in the way we know best and can do it securely.
- 29:17Sure.
- 29:18And so it's worth pointing out, I suppose, that the way it works is there's the open source engine and then there's the Python API.
- 29:26And then you talked about different ways to run it and to host it, right?
- 29:30So one way to host it is to just use your cloud, right?
- 29:34You've got the Preflect cloud where it just runs with all these things there.
- 29:39And then the others, I could run it.
- 29:40I could self-host that core workflow engine or just run it on my laptop or whatever.
- 29:45So it's a little bit more complicated than that, actually, in an interesting way.
- 29:49All right.
- 29:49All right.
- 29:50Tell us about it.
- 29:50So Jeremiah and I both come from finance world.
- 29:54And so a lot of our first kind of early design partners and advisors come from that world.
- 29:58And one of the challenges one of our advisors gave us was very genuinely, I don't want to learn your tech stack so that I can host it within my tech stack.
- 30:07And there's no way I'm ever going to give you my code or data because it's highly proprietary.
- 30:11That's your problem.
- 30:13And we're like, okay, well, that sounds impossible, right?
- 30:16But we thought about it.
- 30:17I think companies are already so freaked out about losing the data without even meaningfully giving it to someone else, right?
- 30:23They're already like, well, we might lose this.
- 30:26We might, you know, might be ransomware.
- 30:27There might be other things, right?
- 30:28And so the idea of just handing it over does seem probably pretty far out there for a lot of them.
- 30:33Exactly.
- 30:34And so what we designed after a long time, we really like thought about it, but we did this back in 2018, maybe beginning of 2018.
- 30:43We came up with a model where orchestration takes place over an API.
- 30:48And if you really think about it, think of other orchestrators, Cron, Kubernetes is a container orchestrator.
- 30:52They operate on metadata.
- 30:53They operate on container registry locations and specs for how you expect it to run.
- 30:58And once we had that insight, we designed the system so that the cloud hosted API that we run operates purely in metadata, result locations, flow names, flow versions, things like that.
- 31:10And then you run an open source agent anywhere that you want.
- 31:14And it operates on a pure outbound pull it model.
- 31:17So all of our features are based on the agent polling and then your workflow also potentially doing some communication.
- 31:24And because of that, you know, there's still this outbound connection you have to think about.
- 31:28You still have to trust us with some of your parameters.
- 31:30And, you know, there's definitely still some security surface area that we have to think about.
- 31:35But we do not post your data and we do not have access to your execution.
- 31:40And that unlocked this problem for us.
- 31:43And so as long as we have enough agents that can be deployed in lots of different places, then, you know, we can deliver a lot of value.
- 31:50Yeah, that's pretty excellent.
- 31:51So if you want to host it in AWS or Kubernetes or Linode or wherever, you just, that's up to you, huh?
- 31:58Exactly.
- 31:59100% up to you.
- 32:00Is there a way where I can do it somewhat offline?
- 32:03Like, for example, with the open source core engine, does that still go back to you guys or is that sort of local?
- 32:10No, that's totally local.
- 32:11And it's designed with the same hybrid approach.
- 32:13So you could have, you know, your platform team, maybe your DevOps team hosting the API for you and the database behind it.
- 32:19And then you as the data team can manage your agents.
- 32:22And just as long as you have access to the API, you can set it up the exact same way internally if you want.
- 32:26And we've seen places do that for sure.
- 32:29Sure.
- 32:32If you're a regular listener of the podcast, you've surely heard about Talk Python's online courses.
- 32:37But have you had a chance to try them out?
- 32:39No matter the level you're looking for, we have a course for you.
- 32:42Our Python for Absolute Beginners is like an introduction to Python, plus that first year computer science course that you never took.
- 32:48Our data-driven web app courses build a full PyPI.org clone along with you right on the screen.
- 32:55And we even have a few courses to dip your toe in with.
- 32:58See what we have to offer at training.talkpython.fm or just click the link in your podcast player.
- 33:07Let's maybe talk through a quick example of using it.
- 33:11Oh, hold on.
- 33:11The last part of that sentence is users organize tasks into flows.
- 33:17And so let's look at a quick example maybe of the code that you might do here.
- 33:23Let's see.
- 33:24Sure, here.
- 33:25This probably isn't.
- 33:25It's always tricky to talk about code on audio formats.
- 33:30But just give us a sense of what does it look like to write code for Prefect.
- 33:35Yeah.
- 33:35So one of our design principles, right?
- 33:37We talked a little while ago about this negative engineering problem.
- 33:39It kind of emerges.
- 33:40And eventually you're doing all those activities that you didn't care about.
- 33:44And kind of in an interesting way, we try to mirror that with the way Prefect gets adopted.
- 33:48So I love to call it incremental adoption.
- 33:50I want the complexity of what you're trying to achieve and the amount of code you have to write to scale.
- 33:57I mean, ideally like sublinearly or something, but, you know, scaled together.
- 34:00And so an example you have here, our 2.0 takes this way further.
- 34:04But we operate on this decorator model.
- 34:06So just really simple.
- 34:07You have Python functions.
- 34:08You already wrote them.
- 34:09You presumably already even have this script.
- 34:11You just want to sprinkle in some Prefect so that you get some observability into it.
- 34:15And then if you want to start to do more and more things, you might have to write more and more code.
- 34:19But it's, you know, appropriate for the activity that you're trying to achieve.
- 34:23And so, yeah, we try to be really simple.
- 34:26We like it when people kind of get the feeling that this is like a toy kind of package that you play around that just has these heavy duty impacts.
- 34:34So, yeah, tasks are the smallest unit of work that we can look at.
- 34:37Tasks can do things like retry.
- 34:39They can cache.
- 34:40They have well-defined inputs and outputs.
- 34:41Flows are containers for managing dependencies of tasks.
- 34:46They also have well-defined inputs and outputs, also have their own states.
- 34:51But flows are the things that can be scheduled and triggered via API.
- 34:56And tasks are kind of just the smaller, more granular units of orchestration within those workflows.
- 35:02And so the way that this looks is it looks just like a function.
- 35:06And you kind of just call it with the arguments or whatever.
- 35:10Yep.
- 35:10And then you put a task decorator on there, which is pretty interesting.
- 35:14And that's where the retry thing can be.
- 35:16Exactly.
- 35:16Then you also have a context manager, which I think is a nice pattern.
- 35:20So you have a context manager to create the flow.
- 35:22And then you basically simulate doing all the work with an abstract parameter.
- 35:26And then you kind of set it off, right?
- 35:28So that is true in 1.0.
- 35:31However, what we found.
- 35:33Something new is coming.
- 35:34Yeah, this is important.
- 35:35That context manager, all that code runs like you called out.
- 35:39And so it compiles this DAG.
- 35:42That's everyone.
- 35:43Directed acyclic graph.
- 35:44What we realized in talking to a lot of our users on 1.0
- 35:48is that confronting the DAG.
- 35:51Because sometimes people would write their own Python code
- 35:55that wasn't prefect in that context manager.
- 35:56And it would actually run.
- 35:57It wouldn't be deferred.
- 35:58And they would get confused.
- 35:59They're like, why do I have to care about this?
- 36:01And we started to realize that this DAG model really came most likely
- 36:07out of the constraints of YAML flat file formats.
- 36:10And they were mirrored in all the different tools
- 36:12that were built on top of that.
- 36:14And then all of a sudden, everyone's talking about DAGs.
- 36:16Data engineer, when they're writing a script,
- 36:18to move data around, should focus on the script.
- 36:20They shouldn't focus on this abstract program concept of
- 36:22can't do control flow, essentially,
- 36:24without really thinking deeply about it.
- 36:26And so in 2.0, we remove this context manager.
- 36:30Flows are also now specified via decorator.
- 36:33So the deferred computation is just function definition.
- 36:36And now we will discover the tasks at runtime.
- 36:39And you can implement native Python logic in flows.
- 36:42And that's totally fine by us.
- 36:44So it just unlocks the expressiveness of what you can write in Prefect really natively.
- 36:49natively.
- 36:49That's awesome.
- 36:50So you can have loops or if statements or whatever you want to write.
- 36:54Oh, yeah.
- 36:54While statements even.
- 36:56Yeah.
- 36:56You can have flows that change structure from run to run.
- 36:59All of it.
- 37:00Okay.
- 37:00So the thing that strikes me here is you kind of write regular Python code.
- 37:04And you put a decorator or two on it.
- 37:06And it just works in a different but similar way.
- 37:09That's a little bit of that negative engineering influence as well.
- 37:13It's like, how do I take normal stuff without too much work and make it more general for pipelines?
- 37:19Exactly.
- 37:20We call it workflows as code instead of code as workflows.
- 37:23I'm sorry.
- 37:23Code as workflows.
- 37:25Because you have the code.
- 37:27It is the workflow.
- 37:28And now you just want us to care about it.
- 37:31And so we should be minimally invasive when we do that.
- 37:34Because the second you have to refactor your code significantly, you're back in negative engineering.
- 37:38You have to think about the consequences of the refactor and everything else.
- 37:41And we want to avoid that as much as humanly possible.
- 37:43You should have to do a little bit.
- 37:44Yeah.
- 37:44A couple of things that I saw that stood out to me checking out your API here that was interesting.
- 37:49One was I can have async methods and async execution of these things.
- 37:54So async and await style, async def methods and await operations.
- 37:58You want to talk about that support?
- 38:00Yeah.
- 38:00So if you actually go to orion-docs.prefect.io, that's where a lot of our 2.0 docs are currently
- 38:06located while we're still in beta.
- 38:08But they will, of course.
- 38:09And then hyphen docs.
- 38:10Yeah.
- 38:11So this async works.
- 38:12That's probably where I saw it.
- 38:12Yeah.
- 38:13Yeah.
- 38:13Yeah.
- 38:14Cool.
- 38:14Big shout out to our prefect engineer, Michael Adkins, who really took a lot of time to dig
- 38:19into the guts of async.
- 38:21And he set it up so that you can do crazy things.
- 38:24You can have synchronously defined flows with asynchronous tasks.
- 38:29And our engine, the executor, will manage it all for you just to make sure that they're
- 38:34running in the right event loops and things like that.
- 38:35It's really cool.
- 38:36We've got to create a loop and just run this in a way because internally it's synchronous
- 38:40or something like that, right?
- 38:41Exactly.
- 38:42Exactly.
- 38:42And so it's really slick.
- 38:44And it gives at least users who know how to write async code, kind of this native feeling
- 38:48of parallelism.
- 38:49We all know it's not quite parallelism, but it gives you at least that feeling, especially
- 38:53when you're doing a modern data stack.
- 38:54If it's all API driven, you've got a lot of network IOs.
- 38:58It's talking to databases.
- 38:59It's talking to file IO.
- 39:01It's talking to external APIs.
- 39:02Like all of those are perfectly scalable.
- 39:04Exactly.
- 39:05Exactly.
- 39:06Yeah.
- 39:06Yeah.
- 39:06Cool.
- 39:06So you can have at task and say, I'm just going to do an async def some function.
- 39:12The example you have in your docs, your Orion docs is using HTTPX async clients to go talk
- 39:19to the GitHub stuff.
- 39:20Oh, yeah.
- 39:21Oh, yeah.
- 39:21And here you also have, here's your at flow decorator, right?
- 39:24For this thing.
- 39:25And another thing too, that we did that I'm really proud of that I've already started
- 39:29to see kind of be one of the ways people onboard into Prefect is previously with the API, you
- 39:35had to pre-register your flow and tell the API this thing exists, you know, get ready for
- 39:40it.
- 39:40And then runs had to get created server side before they could run client side.
- 39:45With the new model, we set everything up and all of this was this like deep study in bookkeeping.
- 39:51Like how can we create stable indices or stable identifiers for things that, you know, we can
- 39:55identify across processes and runs.
- 39:57And so in the new model, you can take this flow.
- 40:00And if you are just pointing to our cloud API, you can call it as a function interactively,
- 40:05and it will still communicate with cloud API just as opposed to deployed workflow.
- 40:09And so what that means though, sorry, just going back to the incremental adoption story is you
- 40:14can use cron and then you can just put one line of code on your main function at flow, keep
- 40:22cron running with that Python script.
- 40:24And you've immediately gotten a really pretty kind of record of all of the jobs that cron's
- 40:28running.
- 40:29And if it fails, you'll get the failure alerts and everything else.
- 40:32And cron's still your scheduler, which is totally fine by us.
- 40:34Sure.
- 40:34Oh, that's interesting.
- 40:35Yeah.
- 40:36And then, you know, at some point you want to start to see into the future and that's when
- 40:39you have to use our scheduler instead of cron.
- 40:41But yeah.
- 40:41But once again, incremental adoption.
- 40:43Yeah.
- 40:44The API here is pretty wild.
- 40:45You're exploding a list comprehension of calls to the task to an ASIC IO gather.
- 40:52That's a pretty intense line right there, but I like it.
- 40:55It's not intense in the way that it's like, oh my gosh, what is this insanity?
- 40:59But no, yeah.
- 41:00It's a lot going on there.
- 41:01Yeah.
- 41:01Yeah.
- 41:01Yeah.
- 41:01You know, there's the joke t-shirt maybe you've seen.
- 41:04It says, I learned Python.
- 41:06It was a great weekend.
- 41:07Right?
- 41:08Like, that's true for like variables and loops and functions, but like, then you see
- 41:12stuff like it.
- 41:13It's like, oh wait.
- 41:13Yeah.
- 41:14There's more patterns here.
- 41:15Maybe it's longer than a week.
- 41:15It might be more than a weekend.
- 41:17Give me a moment.
- 41:17Yeah.
- 41:18No, this is really cool.
- 41:19I really like this new API.
- 41:20So when's 2.0 a thing?
- 41:22When is it released in the main way of working?
- 41:26Our planned release date, or I shouldn't say date, but just like target, you know, you can
- 41:30expect it's one of the weeks or something around is July 1st.
- 41:33But we are still releasing.
- 41:35So anyone out there is intrigued by this, especially if you're completely new to Prefect,
- 41:40I definitely encourage you to just start with one of our beta 2.0 releases.
- 41:44They're way slicker, way easier to get your head around, more interesting.
- 41:49And there's still like everything, you know, working.
- 41:52We just, there's some critical paths that we haven't fully released yet that we want to
- 41:56make sure are there and tested heavily before we go into GA.
- 41:59Right.
- 41:59But if what's there works for people that they could, they could use it.
- 42:02Oh yeah.
- 42:03Should definitely work.
- 42:04And if you run into weird bugs like that, let's not.
- 42:06Yeah.
- 42:06How does it plug into the cloud visibility layer and all that is if I run some one and want
- 42:14some two, is it going to go crazy or?
- 42:16No.
- 42:16So they both will be configured to talk to the right API.
- 42:19And so you won't be able to see them in the same place.
- 42:22So that's unfortunate if you will, but you can definitely run them side by side.
- 42:28I mean, the environments aren't compatible.
- 42:30So you'll have to have different Python environments that you're running them in.
- 42:32But yeah.
- 42:33But otherwise, yeah.
- 42:34I mean, I think some of our 1.0 clients, for example.
- 42:37Because what?
- 42:38Pip install prefix is equal, equal one, something or equal, equal two or something along those
- 42:43lines.
- 42:43Right.
- 42:44You'd like need different libraries.
- 42:45Yeah.
- 42:45So if you just did pip install prefix right now, you'd get a official 1.0 release.
- 42:50I don't remember the number.
- 42:51So you'll have to make sure that you allow for pre-release in your pip command.
- 42:55So either, I think if you just specify equals equals 2.0, I think we're at like B3 right
- 43:01now.
- 43:01Then you'll get it.
- 43:02But yeah, you have to explicitly call it out since it's not, since it's still in beta.
- 43:06Sure.
- 43:06I always like going to pipi.org.
- 43:09It's just like, it's 375,000.
- 43:12I know.
- 43:12It's impressive.
- 43:13Yeah.
- 43:15So 1.2.1 is the current one.
- 43:17But in here, yeah, you're 2.0, beta 3.
- 43:20And we are planning to cut another release later this week.
- 43:23So you can expect B4.
- 43:24Probably it'll be B4 by the time people get around to hearing this and shipping and so on.
- 43:30Yeah.
- 43:30Yeah.
- 43:31But still, really cool.
- 43:32So basically, your advice to people who are like, hey, this sounds interesting.
- 43:36I want to check it out.
- 43:37Like, just start with two.
- 43:38Yeah.
- 43:38I'd say just start with two.
- 43:39It's working, easier to grok, and I think is more powerful and more flexible for different
- 43:45use cases, especially if you're thinking outside of data.
- 43:47Sure.
- 43:47So when I hear people talk about data engineering, you know, if you go into that world, you see
- 43:53all these amazing tools that people have built that look like, wow, these are really
- 43:58amazing.
- 43:58And to me, they feel quite similar, like Prefect and Friends.
- 44:02It feels real similar to the web frameworks, right?
- 44:05Like Flask or Django.
- 44:07And you're like, okay.
- 44:08So for example, what I mean by that is in Flask, all I have to do is I have to say, here's a
- 44:12function that goes to this URL.
- 44:13And I just write the code and return a dictionary or something like that.
- 44:17I don't have to think about headers, cookies, connect, you know, like stay connected header,
- 44:23HTTP2 traffic.
- 44:25Like I just do the little bit and it just, it puts it all together for me.
- 44:29And in the data engineering world, there's a bunch of stuff like that, that I feel many
- 44:34people are wholly unaware probably.
- 44:36Yeah.
- 44:36There is an explosion of tooling in data engineering right now.
- 44:41And also in kind of the adjacent analytics world.
- 44:44This kind of goes back to what I was saying about how we kind of crystallize this concept
- 44:48of negative engineering.
- 44:48And it's just important.
- 44:50I think all of these tools come from some very real use case, right?
- 44:54And I think it's just important to figure out, like the way I talk to people about this
- 44:57stuff is you shouldn't really pick a tool just on its current feature set.
- 45:01You should pick it on its vision as well as whether it works for you today, because you're
- 45:05going to change a lot and you want to make sure that the tool is changing with you because
- 45:08these tools, especially the explosion of startups, we're all changing quite quickly.
- 45:12And you want to make sure that we're changing in an aligned way.
- 45:14And having that fleshed out vision is important.
- 45:17And if it's just a tool that like seems cool, but like, what exactly is this doing for me?
- 45:21Exactly.
- 45:21Precisely.
- 45:22If you can't really articulate that, then, you know, that's not to say you shouldn't keep
- 45:26using it or something, but just that's, that's always my exercise that I do with
- 45:29new tools.
- 45:29Yeah.
- 45:30When it's something as fundamental as this, you kind of have to think about, I'm going
- 45:34to live with this for a while.
- 45:35Exactly.
- 45:36Do I want to have this as my roommate when I come to work?
- 45:39Right.
- 45:39Do I want to debug this?
- 45:41Do I want to exactly extend it?
- 45:42You know, you're definitely going to do something weird with it.
- 45:44We've all done weird things with every tool we use.
- 45:46Oh yeah, absolutely.
- 45:49All right.
- 45:50So my question to you about this sort of like parallel to Flask and the web frameworks and
- 45:56various other things.
- 45:57This is solving a lot of negative engineering problems for data scientists and data engineers.
- 46:01What do you see?
- 46:03Where do you see maybe people like me who mostly do APIs and web apps and things along those lines?
- 46:11Should I be using stuff like this?
- 46:12And where do you see the solving problems for people who don't like traditionally put on the
- 46:16data science, data engineering hat?
- 46:18So there's two, two places that I think are relevant.
- 46:21I think the first is just like really kind of tactical, just tracking of background work,
- 46:27tracking of background tasks, right?
- 46:29Like Celery is a popular example for something like this.
- 46:31Yeah.
- 46:31Let me give you an example.
- 46:32So like for, in my world, I've, I might hit a button, have to send out thousands of emails
- 46:36like because of that.
- 46:37Right.
- 46:38And then maybe based on, on that, I might, if it bounces, take them out of the email list
- 46:42or whatever.
- 46:43Right.
- 46:43Exactly.
- 46:44You want to record the fact it's a perfect example.
- 46:47So just anything like that for a background task.
- 46:49And that's one of the things too, that we're going to try to make even simpler because we
- 46:52have focused a little bit on the data space and the very easy changes we can make to
- 46:56kind of extend that.
- 46:57And then the second thing, and this is, this is the way I always kind of
- 47:01kind of like to think about Prefect.
- 47:02It's one way you can consider everything I've been saying is we're kind of like the
- 47:06SRE toolkit at the business logic layer.
- 47:09And it's something that kind of everybody could just use just that single pane of glass.
- 47:13You get alerts, you get notifications, you can collaborate with people and it's just
- 47:17kind of all right there for you.
- 47:18And at the end of the day, like, you know, you don't really have to manage the code that
- 47:22much if you're just using the UI.
- 47:23And so I think that's how we can expand by just kind of giving people that value.
- 47:28You want to look at the things that are happening.
- 47:30You want to see a place where all of your systems are just right there.
- 47:33And it's at the business logic layer.
- 47:34You're not looking at CPU and memory all the time, although you could display that if you
- 47:37wanted to.
- 47:38So how about this as an example?
- 47:39I created an e-commerce site and I want to track, I just want visibility into people buying
- 47:45stuff.
- 47:46What's working?
- 47:47What's failing?
- 47:47What's the rate?
- 47:49The bosses.
- 47:50I need something on the web that I can look at this.
- 47:53Exactly.
- 47:54Get reporting.
- 47:55And the key thing here, right, that you said that is like puts it in Prefect's camp
- 47:59and not in, say, Datadog's camp is you want to track the user button click, for example,
- 48:06like some business logic thing.
- 48:09Whereas something like Datadog is an SRE or observability tool that's going to tell you
- 48:14your API throughput.
- 48:15Prefect isn't trying to do negative engineering for your raw infrastructure.
- 48:19It's trying to do it for your business logic.
- 48:21Got it.
- 48:21Okay.
- 48:22Yeah.
- 48:22Very interesting.
- 48:23So Prefect, open source, if I want, I could just take it and do my own thing, right?
- 48:27Oh yeah.
- 48:28Go for it.
- 48:29It is Apache 2.0 licensed as of maybe a month ago.
- 48:35So before we had a few different licenses floating around, but now we're all in, all Apache 2.0.
- 48:39Okay.
- 48:39Give me the elevator pitch on Apache 2.0.
- 48:41So what does that mean that I can do?
- 48:43It means you can do quite literally anything as long as you don't violate trademarks, essentially.
- 48:49And so, you know, don't violate, don't use logos or something like that.
- 48:52So with MIT or something like that.
- 48:53Yeah, exactly.
- 48:54It's very, very generous.
- 48:56You know, you don't have to check with us or anything like that.
- 48:58Sure.
- 48:58Okay.
- 48:59Excellent.
- 48:59Yeah.
- 49:00You guys are doing a lot of stuff, not just with Prefect, but with other projects out there
- 49:04as well, right?
- 49:04Yeah, we are.
- 49:05We really kind of, like I said at the beginning, tried to instill this kind of open source ethos
- 49:10that even at the business layer, like we're trying really hard to genuinely deliver value,
- 49:15right?
- 49:16And that includes to our customers and users, but also to just the broader ecosystem that
- 49:20we find ourselves in, which is exploding right now.
- 49:23And so we have a lot of different efforts that we, yeah, I can definitely go through and list
- 49:27them all like ways we try to contribute back to open source.
- 49:30Yeah.
- 49:31Give us a little bit.
- 49:31So we do a few different things.
- 49:33So one thing that we do is we will send pizza to basically any conference or meetup talk
- 49:39that has a talk featuring Prefect.
- 49:41And so you just have to submit a quick application.
- 49:44We'll probably reach out to you.
- 49:45And then, you know, that's pretty much it there.
- 49:48If you are a Prefect engineer, we have kind of this like advocacy program.
- 49:52And if you get involved with that, we've sent people to conferences before that are not
- 49:57Prefect employees.
- 49:57So that's another thing that we try to give back.
- 50:02More concretely on the business side, we, every engineering team at Prefect, so right
- 50:06now there are five kind of distinct teams.
- 50:08They each get a $10,000 annual budget to sponsor any and all open source projects or just maintainers
- 50:15directly that they think are impactful, maybe for their work or maybe for our ecosystem.
- 50:20And so some of them, just to give you an example, one of the ones that kind of kicked this whole
- 50:24thing off was we sponsor MkDocs material theme, just really slick theming.
- 50:28And so that was, that was the first one.
- 50:30We also sponsor a lot of view projects and we're going to be expanding this to like fast
- 50:34API and some other ones that we just have to, you know, dot our eyes and everything and
- 50:39cross our T's.
- 50:40And then, so this is kind of an escalating rate intensity.
- 50:44And the last thing is we've actually Prefect, the company has gotten into investing in certain
- 50:51open source tools that we think are very compatible with some of the things we want to do.
- 50:55So the big one, the headline one here is Textualize.
- 50:58So Will, who the author of, yeah, exactly.
- 51:02I always be afraid to say this a lot of things, I'm afraid I'm going to say it wrong.
- 51:04So he's the author of Rich and Textual.
- 51:07And as everyone knows now, it's all out there.
- 51:10So he's building the service Textualize for hosting these text-based terminal applications and
- 51:15distributing them through the web.
- 51:16So in kind of an interesting sense, it's like spiritually similar to the hybrid model,
- 51:21right?
- 51:21You can kind of run one of these agents.
- 51:22And we've always wanted to expose richer interactions with Prefect agents running in
- 51:27your infrastructure through our UI.
- 51:28And like, when we talked to Will, it was like, oh, this is it.
- 51:31This is perfect.
- 51:32And it's got all the right like theming differences.
- 51:35So you'll be able to tell this is something you wrote.
- 51:37It's like very text-driven compared to kind of our more branded, you know, assets lurking around
- 51:42the UI.
- 51:43And so, yeah, we invested in his company, yeah, in their seed realm.
- 51:46I'm really glad to hear that.
- 51:47I'm also really glad for Rich that he's got that going.
- 51:49He's been making such progress.
- 51:51Oh, yeah, yeah.
- 51:52He gets to the top of Hacker News, I feel like, every other day.
- 51:55So I will.
- 51:55I always switch his name.
- 51:56I feel so bad.
- 51:57I'm very happy for Will.
- 51:59And he's been doing so much with Rich.
- 52:00My brother's named Rich.
- 52:01It's a problem.
- 52:02But, you know, you go and I'm finding so many of these projects.
- 52:05I'm like, oh, this is really interesting, especially for our Python Bytes podcast.
- 52:08We're just covering packages and things that are interesting that week.
- 52:12And more often than not, you're like, that's got a really cool UI.
- 52:14Oh, I see in the dependency, you know, requirements.txt or PyProject.toml.
- 52:18Rich is at the heart of making that look good.
- 52:21Oh, yeah.
- 52:22We use it.
- 52:22It is great.
- 52:24Yeah, absolutely.
- 52:25It totally is.
- 52:27So one of the final things I want to talk to you about is creating a business around open source with this very permissible model that you're giving away.
- 52:35And I think it's super admirable.
- 52:37I know there's other companies doing it to various degrees and to various degrees of success.
- 52:43Like MongoDB comes to mind, for example, and, you know, Red Hat and stuff.
- 52:47But all these examples that I see are just are like, fantastic.
- 52:50Look at what you guys are doing.
- 52:52You're investing in other open source projects by having a successful business with this open source core engine as the core.
- 53:02And so I just, you know, wanted to give you a chance to talk about the business model, maybe, you know, riff on that a bit and give people advice out there who are doing their own thing.
- 53:10Like another one that comes to mind is you guys do a lot with Dask and like Coiled is now sort of in a similar position with Dask hosting Dask as a service, sort of.
- 53:19Right.
- 53:19Yeah.
- 53:20And we're partners with Coiled, too.
- 53:21So we keep up to date all our integrations there.
- 53:24So, yeah, our business model for cloud.
- 53:26And it's, you know, unsurprisingly, too, that we're going to get some slight changes, but like spiritually very similar.
- 53:31So first and foremost, we really want to make sure, especially like the hobbyists, the open source projects out there, you can come in and, you know, use the system to actually achieve, you know, powerful use cases for free.
- 53:45And so one of the ways that we came up with our free tier volume, which is 20,000 free task runs a month, is we asked ourselves for just a very bare bones airflow deployment running.
- 53:56Like how many tasks would you turn through a month?
- 53:59And like that's, you could run a business's ETL processes off of that volume.
- 54:04And so that's kind of roughly where we picked this number.
- 54:06So like we do think that this satisfies real business need.
- 54:09And then kind of the reason that you would move out of it would be for kind of pretty standard reasons, right?
- 54:15You want to unlock more scale.
- 54:16Okay.
- 54:17So then you talk to us.
- 54:18You want to add more users because, you know, you're capped on users and maybe even you want more teams.
- 54:24So if you're an actual enterprise, you're presumably going to have some more permission structures that you need to grapple with.
- 54:30And so that's when our enterprise tier comes in, SSO integrations, all of that fun stuff.
- 54:34And kind of this isn't really going to change in spirit for 2.0.
- 54:38It's going to be pretty similar.
- 54:39There's going to be some sort of throughput metric.
- 54:41Maybe it's task runs, maybe it's storage, something else that, you know, a lot of it's free.
- 54:46And then you want to add more users, more workspaces.
- 54:48You start to talk to us and then kind of it grows.
- 54:51You know, if you start to have really big performance needs or you have requirements for data locality and things like that, like we start to talk, you know, enterprise plans.
- 54:59So we try to align it.
- 55:01And one of the things, too, that was insight for me to really think about in the early days was like business models, you're not selling the code you write.
- 55:09And that's why open source, you know, works.
- 55:11There's some value that you're providing and you have to find, figure out what that is.
- 55:16And like for us, it's kind of almost like funny.
- 55:19Having to host and maintain an API locally is negative engine.
- 55:23And so that's not what you're trying to do.
- 55:25You're trying to schedule jobs.
- 55:26And so kind of migrating up to cloud tends to be a natural thing unless you've got the resources to manage it and scale it out, which is also perfectly fine.
- 55:34And the thing is, there's a lot of expertise in running systems like this.
- 55:37Yeah, there really is.
- 55:39Yeah.
- 55:39And the database, too, you want it to be scalable.
- 55:41And yeah.
- 55:42Yeah.
- 55:42So I think there's a lot of value.
- 55:44I think it makes perfect sense.
- 55:45Like give you the core for free and you can run it and you can maintain it.
- 55:50It can be your baby or it can be kind of hands off and we'll take care of it.
- 55:55Like you said, authentication and all that kind of stuff.
- 55:57Yeah.
- 55:58And we have a really active, like a crazy active Slack community.
- 56:03So, you know, if you're doing that yourself and self-hosting, I can go ask there and I'm sure you're going to get a lot of responses.
- 56:09I think there's 16,000 people, something like that in there right now.
- 56:12Wow.
- 56:13Okay.
- 56:13It's active.
- 56:14Like messages pretty much, you know, flying by pretty regularly.
- 56:18And then, oh, our discourse as well is up and coming.
- 56:21Yeah.
- 56:21I think it's worth maybe just highlighting.
- 56:23There's, you guys have almost 9,000 stars on GitHub, which is, that's quite far up there.
- 56:29That's pretty awesome.
- 56:29Yeah.
- 56:30So, yeah, that's, y'all must be proud.
- 56:32Yeah.
- 56:32We, you know, it's always fun when you're open source project.
- 56:35We reached the number one trending repo on GitHub one time.
- 56:38This was maybe two years ago.
- 56:40Oh, wow.
- 56:40We had a random happy hour that night just to celebrate.
- 56:44I was one.
- 56:45How long has it been out?
- 56:47When did you start it?
- 56:47So, let's see.
- 56:48Prefect, the company is four years old.
- 56:52And I believe we open sourced, I want to say, in December of 2018.
- 56:59So, the core, at least, has been out for quite a while.
- 57:02And then cloud was maybe six months later when the first version of cloud got out.
- 57:07Cool.
- 57:07Yeah.
- 57:08So, not brand new, but not super old.
- 57:10Yeah.
- 57:10Battle tested, but definitely still got a lot to build.
- 57:14Yeah, for sure.
- 57:15Did you guys build it on Python 3 only just at that point?
- 57:18Yeah.
- 57:18Python 3 only.
- 57:19Yeah.
- 57:19We try to just build for the future, right?
- 57:22Yeah.
- 57:22Shrinking audience.
- 57:24Yeah.
- 57:24You end up in a place with a lot of negative engineering if you try to support too much too
- 57:29far back, I would say.
- 57:30Yeah.
- 57:30For the community, you got the Slack, and that's pretty awesome.
- 57:32You got the discourse.
- 57:33Then you also have Club 42.
- 57:36And if people just go to your website and they go to a community, they'll see this.
- 57:39You'll see the I Want a Pizza if you've got a user group.
- 57:41But I'm guessing this has to do something with Hitchhiker's Guide.
- 57:45What's the story with this Club 42 thing?
- 57:47Yeah.
- 57:47So, Hitchhiker's Guide definitely is a theme for us.
- 57:50Everyone gets a free copy when you join.
- 57:51Club 42 is our application only.
- 57:55So, you can apply.
- 57:56It's not invite-o.
- 57:57It's a private group of kind of external advocates of prefect.
- 58:02So, people who just really want to get early access to things, who have proven themselves
- 58:06to be the positive forces in our community, which, to be clear, doesn't mean that they're
- 58:10necessarily, like, some of them are technical experts, but you don't necessarily have to
- 58:14be.
- 58:14The point is just that you kind of help our community succeed in whatever way that makes
- 58:19sense.
- 58:19Just keep it healthy.
- 58:20Yeah, yeah.
- 58:21That's fantastic.
- 58:21Yeah, we run, like, special events with them.
- 58:23And they get early access to everything.
- 58:25They were the first people that got Cloud 2.0 access.
- 58:27I think that's really valuable.
- 58:28I think more companies should be doing it.
- 58:30I know MongoDB did that for a while.
- 58:32I don't, I think they stopped.
- 58:33You know, Microsoft has Microsoft MVPs, and I'm pretty sure Docker has something similar.
- 58:37But, yeah, it's a cool idea.
- 58:39I'm glad you guys are doing it.
- 58:40Yeah, it's really fun.
- 58:41And just to kind of get, right, you get a bunch of people all caring about one thing
- 58:45kind of together, and interesting conversations always happen.
- 58:49For sure.
- 58:49All right.
- 58:50We're getting short on our time here, Chris.
- 58:51But I guess one more thing I can imagine, you know, it's, I know a lot of people who are
- 58:58working for amazing companies are starting to reevaluate the amazingness of it now that
- 59:03they've got to go back to the office or like the rules have changed and then they've changed
- 59:08again.
- 59:08And they may be thinking of other positions.
- 59:10What's the hiring situation?
- 59:13You guys have open positions to work on this fun stuff?
- 59:15We do have open positions.
- 59:17We're fully remote.
- 59:18So no worries on that.
- 59:20Although we do have plenty of opportunities for meeting people in person as well, optionally.
- 59:25So we have kind of these hubs that people can apply to and will show up like 20 people at
- 59:29a time and have like a mini internal conference.
- 59:32And we're having our first full company off site later in July.
- 59:34It'd be really fun.
- 59:35But anyways, yes, we have open roles.
- 59:36Highly encouraged.
- 59:37If you don't, so right now the biggest roles on my mind are kind of more in the platform
- 59:42space.
- 59:42So SRE style roles, platform engineer roles.
- 59:45And so if that appeals to you or you have any experience there, let us know.
- 59:48And if you don't see a role on our website that maybe fits you, don't be shy about reaching
- 59:54out because sometimes these things take a long time and let's just formally keep a conversation
- 59:58going and, and yeah.
- 1:00:00Sure.
- 1:00:00Say I have this special power.
- 1:00:02It doesn't match one of your three listings, but I bet it could help somehow, right?
- 1:00:06Exactly.
- 1:00:06Exactly.
- 1:00:07I mean, you know, it happens.
- 1:00:08It happens.
- 1:00:09It's happened to Prefect before.
- 1:00:10So yeah, my email is, is Chris at Prefect.io.
- 1:00:14So you can feel free to just email me.
- 1:00:16Yeah.
- 1:00:16Fantastic.
- 1:00:17That's great.
- 1:00:17All right.
- 1:00:18I think, I think that might be where we got to leave it for data engineering and Prefect,
- 1:00:23but very, very interesting.
- 1:00:25But before we get out of here, you've got to answer the final two questions.
- 1:00:27If you're going to write some Python code these days, what editor are you pulling out?
- 1:00:31Oh, put me on the spot.
- 1:00:33I'm still a Vim user.
- 1:00:35I'm a platform survivalist.
- 1:00:37If I find myself in the, in the corners of an old system, I want to be, I want to feel
- 1:00:41powerful.
- 1:00:41And so Vim's worth it.
- 1:00:43Pretty sure.
- 1:00:43I think there's still a ton of people who are on the Vim and the Emacs.
- 1:00:47I mean, they can't talk to each other.
- 1:00:48They can't, they don't get along.
- 1:00:49I started out programming, but I started out programming, doing Emacs on Silicon graphics
- 1:00:55machines.
- 1:00:56Wait.
- 1:00:56So what's your now editor of choice?
- 1:00:59Right now, these days I'm on PyCharm.
- 1:01:00Okay.
- 1:01:01That's a good choice.
- 1:01:01PyCharm and VS Code seem very, yeah.
- 1:01:03Yeah.
- 1:01:04I use VS Code as well for like small little things.
- 1:01:07And if I'm like, here's my big project, then PyCharm is the choice.
- 1:01:10Yeah.
- 1:01:10And then notable PyPI package, I mean, pip install prefect is one of them, but like
- 1:01:15some library that you've seen that you're like, oh, this thing is amazing.
- 1:01:18I really should tell the world about it.
- 1:01:20Rich in textual for sure.
- 1:01:21Oh yeah.
- 1:01:22FastAPI, I think is amazing.
- 1:01:24I really think that you can scale out some pretty powerful web servers with that.
- 1:01:28It's really pretty amazing.
- 1:01:29I was just doing that before we jumped on the call.
- 1:01:32Oh, nice.
- 1:01:32Nice.
- 1:01:33And then we did mention it earlier.
- 1:01:35Dask is a really powerful Python framework for distributed computing.
- 1:01:40Definitely easy to get started with and really powerful as you scale.
- 1:01:43Those are the ones come to mind immediately.
- 1:01:47Cool.
- 1:01:47Those are all fantastic.
- 1:01:48All right, Chris, final call to action.
- 1:01:50People are interested in prefect.
- 1:01:52What do you tell them?
- 1:01:52What do they do?
- 1:01:53Definitely join our Slack and go to our GitHub.
- 1:01:56That's where you'll really be able to immediately kind of get involved in the action, figure out
- 1:02:00what's going on, just ask around for best practices, how to get started, get some project
- 1:02:05ideas, whatever the case may be.
- 1:02:06Yeah.
- 1:02:06And you have a nice tutorial, but maybe what you would
- 1:02:10recommend Orion docs, orion-docs.prefect.io to like the tutorial to follow along for now?
- 1:02:17Yes.
- 1:02:17Yes.
- 1:02:17I would definitely recommend Orion docs to get started.
- 1:02:21And we'll slowly start making these more discoverable over the coming weeks.
- 1:02:25Well, I'll put it in the share notes so people can get to it.
- 1:02:27Awesome.
- 1:02:28Awesome.
- 1:02:28All right.
- 1:02:29Well, it's really great to chat with you.
- 1:02:30Thanks for being here.
- 1:02:31Yeah.
- 1:02:32Thank you so much, Michael.
- 1:02:32This was really fun.
- 1:02:33Yeah, it sure was.
- 1:02:34Bye.
- 1:02:34This has been another episode of Talk Python To Me.
- 1:02:38Thank you to our sponsors.
- 1:02:40Be sure to check out what they're offering.
- 1:02:42It really helps support the show.
- 1:02:43Starting a business is hard.
- 1:02:45Microsoft for Startups, Founders Hub provides all founders at any stage with free resources
- 1:02:51and connections to solve startup challenges.
- 1:02:54Apply for free today at talkpython.fm/foundershub.
- 1:02:58Want to level up your Python?
- 1:03:00We have one of the largest catalogs of Python video courses over at Talk Python.
- 1:03:05Our content ranges from true beginners to deeply advanced topics like memory and async.
- 1:03:10And best of all, there's not a subscription in sight.
- 1:03:12Check it out for yourself at training.talkpython.fm.
- 1:03:15Be sure to subscribe to the show.
- 1:03:17Open your favorite podcast app and search for Python.
- 1:03:20We should be right at the top.
- 1:03:22You can also find the iTunes feed at /itunes, the Google Play feed at /play,
- 1:03:26and the direct RSS feed at /rss on talkpython.fm.
- 1:03:31We're live streaming most of our recordings these days.
- 1:03:34If you want to be part of the show and have your comments featured on the air,
- 1:03:37be sure to subscribe to our YouTube channel at talkpython.fm/youtube.
- 1:03:42This is your host, Michael Kennedy.
- 1:03:44Thanks so much for listening.
- 1:03:45I really appreciate it.
- 1:03:46Now get out there and write some Python code.
- 1:03:48I'll see you next time.
- 1:04:09Thank you.