Andrew Godwin is responsible for South/Migrations, Channels, and much of the new Async work in Django 3+.
Will Vincent 0:05
Hello, and welcome to another episode of Django chat. This week we're joined by Andrew Godwin to talk about all things Django. I'm Will Vincent joined as always by Carlton. Hey, Carlton. Hello that hello world. And Hi, Andrew. Hello. Good to meet you. Yeah, thank you so much for being on This is really exciting because you've been responsible for many cool things in Django in the past and are currently working on really the future of Django. So, lots to cover around async and all the rest that you've done. So maybe let's start off with Can you quickly give us your background on how you got into coding and Django in particular? I can. Yeah,
Andrew Godwin 0:38
so, like, my first foray into coding was a little bit unusual. I started programming ON A PALM PDA, a palm five, to be precise. There is basically this little sort of basic app where you could like write basic programs and do little games like that's where I cut my teeth coding slightly, but you know, and I was one of those like, annoying like, early teenage coders because of this was like 1415 on holiday my parents in Cornwall, just coding in the caravan rather than actually like doing any outdoor holiday things.
Carlton Gibson 1:08
I'm not going outside Yeah, exactly.
Andrew Godwin 1:09
I like also it's Cornwall in summer. It's never that it's sometimes nice. It's a beautiful place when it's sunny. But there's a lot of rain too. But then I took from that when to some PHP to did a lot of PHP when I was sort of start University, that kind of stuff. And then I guess about 2006, I went to work for a company called talkbox, who are an agency in Oxfordshire. And that's where I met Simon Willison and Simon Willison, if you ever met him is an amazingly enthusiastic person. And he within I think two weeks had taken me from writing PHP to writing Django, which of course, was very young at the time, it was pre version 1.0. And so that's kind of my route into Django. And then I've sort of worked with Django ever since I'd say at that point. But on our flight so torch box also where I wrote the first version of South So it's also my you know, I think two summers later, I was doing summers there during universities, I do University during term time, come to summer break, I would then go and work at each box for a few months. And I basically sort of released south and this is back when like Russell was still doing janky evolution there were still like lots of options for Migration frameworks in Django. And I got this email from Jacob, who I'd never met and like vaguely heard of, at this point, Jacob Kaplan moss that is, he's like, Andrew, like, we've seen your release. We're having a panel at Django con, the first Django con in Silicon Valley, would you like to go? I was like, Well, I'm just a student. I don't have the money to fly to America, which I've never been to. And he's like, Oh, no, it's fine. I know, the DSF will cover it, like, like, we will pay for you and give you a scholarship to come out. And so like, and I did like, three or four weeks until the conference, so four weeks notice. I basically go Okay, and then book a ticket ticket to him. Which I've never been to fly out Silicon Valley and like, maybe the most alienating thing. But then the fun is this wonderful community of people who are so supportive and that even that first Django con, I think, like settled me into Django properly. And that's really interesting that even at that early stage, the DSF, still exists already existed. And they were already, you know, sponsoring students to come to conferences, and I'm not sure if it's I my memory does not serve me. Well. It may not be in the DSM in its current form, like some version of something like like Jagger was like, Yes, we can, we can cover the costs for you, basically. And that's what got me out there.
Carlton Gibson 3:33
Right. Fantastic. So that's super and then that we heard tell that there was some kind of celebrity deathmatch panel about migration frameworks. Yes,
Andrew Godwin 3:41
I think it was it was me Simon and Russell Keith McGee on stage. Doing this. I'd like to cite I think it was Simon's one was called Simon had one that was my sequel, only Russell had the rather excellent Jenga evolution. And I had South I'm sort of like we did a little presentation. Did a little chat. But like through the years followed, South slowly became more and more dominant until eventually, it sort of morphed into the rewrite the became Django migrations are now built in.
Will Vincent 4:10
So currently you're at Eventbrite. Yes. What led you to there? Was it as it all been Django or like main developers? Have you done non Django things at various companies along the way,
Andrew Godwin 4:19
it's pretty much all been Django. So like, after after university, I worked talkbox for a year or so. I went then did some freelance work, and worked with a few different companies like mobile radio history, running Django, that kind of thing, and a few other small companies. And then eventually, I settled into doing some contracting for lanyard, which was a sort of event site for discovering professional events was the ideas like, here's all the conferences, you can follow your friends. And that was run again by Simon Willison. So like, my career and Simon's touch points a lot, a lot, a lot of points a long history. And you just sort of follow him along really well. Not quite, not quite, but we I've worked with him on and off for like 1314 years now. And then like, you I enjoy contracting landed eventually someone offered me a short short diversity. Just before this, I had applied for a job at the British Antarctic Survey to be the on site sysadmin at one of the bases in the South Pole and Latika Halle six. And unfortunately, I, that was the year that the BBC documentary series frozen planet had aired. And so the number of applications position went from two to about 40. And I got this very apologetic call from the wonderful people at the Antarctic Survey going it's such an unusually good year and like any other year you we would have hired you but there was somebody who was just more experienced than you and we went for him instead. And so Simon very nicely waited a week and then offered me a full time role landed after after I missed out on my Antarctic base position, but then suits suitable grieving period.
I was very fun. I still am fond of the idea like
I get a chance I'm going down to Antarctica but It's not easy to do, as you can imagine. But then shortly afterwards, like I would start looking for lanyard, and then in 2012 2013, something like that, and landed, got acquired by Eventbrite. And I've been a member ever since.
Carlton Gibson 6:12
Right. Okay. And you still there. And so I mean, and this leads into your kind of work on channels and the async stuff, because you do a lot of the related to the work you do at Ember, I don't know how much you can say about that. And but can you sort of talk about the evolution of the async thoughts and the thoughts around channels? And yeah, for sure, things like that, as one of the things is like,
Andrew Godwin 6:33
Eventbrite has a lot of interesting challenges of Django at scale. Like these days, especially, like, it's just grown and grown over the last five or six years. But interestingly, very little of that is async. A lot of my work that is based on like seeing the challenges of it by faces, and like, how would we tackle them? Like what is the best approach and so, some of those ideas we have tried internally in Eventbrite, some of those ideas are more like they doing things in a large company is different doing them on a volunteer project, so they're better done. Django and they may be brought in later in the future. But a lot of those do stem from like, you know, Eventbrite has a slightly unique traffic pattern and that it deliberately like we deliberately DDoS ourselves, like multiple times a day because our model is we have these things that go on sale, and everyone arrives at once for that event, like in e commerce, like normally ecommerce is like, oh, Christmas is terrible, like Thanksgiving, Thanksgiving, Black Friday, but everything else is quiet. We just have like this very like, gentles demand curve. And then these massive spikes like a few times a day as events sort of go on sale. And so that that's an interesting scaling challenge that some of the things in async are particularly good at coping with.
Will Vincent 7:41
So yeah, it's like Black Friday a couple times every day.
Andrew Godwin 7:43
Right, exactly. But but but much, much shorter and sharper and you get 20 seconds warning,
Will Vincent 7:48
which is always wrong. So we had Simon on just a little while ago to talk a little bit about some of these things. And he mentioned how global event right is so is that it's sort of a continuous throughout the day thing then we're like Europe to America in Asia, or is it? Does it matter? So the geographic range of where those spikes are? It's,
Andrew Godwin 8:07
I mean, yeah, like as we get more global, it's the spikes spread out over the time zones, as you can imagine. But there's, you know, remember, it's still very heavily in Europe and Americas that's where they tend to consecrate but yet they're like, it has started being like a well they happen at 3am. Pacific time to write, like, nobody in the SF office is awake at that point. But we have a wonderful Madrid office, now Madrid might be around like it's trying to, it's trying to make make sure that you have global coverage. But also, you have to just start to code to cope with those things at some point, right? Like, you can't treat everyone specially like, well, we just have to design for this, we have to expect it. And we can't design for it by over provisioning the entire site so that it runs at full capacity all the time. And as waste money says that there's an interesting balance there. async really helps enable,
Carlton Gibson 8:51
but there's interesting questions, I guess, as well as about how fast you can spin up instances and how you know what kind of lead time in you know, there's a spike coming so you you can spend Up instances in advance and then but then there's coordination issues. So you must be using Kubernetes and have problems with Ingress tables and a little the rest you
Andrew Godwin 9:07
have a we have a very curious, like, I can't talk too much about the actual infrastructure stack, like I do work on that. I'm sorry, I sort of like do essary architecture over there these days. But yeah, like a lot of the like, spinning up servers on demand is a difficult proposition. Especially so like our Django app. It's, it's in it's in or near the million lines of code mark, it takes 30 seconds to import all the Python modules into memory. Like they're just so there's so many Python modules that just the import itself is slow. And so like we even have that like cold boot problem of like, well, it's a big ass spinning it up takes a lot of time. And we're trying to break it up and make it into smaller pieces, but it takes time to turn a monolith into into services.
Carlton Gibson 9:49
Right. Okay. And I saw I don't know if this is something you've
Andrew Godwin 9:53
come across or whatever, but I saw on the century blog that they were talking about you rewriting little l In rust or something like that to make to get speed gains there, is that something you might do as well? I mean, honestly, is it rewriting it in Python is kind of in our strategy like, like, it's still a very heavily Python company. And pretty much like the one case we need to speed up like pi pi, pi pi neighbors, that's speed up, right? Like it cost a bit more RAM, but like it made our, our web hooks delivery, like seven times faster, I think. And so they're a place like if you need that trade off, you can still do it within the Python ecosystem. I think there is one piece written in go. But that's because it was a time before async HTTP in Python was ready. So like, we have a live snap viewer where you can see like his seat at the venue, and the seats like vanished in real time, and people pick them so that the whole thing is like live streamed, and that that was written sort of four or five years ago before WebSockets in Python and async. HTTP was a good thing. And so that's all that is written in that little bit is written in go.
Will Vincent 10:59
So So let's talk about channels. Because I think a lot of this is as a Django educator, I get a ton of questions about this because it seems sort of like sexy in the future of Django, but I think most people don't really understand what it is. Actually, I'm curious, could you give the backstory of, of channels and kind of how that's morphed over time to where we are today?
Andrew Godwin 11:20
Yeah, so and channel's history. As you starts away from me, it starts with Emmerich Augusto, one of the Django contributors. And he is responsible for things like the big transaction rewrite, for example. And Emmerich did a lot of work quite a few years ago now on an attempt to do WebSockets with Django, here's sort of a game of life example where every cell around it and socket and that kind of thing. And I looked at that and I talked to him a few times, and I was interested. And also this point, like migrations was done, I'd had a year or two clear of it, so I sort of understood like, I recovered a bit from the burnout that comes with pushing yourself as you can imagine, and then I want any project what seems to be the best thing to do for Django? Like what is what is Django is future. And at that point WebSockets was the new kid on the block. It seems to be the thing everyone wants it. And so I was like, Well, okay, like, let's, let's take a serious look at this. And of course, as I did with South I was like, well, Sal succeeded by being a external project into into Django, and then overtime, becoming very popular, and eventually being merged in. So like, well, let's follow the same principle, right? And so I was like, okay, so channel is going to try and be this separate, sort of third party app. except we're going to sort of fund it under the DSS auspices. So the wonderful folks at Mozilla gave us a grant for I think, $115,000, or there abouts. to fund it for a year or so or a year or two, in fact, ended up being and so like that helped build out and helped have the research. And a lot of what channels is is basically like, how do you take a synchronous Django and not touch it, but some Rap asynchronous around it. So basically, for WebSockets, especially, it doesn't really try and address asynchronous HTTP. It is it's in there. But you can do it. But it's not easy. It's not really designed for that. It's much more about you want either normal, boring synchronous HTTP with Django, or you want flashy WebSockets with channels, but there's very little middle ground between those two.
Will Vincent 13:21
Yeah. And I know, I think it was at Jango. Under the hood, you gave a 15 minute talk where you really went into the details on all this that we can. Do I have that right. It was a Django under the hood. Yes. No,
Andrew Godwin 13:32
the Django code was almost certainly where it was. Yeah.
Will Vincent 13:34
Yeah. So we can link to that. So you don't have to repeat that. So I want to talk more about that. But actually, I wrote it brings up Can you talk about some merging south into Django? What was that like? Because from the outside, I started with Django and South was there and then just kind of magically, it happened. But what was that process like for you personally, and just the logistics of the Django community, because that was is one of the largest, you know, third party packages, becoming into Django, and I have many Third Party ones, you know, Django rest framework don't and probably won't. So curious what was the personally what was that experience? Like? Because I'm sure it was a ton of work and work in ways that aren't obvious from the outside.
Andrew Godwin 14:12
Yeah, it's one of the things I think it's not really obvious to some people is that it wasn't moving south into Django is a full rewrite. So like Django migrations is a from scratch rewrite of South. Basically, I took the, like, six or seven years at that point of lessons from maintaining a migration framework and going okay, like, if I could do it differently, here's what I would do. And this is the one chance we get have breaking backwards compatibility, right? It's like, yeah, we're gonna write a migration path, but that migration path is gonna be like, not particularly fluid, like he had to like basically move to migrations and then run a command, synchronize all up and you're done. And so like that, basically, as I sat down, I planned it all out. I went to Kickstarter. We ran it as a Kickstarter and I think I raised like 17,000 pound sterling, I think so I like that. And that helps again, fund it. So like a lot of One of the things I do is I work four days a week. And the fifth day each week is for open source work, which is I'm very thankful I've had from lanyard, I've had to Eventbrite, like, they've been very supportive in both of these. And like, that money pays the pays for my fifth day a week to work on the projects. And so with migrations, when I was back at Langley, this was, I was doing that. And I was like, Okay, let's, you know, raise the money, so I can fund it and take the salary cut. I mean, it makes sense. And then I sat down, planned out, went to community and said, here's my pitch. Like, I just before the before the death process, so like, we didn't have a depth. So I was like, I just pitched on Django developers and I pitched like, the core team at that point was like, okay, like, this seems like what we want. Does anyone disagree? And I got very little pushback. And the one pushback was like, I have problems per se, like, Yes, I do, too. Here's the list. Here's how we're gonna fix them. And I think everyone agreed, like it's a problem that pretty much every install of Django faces, right, like, almost everyone has that problem with the RM and so That all lined up and I sat down, spend six months to a year, doing the full rewrite, fully testing it and then released it in Django 1.7. And then a few extra fixes and then tight. I'm very thankful to people like Marcus and other people who took over maintenance of it, like, outright sort of done that and burns out a bit. But yeah, it was, it was an interesting time.
Carlton Gibson 16:21
I remember migrating projects, it was, you know, and it just, it was like, our, we've got to change and we've got it, but it was remarkably smooth in the end, like, you know, looking back, you think, oh, it wasn't a pack, you know, in time is pulling your hair out. And but it was, it was well done. You know, it's one of the big milestones in Django has moved from the early days to the later days, I guess, in the 1.7 with the migrations coming in.
Will Vincent 16:45
Exactly. And what what was that collaboration, like? I mean, so was it six months, you just went off and did on your own? Like, how often were you showing the work to others? Like how did that like so how would it be different now with async stuff versus what you did? back then. So yes,
Andrew Godwin 17:00
it back then it was very much I became a hermit. Right. Like, I got approval. I went into the shadows for six months and came back with a basically a beta version. Okay, here you go. You're welcome.
Will Vincent 17:11
Andrew Godwin 17:12
like I wouldn't recommend this, right. It's not a good strategy. But it's also like as a developer, it's my default. I mean, it's hard to get away from that. It's like, Well, some degree of space is nice, too. I mean, you can't second have people second guessing you as much as you're second guessing yourself with some totally, at the same time, like having people to bounce off of is also crucial to like getting good developers. Right. And that one of the things I've learned to Eventbrite is like how to run large projects. It's like, if you look at the async proposal, versus like the migrations proposal, if you go back and look at it, they're structured very differently, like async is structured in a way was like, well, this is a very big project. It needs to be across multiple people. It needs to provide value in incremental steps not be one big dump. And it needs to be like exchangeable between like different people and like it we can pull out any time like that's good. Like, it's Run, like, how I'd run things as a lead engineer at Eventbrite. It's running that way. If like, yeah, we have to have this be small, incremental steps that are all achievable by themselves, rather than Andrew goes through a bunker for a year and writes it.
Will Vincent 18:14
Yeah, I mean, it will obviously link to it. It's It's It's a lengthy document. But I was struck when I read it that it was how iterative it was. I mean, I was quite impressed. Because it's I know, it's very difficult to not just have the idea, but to have the roadmap. And yeah, I guess that that makes sense that doing that professionally, guides the process of doing it in an open source way.
Andrew Godwin 18:33
Yeah. And it's one of the places where like, open source and commercial work often reflect off each other. Like I've taken things from open source, like documentation culture, into red pride, and that's really helped and Simon has to write like, there are things that go both ways. And like running large projects is not a thing you see a lot in open source. And I am determined to not have this be a burnout center again, right like that, that I've learned from the last two times, I would hope and like, even if we just do the first part. It's a win, right? To be gentle, but that's Yeah,
Carlton Gibson 19:02
that's exactly it, even if it even if it's just the view layer that gets, you know, gets async. That's kind of, okay. It'd be nice if we get to the ORM. And we get up. But if we have the view layer, then we can write proper racing apps. And we can embed other apps. And we can do all sorts of really exciting things with just that. And
Andrew Godwin 19:21
right, and I, I think of like, having an async view and routing in the URL layer opens the door to everything else, right. But once you've opened that door, and you can do async def fuse, then like the community can fill in things like if you're doing RM you can, maybe you can pull in like Tom Christie's databases library and do async stuff with that you have all these different options. And so that really, to me is the way of doing this. Like, let's get that first thing unlocked. And like, that first piece of work is arguably the most like, solo piece of work. Like I don't intend to be done by me alone. I'll try it some collaboration but needs to be tightly controlled, needs to like have high. Like, I'll say the word high type like Lots of contact between different people who are working on it and make sure it's a singular, singular vision. So that it comes out, right. Everything else can be, like, you know, like async, forms async, RM async. Cash can be farmed out to different teams, that's going to work fine. And hopefully it's new contributors as well. Like, I'd love to, like, hey, like, we need the cache to be async. We can write your care definition, we can give you some guidance and mentorship. Let's bring on some new contributors to Django as part of that process,
Carlton Gibson 20:28
I think as well that the view layer needs to in a way, it's it's going to be less susceptible to changes going forward. So it kind of almost has to be right or nearly right first time make it, you know, if we mess up the formula, well, we can redo the formula, you know, you know, it wouldn't be the end of the world. But the view layer would be would be annoying to have to introduce breaking changes later.
Andrew Godwin 20:49
And it's notable to that like one of the fun things about going through and doing some of this first parts of the work some of the researchers, you run get blame on some of these few code files. It goes back A decade right? You immediately jumped exactly 1.0 like most of the rest of like, you know, I remember when the current phone system was called new forms, right, like most of the rest of Django has changed over that time. And the view layer is mostly stayed the same. One of the things people don't realize is that Django predates whiskey, like whiskey basically came around kind of from jack like Django and Tolkien and other contemporary frameworks. And so like, in some ways, Django doesn't have a Django is not whiskey all the way through, because it predates it like you go to like flask and books or like, like they are basically written around whiskey. I mean, I've talked to the fast maintainers, like David Lloyd about, like, what it would take for him to support a thing he's like, well, like, it's so deeply ingrained in our stack, there's a lot harder to untwist, and it's possible being sorts of ideas, whereas Django like we have that distance, which means both it's very old code, but at the same time, it's kind of not totally tied to whiskey. Simon talked a little bit briefly about that abstraction when you're creating Django and that's it. Great that that's a Yeah, major strength today that abstraction. I wonder, yeah, I sort of wonder how flask will handle that. It's not a strength. It's an accidental helpful thing, right? And that we get the play.
Will Vincent 22:10
Okay. Strength and strength is the wrong word is
Andrew Godwin 22:13
us not touching for 10 years, maybe your strength is. But again, that's a testament to the original developers. It's run fine for a decade, right? But yeah, again, like, I want to touch it once. I want to increase it. I want to keep the same kind of abstraction because like, I think one of the things appeals people at Django the most is like that very simple, like mapping of like, Hey, you have a function or a class, you put it in a URLs file, bam, it's done. There's no like weird routing. There's no magical objects. There's no like, tracing attributes or like implicitness. Like it's very explicit. And I'm gonna try and keep that design.
Carlton Gibson 22:45
The same. You talked about the experimental work that's gone in the spine. So the ASCII ref, the ASCII standard is just gone to its 3.0 version, or it's version three. And so can you talk just quickly about the ASCII standard and Is that kind of stable? Now? is three going to be around with this for a long time?
Andrew Godwin 23:03
Yeah. So my impression is that three years is very stable. So in many ways, ASCII was one of the goals of the channels project, which was to like channels was both trying to make WebSockets work. Also research into what it means to make an asynchronous Django, like channels was always meant to be the predecessor to Django itself becoming async. But when I started that project, I had no idea what that would look like. And we also didn't realize WebSockets wouldn't be nearly as popular as we thought they would be right? Like, these days, it's like now, like HTTP two is made, like Ajax a lot more reasonable, and like long polling still around, and sockets repeat. It's still used, but they're not as popular as maybe they're not like every sites not using them. And so asking you sort of as he won was this sort of weird internal channels format, as he was born out of the channels to rewrite which we'll maybe go into in a little bit. There's basically sort of like a better version. And then Tom Christie has been instrumental in in ASCII three of like, running a full application Work and using in production and having channels using production and talking to other frameworks. So like, you know, like we've had weigh in from a decent number of Python web frameworks on ASCII three to try and make it something that both seems implementable by servers. Like I've talked to a few different server authors to they're like, this seems okay. Like no one says it's good because no one wants to write new server support. But like, people suggest anything like it seems fine. And web frameworks agree this too, and crucially, as the three is the most looking like whiskey yet, which I think was always the goal of like, it's meant to be a spiritual successor, but not a direct successor,
Will Vincent 24:35
Tom Christie gave a great keynote talk at Django con Europe this year about async and ASCII that will link to for people who want to get up to speed on the terms we're tossing around.
Andrew Godwin 24:47
Yeah, that that talk is also a fantastic dive into his vision for a totally, um, Django like very pure HDI framework, which is fascinating.
Carlton Gibson 24:56
Well, what came from me out the Django con thing was that people were talking about why Do we need as a sink? Well, you know, once this is well, you know, what came from Tom's talk was very clearly that, well, we don't want to have to change language just because we need that extra throughput that async will give us and so pythons got to have a sink and as a great candidate for a Python standard for web frameworks there. And then we'll Why does Django have to have it? Well, because Django is the batteries included web framework in Python. And so you may not be that we need everything that ASCII could offer. But we need something you know, we don't have to change web framework just because you want to build async views. And so I think it's really important. And that, well, that was kind of interesting from the conversations. joking around.
Will Vincent 25:41
Yeah, what's fantastic strength of Django, two that's so mature that it can be this forward looking. It's not just constantly triaging past bugs, you know, it takes up 100% of the bandwidth of the fellows and the core contributors.
Andrew Godwin 25:53
Yeah, I think one of the things about batteries included is that like, some batteries are very easy and some batteries are very hard. Like migrations is a very hard problem. And I think async ranks in category like, it's the thing that we should solve. So everyone else doesn't have to like, like anything security related or like networking related, I think falls in these categories like Django like, you know, fumble doesn't provide things like, you know, nice looking UI libraries. It's, it's better so but other people, like solving async is a thing that like Django, kind of should treat as its core competency, right? Like it has to be baked in.
Will Vincent 26:27
Well, then the security is a good analogy, because I was just, I'm writing a book on Django, which hopefully would be out by the time this comes out. And in the security chapter, basically, it's, you know, you can take off the defaults that Django provides, but think pretty carefully about doing that because it just gives you the guardrails. And it does give you the option to take them off if you want to write raw SQL or you know, but if you don't want to have CRS CSRF tags but it just sort of handles it for you right, because security as also that oh my god, it's such a deep Well of, of knowledge and once you get beyond the sort of basic attacks, it's it's almost kind of infinite. And that's the point of these, the the monthly updates to Django and all the work. So yeah, so one of these areas, that's definitely, if someone else can handle it for the community or the community, a small subset of the community can handle it. For Django developers. It's a huge benefit and doesn't need to be redone each time. Yeah, and you touched on the thing there too, which I think it's important the language like you can remove piece of it right, you can remove the guardrails, like some web frameworks don't have that, like some impediments, all or nothing. I think famously like, like, I don't wish to talk about rails, but my experience working on rails projects was like rails. Yeah, exactly. Like I spent a good six months working on rails projects, and it was very informative. But was well yeah, but it's, it's I mean, yeah, that's what I get that question. A lot of will show us rails. I use Django and I, you know, specifically for beginner, the user authentication in Django is more work than rails. Yeah, because Django then makes it completely customizable. And you can see But we want but it comes at the cost of more upfront time. And so that's kind of what I tell people on the ease of convenience Rails is pretty much near the top. But when you want, you know, the fact that Django is, I don't know, three quarters 80% of the way there but lets you customize it with experience you appreciate that trade off, I think. But it but it's a little bit but it's a little bit of a bump when you're just starting out. It's not all magic.
Andrew Godwin 28:22
Yeah, I totally agree. Like Rails is definitely easy as from from like step one, but Django strength comm like, you know, like, Eventbrite still runs Django. we've replaced like half of it in various pieces, right? Like, we run a different like user authentication framework and cookie system. But like, we can still have the old CSRF system, right, we run a different cache layer, but we still run things like the debt, the DRM pretty much untouched. So that's kind of part of the way like the part of the value I see in Django itself.
Will Vincent 28:50
Yeah, well, I think it's what Instagram swapped out the ORM. So I was wondering, I know they have Facebook has its own solution if that's it, if you can speak broadly. Is that like, Where are the pain points that to the extent these couple of sites that are at massive scale that use Django? Where does Django kind of break down at super scale? Or is it really just specific on the needs of the project? So
Andrew Godwin 29:12
I think one of the I could speak to event right more than scram, but I do know they do run Facebook graph as a data store rather than DRM. But like one of the things we face as a vendor, right is that running at scale means having like, it's it's more problem of engineering teams, right? Like you can't have all the teams running on one big project. It's much easier to have them working on like separate. For other words, I say microservices, but they're not micro, they're sort of like medium sized services. And what that means is like, you now have this whole like service call and routing problem you didn't have before. And crucially, for async, you have this thing where like you're going to your like main view or template logic is going to call like four or five other things to service different parts of the page and wait for them all one come back. If you wait for those serially, you're gonna be waiting a lot longer if you call them all in parallel and get the results in parallel and put them on the page. Because I think independently, I think that's one of the things Django like least I've seen talking to other big sites too. Is that like making sure it can split up more and more and become more independent like that
Will Vincent 30:09
channels version two, I know Carlton, you mentioned that maybe there is more to unpack there about one that will.
Carlton Gibson 30:15
Okay, so one thing you know that that's interesting is what was actually wrong with channels. One because lots of people took channels, one, they built good sites, they were using it very well. And yet you weren't happy. And other people using it at scale perhaps weren't happy. So what was the what was the issue with channels? One, can you if you could explain that I think that's interesting. Yeah.
Andrew Godwin 30:33
And also, I want to explain, like, I do not make the choice to go backwards, incompatible likely to write something that's like, if I make a big jump like that, it's because there's a good reason. And in this case, it's architectural channels. One was written in architecture where you had a server that received WebSockets and HTTP requests. You had a separate server that ran Django and the functions and both of those taught to a central bus which was called the channel layer, which is basically Redis For most installs, this is an interesting architecture in theory. And in again, in theory, if it scales really well, but in practice, it doesn't. In particular, it's very much it's much more fragile. And you're adding in another point of failure to the web flow, like you've gone from running a single server process to running two different processes, and also a communication layer between them. And in the end, like I just couldn't overcome the difficulty of doing all of that, like deploying it was massively confusing. And in many ways, the reason we did that was because channels one, its goal was to work with the LCS at the time, which supported Python two, which meant we couldn't use async IO channels to is a reexamining of the same problem. That channels one was a solution to that with the different constraint of you can support 3.5 and up and like given those constraints when it was two different designs for like to support Python two, you can't have a synchronous code you have to run in front promises like Redis was your asynchronous scheduler basically, that's how it worked. Whereas with channels to like, well, we have async IO. Now we can do this internally in Python. And sure there are a few issues. async IO is not totally perfect. But having it in process is way easier. And having the deploy be. Run it like whiskey is also a lot easier to convince people like hey, like, you just run a server and pass Application Object like you used to, rather than running a red wet Redis cluster. You can't shard properly and all that jazz. Yeah, okay.
Carlton Gibson 32:27
Right. And should you as well, like deploying Django is hard enough for your average project, right? Without making it extra by having this whole DevOps like, yeah,
Andrew Godwin 32:37
and not to mention, like, you couldn't use Redis cluster because of the way we use Redis. Like it has blocking calls. And so it has to have its own sharding implementation that ran on top of Redis. That sharded. Basically, it was, I'm very impressed. It worked as well as it did in production. I'm very happy that it did. But it just wasn't conducive to long term maintenance and crucially, it's not a patent We could have taken Django itself into, like, we could never make Django like that.
Will Vincent 33:04
Okay. So I, you mentioned a couple times dealing with burnout in your career, which makes sense, given how busy you are. I'm curious how, how do you tell that you're burned out? And then what sort of techniques have worked for you? Because I think this is something that hits almost everyone, maybe not Simon, when we interviewed Simon, I remember saying, like, you're the on burnout, engineer, like he's so enthusiastic. But for everyone else, and for yourself, what kind of how have you spotted it? And then what's you know, what works? Or is it beyond just taking a break from all the extra work that you're doing?
Andrew Godwin 33:39
So I'll preface it by saying like, burnout is deeply personal. And I think like, what works for me does not help people. Right. But like, with that caveat in place, like yeah, my personal signs are generally a lack of enthusiasm, mostly for doing anything, right. It's almost like apathy. So like, like, I go from slyke. Like, the two of you who are here, you can see behind me on the video that I have like, there's so many machine is a 3d printer behind me you can see that like I do a lot of making in my spare time, right? Like when those hobbies start suffering when I know I'm suffering from burnout it's when I'm like making 3d printing and fabrication and like my other like crazy art projects suffer. That's when I know like overall I'm being burnt out and then the way that I found to do that is to step back and I've been more forceful myself over time I used to be like, if I step back like I feel guilty like the community depends on me like everyone's for in different way a bit like your company or your spouse or anyone depends on you. And in the end, like I found that like just you know, like with channels too, at the start of the year I was like, like, I've realized I'm burnt out I mean, there's a I get a month right there's a month to try and find a handover period and Colton very thankfully stepped in to help at that point, but I was like, like it's better to take this project say like it is officially done. And to try keep pushing through the burnout because, like this big room, I have a docking station. wants to is like, it's much more like this, like be honest, right? This is not maintained is much better than say like, Oh, this has the look of being maintained, but it's not actually under the hood. And that's very different.
Carlton Gibson 35:11
Yeah, no, I mean, I think there's a massive the expectation thing that you mentioned is there is absolutely true, especially contributing to open source and there's kind of like this, people get this, this expectation that they have to contribute, they have to triage that extra ticket that they have to. It's like, no, you're volunteering like, and it's much more important is to say no, and that you take the time for yourself so that you enjoy contributing. And, you know, if you can't do that step away, like
Andrew Godwin 35:40
absolute, I also want something that's not obvious to people like, being an open source maintainer is particularly difficult because all you ever get are bugs. And the only feedback you ever see as a maintainer are the problems people have, like I for like seven or eight years of South for all of migrations, and for most of most of channels, like I only ever saw people go It doesn't work for me, it's ruined my life. Like I never, like the only time I ever got positive feedback, basically, at conferences, people come like, Oh yeah, we're using your thing in production. So like $3 million. Like what's, like, that's the only time that's like so like, I encourage you, like, if you're listening, and you have like an open source project to use that you think might not might be in this problem, like,
Will Vincent 36:22
an email to the creator or maintainers saying thank you is always welcome. Like I get a couple of those every month and they're always welcome. Like, just, you know, people reach out and go like, your work is amazing. Thank you very much. Like it honestly, like those will keep me going. Like, yeah, that it's, it's, you know, otherwise you just see like, everyone trying to weird things databases and not succeeding and it just it feels like a huge load, right, like having having that empathy. Everyone is difficult. Why? I remember there was a, there was a permissions mix in the login permissions mixin that someone brought to my attention six months ago, and I looked at the ticket and To the person who had worked on it and shot them a quick email and yeah, they responded as if they never gotten an email thanks and their life about it. So it's, it's certainly helpful. And even for me, like, in a way books are as a form of open source like numbers don't mean anything. It's the personal emails, which aren't that many that make it meaningful and push through the sort of the negative like, yeah, this this is broken kind of stuff, which does get tiring.
Andrew Godwin 37:25
Yeah. And it's just a general thing in life. Like, like, when we work in a volunteer community, it's important to respect each other and make sure like each we like, you know, like, I try to make sure that I thank everyone in person, whoever I carry on who does work that helps me It helps me out. And I think just, you know, if you just have more like going forward, like the Django community is already one of the best communities I've ever been in open source, right. Like it. I joke that sometimes I stick around for the people. But it's kind of
true, right? Like the
group of people around Django, some of the nicest, kindest and best people I've ever like, had the pleasure of interacting with Working with and supporting and just being around. And that's that's a huge part of it. Also, as well, there's a culture where
Carlton Gibson 38:07
correct behavior as expected, and the code of conduct and everything that's done around that is so important. And it just inculcates like once it started, like when when I first turned up to a Django event, I was like, wow, blown away. I've been using Django for 10 years. I've never been to an event. And I came in, I was like, oh, wow, this is what I've been missing. And it was just already there. And in contrast to other environments, where perhaps not it's like, it's really noticeable
Andrew Godwin 38:33
that there's a reason I like I used to fly. I've been to every Gen Con Europe, every Gen Con us for a reason, right? It's not just because I like going to different different random states in the US. It's also because like that, there are people there who are very, like I see them twice a year, but they actually have them some of my best friends.
Will Vincent 38:50
Right. That's kind of kind of the way Django works. I remember my first and only Django con i experienced that and, but most people can't go to Django con yet use Django. So that was really this podcast camp. In part to open up people to the broader community and the people like yourself who have these amazingly outside size roles yet. You know, I would say the majority of people using Django don't know who you are. And more of them should So,
Andrew Godwin 39:15
but also I'm fine with that. Right?
Like one of the thing. Well, yeah, yeah, like
Will Vincent 39:21
yeah, we all want to go off in our cave and do our thing. But you know, we pop our head up every once in a while. It's nice to Yeah,
Andrew Godwin 39:28
yeah. But one of the one of the weird experiences for me was at Gen Con 2009 2010. Like, what second or third one? Someone came up to me when Oh, you Andrew Godwin. I was like, Yes, I know that. Oh, no, I just I just know you from online like that. That was the turn of like, people knowing who I was without me knowing them. And it's honestly a very strange experience. I got much more used to it now. And like I try and meet new people every Django con and try and push beyond my admittedly like very difficult, like introvert boundaries to meet new people. But the same time like yeah, there's like people that like Agha Khan is by its very nature has to be an exclusive event, right? Not everyone can travel and everyone is in the right country or can get visas or whatever. And so I think it's also important that we make sure Django is supportive in other ways too, and that we have a good community online and, you know, in different mediums like that.
Will Vincent 40:17
Well, Carlton was was noticed someone by his voice alone, right at the end of the sprint. like, yo, wait, who are you? Oh, you're that podcast person, right?
Carlton Gibson 40:26
Yeah, I was talking to an issue with a meltdown next to him with their laptop, and all of a sudden they stopped and they're like,
do you do that podcast?
Just talking in their ear?
Will Vincent 40:38
Yeah. Well, I mean, one thing with the Django community, from where I sit, because I think I sort of said, hopefully, maybe near the beginning of the tunnel, and you guys are both at the, you know, very Mount Everest of it is. There's so many people learning Django for the first time who is their first web framework, or, I mean, just the variety of people. I am interact with is unbelievable. It's you know, it's so it's undergrads doing computer science. I mean, just last week, it was multiple tenured Ivy League professors and you know, economics or some other profession who for field for whatever reason, want to learn web stuff. And they're, you know, one of them is like, on track for I look, looked him up on track for like Nobel Prize in Economics and he was stuck on chapter three of my book with Heroku. And I was like, Oh, well, you know, it's I got stuck on it, too, like a lot of people do. But it's this, both this great equalizer. And also, people are just using, you know, Django and web as a piece of whatever they're already doing. Because they see that to be knowledgeable in the modern world. It's such a benefit. And so it's, you know, I just see all this crazy upside to Django as being one of if not the default entryways to web development for people, you know, so I think I would bet the Django will be way bigger than it is now in a couple years. Because those all those people points are going the right direction. I guess. I mean, you I met you for the first time at pi con. I mean, Python is really not about Django and yet it's massive.
Andrew Godwin 42:07
Yeah, exactly. And like, I think one of the things I think the Django contributor contributors over the years have been good at is not forgetting beginners, right? Like, it's very easy to fall into the thing like, oh, like, we've been working on this for like, 510 years. We're now all experts, we should solve the expert problems. And like one of the things I try not to lose, but I do sometimes I try not to lose perspective on is like the beginner view, like what does it mean to sit down for the first time, use this thing? and try and understand the, like, the web is to revolutionary, right? Like we need to keep empower people in that way. Like, what does it sit down on? Sounds like not know how anything's works? Like, I don't want people to know async is until like, at least, you know, chapter nine of any potential book right like they should not have to care about
Will Vincent 42:53
it. I get reminded weekly Yeah, but what are the sticking points? I mean, so that Professor he was it was the structure he was using, start project He didn't include the period. You know, even though I specifically said three times you need to include the period, even though I had the source code, you know, cuz, you know, so it's, so I'm very aware of like, you know that thing. And even actually, last week I got on Friday, I got stuck on a no reverse match error. And I was having an existential crisis over it, because I'm just how much time have I spent on this? I can't believe I'm having this issue. But you know, I asked Carlton, Jose PD, a whole bunch of people and, you know, it wasn't like everyone immediately saw it even among, you know, there's like murderers, row Django people, so programming is very humanizing like that.
Andrew Godwin 43:38
Totally. And it's just async async W. So because like ice struggled to think about like, I was taught like asynchronous, like proof theory University, which is like, it's one of the very few things that come back to actually that was useful and I have used it again, but like, it's so I rarely sit down and just like, just sit there like lie on my bed with like a drink like that. Like I see someone going like, what is this problem? How do we solve it just like thinking it through? Like, it's not easy. And I don't want to like, again, if you want to remove the guardrail and jump into it, we should let you. I also think we should protect you from it unless you really want that.
Carlton Gibson 44:12
Yeah. One thing you've talked about with the proposal is to keep almost keep sync views as the default way of doing it. Because most times, it's easy. Yeah. And that's the one you want to walk into. And then when you want to opt into a sync, then it's there. Not not suddenly, we've got a no JS like web framework, replacing Django, it's not, right, it's not going to be like that.
Andrew Godwin 44:35
Like one of the things you learn when you're writing code, async code is just harder. Like, it's like, you've got more to think about there's there's more time in your brain at once. And I honestly will find any excuse to write synchronous code I can. Because like synchronicity, and the Gil and everything short, it's slower. But it makes it so much easier to think about and understand and like evaluate that sometimes, like if the code is not performance critical. That's great. And like, that's fine. most, most likely Yeah,
Will Vincent 45:02
yeah. So So for people listening, what are some good steps to get involved and learn more? We're going to link to your proposal. What are some what would you say if someone says, Well, I know Django, but I'm async is still new to me in terms of, well, here's how you learn more. And then here are maybe some areas that could use help on
Andrew Godwin 45:21
so I unfortunately, that I have not yet found a good async tutorial, which means I probably have to either write one and get somebody else to write one.
Will Vincent 45:29
But there is for Python or you mean for Python or
Andrew Godwin 45:33
Python or even just the general concept of what it means to have. So like pythons version of async is called uncooperative, asynchronous programming, which is similar to some other languages. But like, for example, NGO is not the same, right? Go is not quite, it's similar, but not exactly the same. Like just like interest, like like, how do you even think about the problem? How do you reason about it, like that's what's missing. At the same time, it's Python. So I suggest you just like, find some just like find a product, just hack on it. Like just little thing that fetches URLs in parallel. And the classic example is you want to fetch like 10 URLs in parallel. And you can do that in like five lines of asynchronous Python, like, do that and like just break it and try and work out why it breaks. Like that's, that's my approach to stuff. And I'd say I'm for Django sec. In general, it seems like depth nine, which is the big long document you referred to earlier, is seems to have sort of settled down and the feedback slow down. So we're going to start pushing it through to the proposal process for the technical board. And once that's done, I'm going to start working on both a house getting involved sort of blog post a document and also a funding one because funding is a big part. Yeah. For us. So like, look forward to those. I don't have them yet. Unfortunately. I took a good one. It may be by the time we released this, this is true. Yes for that. At time of recording, I just come back from two weeks of vacation and we could play on before that. So those are not times when I get get stuck. And we say, Yeah, right.
Will Vincent 47:02
Yeah. What about you, Carlton? Anything to have Yes or no?
Carlton Gibson 47:06
So one thing you've mentioned a couple of times on that front in particular, one thing you mentioned a couple of times is documentation. And I know you're really keen on writing good documentation. The channel's Doc's are just phenomenal to be honest. So yeah. Can you talk about your philosophy there and stuff? Because I think it's something that a lot of people could learn from and I've learned from myself. Yeah,
Andrew Godwin 47:26
I mean, I the philosophy in some ways is self inflicted, because I learnt it when I was looking at my code, and three years prior and going, what was I thinking? So like, like I write documentation for myself in the future is the line I use, right? It's like, Well, okay, like. And to me, though, it's not about how to use it's about how to think, right? It's like, if you're approaching this project, here's the frame of mind. Here's the way that as the authorized maintainer, I approach this project and like that will by itself convey to you like how to approach this like like the channels dogs, for example. A good portion of his concepts is like, here are the concepts. And here are the, here's a glossary of the words we use elsewhere. Because that will get you so much further than me guiding you through it with like hand on hand, because like I could give you lines to run, but you wouldn't understand at the end. Like my philosophy is always like documentation is to teach and to inform your thing exists, and to show you how to approach it, but I'd like you do want, like detailed instructions when you get there. But you have to have the other parts too. That's kind of how I approach it.
Will Vincent 48:31
I think that's well said because I, I noticed, I think meta about things, the difference between documentation and tutorials where people want tutorials, but they sort of need documentation and I think we can say that the fact the channels Doc's in particular, why they're so great is because you also do sort of a tutorial on it. Yeah, you sort of meld those together, but that's a lot of work to do.
Andrew Godwin 48:52
And like we knew we needed to save async to write like there's presumably a part five Part Six of the Django tutorial that is added now. async With some jazz hands in it, but like, as I said, like, like, yeah, there is no good tutorial out there to learn how Python async works. I think it probably then falls to Django as a project to supply that. My hope also, like, you know, documentation is a crucial part of engineering like if you if you have any sort of engineering like engineering is part programming, part documentation, part communication and collaboration. And like those parts all pretty much equal in my experience, and people often put way too much emphasis in programming and not enough on the other to like written and verbal communication is incredibly important. And so a big part as far as like, I want to bring on people that say like, hey, like, like we just need people to who are good at explaining and understanding and honestly like beginners are the best at this. Like, if you are a beginner or relatively new to Django or even to a concept, you are in the best position to explain what was difficult about it. Like your example of the period right? Like, obviously you you huge anticipated that one, but there are things I can't anticipate that like beginners go I found problem x really hard. It's like, oh, that never even occurred to me. It's like an amazing opportunity here for like beginners and people even like one or two years in, they still remember like I forgotten what was hard about Python cuz I started like Python 2.4 where people going oh decorators in Unix icing, like at this point. Yeah, I'm not I'm always a terrible teacher of Python. People come to me and go like, how how'd you learn Python? Like I can tell you but it won't help. It's like all the things that were there into that irrelevant now it's a different way of how they've gone
Will Vincent 50:30
Yeah, well, I find if you just ask if you think something simple ask someone next to you to do it. Like install Python. Here's you know, on Windows machine, go for it. Like you're like, Oh my goodness.
Andrew Godwin 50:42
Yeah, I wish that thankfully, suddenly got a lot easier in the last month or two but yeah, it's, it's it's so many things like that. I want to like make sure that again, like we talked about beginners earlier, right, like, beginners are a crucial part of of Django is ecosystem. I've always made sure I like so a big companies. I don't want to have a slightly captured by big companies, right? And enough people who work with Django and Python in general work at big companies. Like I want to, I want to occasionally forget about the big scale problems and come back to I'm writing my blog, like how to get that stuff working properly. Right. All right, I do still maintain my own Django power blog. Half of this reason, is still on Django, one point 10 I think, unfortunately. But it does use migrations, at least.
Will Vincent 51:23
I'm like, that's kind of my,
Andrew Godwin 51:25
my testbed, like, I'm just like a normal, like, contractor again, like, how do I handle this stuff? It's useful to have.
Carlton Gibson 51:32
Yeah, I think is going
Will Vincent 51:35
to beautiful things about async is that it's coming out of this need that is seen rather than you know, Eventbrite has a specific need, and you are filling that via open source. So in some ways that solves some problems. And that doesn't seem like you feel the burden of building something custom for event writer or someone else for a specific company. It's it can be done in this, you know, community based way whereas many other features on other projects, you know, do have that You know, a large company wants something custom. And then you have trade offs.
Andrew Godwin 52:05
Yeah, a classic example that's Kubernetes. Right? Like Kubernetes is pretty much written how I would think about a enterprise level orchestrator, which means it's very hard to get into, and you can't really run it on a single box. It's getting better. But like, that's what I wanted to avoid and part of channels one and channels two, and like the years of research and talk to people has been working out, like, what is best for everyone like talking to people up and down the spectrum in different countries in different industries of like, hey, like, What do you need? Like what's useful for you? And I think like, the combination of that is like, the icing proposals pretty much like it's the node of like, here is the place where all those needs cross. And like everyone, everyone can agree on this stuff. And I I'm hoping like, the general lack of people going oh, this is terrible idea is proof of that. Right? Like everyone seems to get Oh yeah, we do need this. But also, it's a Vertical thing and like yeah, like if it was just for event right would be a different solution to the problem. But that's not my goal here,
Will Vincent 53:05
Carlton, what were you gonna say before I cut you off?
Carlton Gibson 53:09
I was gonna say something about the previous conversation but so going back to my new minor agreeing with Andrew Okay,
Will Vincent 53:19
I would when I when I edit these podcasts I often hear myself jumping over you Carlton, so I'm
Carlton Gibson 53:23
sorry. That's okay. Did your mom tell you about that as well?
Will Vincent 53:27
Yes, my parents remind me of many. That's okay. helpful things I can improve on that so
Carlton Gibson 53:32
No, that's so super, I think okay, so
Will Vincent 53:35
is there anything else for people to get in touch or what what else do you want to promote? I mean, you have a lot of other projects as well. Andrew, what would you like to say? I wrap this up,
Andrew Godwin 53:45
I have enough other projects that I'm not gonna write any one of them. Like, if you if you if you're interested in like electronics and fabrication, like, you know, I have a YouTube channel and stuff on Twitter, but honestly, like, the thing that like if you listen to this podcast, You're probably involved with Django, what I encourage you to do is, like, Look out, like, get a post on the Django blog probably about tweet about it as well. Like, like, look out for, like I was talking about, like how to get involved. And like, I really want to run async in a way that not only brings in new contributors, but also like, is spread out properly and might be spread the workload. And we have everyone understanding and agreeing on how things work. So I'd love people to like, even if it's just like copy editing documentation, or writing some new tests, like there's so much work that we can do that can be paralyzed out that, you know, don't Don't feel shy about stepping up. Don't feel like you're going to have the burden of the world coming down crashing on you. Like it's not like that. At least not at first. And
Will Vincent 54:44
yeah, so we can make the work a synced?
Andrew Godwin 54:46
Yeah, exactly. Yeah. Like, above all else, like please get involved like not even with this, like, maybe a local like Django girls meetup or like pi ladies or other meetups like open source takes volunteer work. And it takes many volunteers to make it sustainable. So that that's my call to action.
Carlton Gibson 55:04
You're brilliant. All I just add on to that is that as well, if you feel like you need help with that reach out because you have people in the community that will support you in contributing, if you want to contribute,
Andrew Godwin 55:15
people are way nicer than you can credit for is my general advice. I see seen it time and time again, like, especially in the Django and Python communities. I generally expect the best people are usually rewarded, which is which says a lot.
Will Vincent 55:28
Yeah, and if you're reaching out, you're validating house, someone in a position of expertise spends their their time. Yeah, regardless of the question, it's it's sort of validating and it and it provides and it's interesting because it provides that lens on Oh, I I forgot that this was hard or I forgot, you know, that makes sense with your lens. This is how you think about it. So it's it's helpful as well to even someone who's an expert,
Andrew Godwin 55:52
totally, as I said, like beginners have the best questions and often not the best answers. So reach out.
Will Vincent 55:57
All right. Well, thank you so much for taking the time. Come on. As ever, people can find this episode on Jango chat calm. We're on twitter at chat Django and we'll have links to everything in the show notes that we talked about. So thanks again, Andrew for making the time because I didn't have me on. It's been great. All right. Bye