Full Web Apps with FastAPI Transcripts
Chapter: async databases with SQLAlchemy
Lecture: Intro to chapter
0:00 Welcome to the async
0:01 SQLAlchemy chapter. I'm so excited to finally be presenting this part of the course to
0:06 you. We've been building towards this for a long,
0:09 long time, and I'm so excited because this is how we're going to take advantage
0:13 of one of the most powerful features for creating truly high performance web applications with Python.
0:18 Async and await,
0:20 one of the reasons I love FastAPI so much is it makes it
0:24 really, really simple and straightforward to create async
0:27 web applications, you simply use the cool
0:31 async and await keywords that come with Python,
0:33 and it handles the rest at the infrastructure level.
0:36 We can have async and non async code mixed together in different view methods or
0:40 different API methods, and it just knows how to treat
0:43 one as async and one as a regular web method,
0:46 but in order to take advantage of that,
0:48 we have to have async for all the external systems we're waiting on.
0:53 If we're calling an API,
0:54 we need to use some kind of client that understands how to do that
0:57 asynchronously and importantly, one of the biggest things, the biggest systems we wait on
1:02 in web applications is the database.
1:04 In fact, many web applications, I would say, do more processing or computation, spend more
1:10 of their time in the data base layer than they do in the actual web layer
1:14 And with async and await we can take all that time we spend
1:17 in the database and just completely free it up to do way more web processing.
1:22 So this is really, really a key piece of the advantage of FastAPI
1:27 and we're gonna dig into it now. It's gonna be awesome.