1 00:00:05,239 --> 00:00:07,259 [music] 2 00:00:09,825 --> 00:00:11,845 [music] 3 00:00:15,120 --> 00:00:17,760 Great. Welcome back everybody. Um, it's 4 00:00:17,760 --> 00:00:20,880 my pleasure to introduce Jack Reichelt 5 00:00:20,880 --> 00:00:25,080 who's going to give us our next talk. 6 00:00:26,855 --> 00:00:28,875 [applause] 7 00:00:30,960 --> 00:00:34,000 So, good day. Welcome to my talk, 8 00:00:34,000 --> 00:00:36,559 Adventures in Fast API. 9 00:00:36,559 --> 00:00:39,600 Um, this is a weird talk. So, before 10 00:00:39,600 --> 00:00:42,239 introductions, how is this talk weird? 11 00:00:42,239 --> 00:00:43,280 You're going to choose your own 12 00:00:43,280 --> 00:00:45,360 adventure like the old Goosebumps books 13 00:00:45,360 --> 00:00:48,640 if you read them. Um, scan this QR code, 14 00:00:48,640 --> 00:00:52,480 go to that URL. Sorry, it's long. Um, 15 00:00:52,480 --> 00:00:54,719 and you get to vote for which slide we 16 00:00:54,719 --> 00:00:57,920 go to next. So try it out now. You're in 17 00:00:57,920 --> 00:01:00,000 a maze of twisty little passages. We've 18 00:01:00,000 --> 00:01:02,399 got at least one vote, so one person 19 00:01:02,399 --> 00:01:04,159 can't make up their mind. Oh, tell me 20 00:01:04,159 --> 00:01:06,155 this is not everybody. 21 00:01:06,155 --> 00:01:08,175 [laughter] 22 00:01:08,720 --> 00:01:12,479 This was working like there we go. Well, 23 00:01:12,479 --> 00:01:15,325 rip to that. Okay. 24 00:01:15,325 --> 00:01:16,080 [laughter] 25 00:01:16,080 --> 00:01:19,600 Absolutely genuinely devastating. Okay, 26 00:01:19,600 --> 00:01:20,960 we didn't do show of hands. Who wants to 27 00:01:20,960 --> 00:01:24,240 go north? Who wants to go south? The 28 00:01:24,240 --> 00:01:27,840 other one. East has East has this one. 29 00:01:27,840 --> 00:01:31,040 Cool. It's also the introduction. So, 30 00:01:31,040 --> 00:01:33,680 I'm Jack Ryel. I'm a developer. Brackets 31 00:01:33,680 --> 00:01:37,200 maybe not that good. 32 00:01:37,200 --> 00:01:40,079 I'm an educator. I'm a games lover. This 33 00:01:40,079 --> 00:01:42,479 talk hits all three. You get to choose 34 00:01:42,479 --> 00:01:44,640 your path through the game. There 35 00:01:44,640 --> 00:01:46,240 through the through the talk. There are 36 00:01:46,240 --> 00:01:50,600 secret slides to be found. 37 00:01:51,351 --> 00:01:52,240 [laughter] 38 00:01:52,240 --> 00:01:53,439 And we're going to learn a bit about 39 00:01:53,439 --> 00:01:58,479 fast API along the way. So fast API is a 40 00:01:58,479 --> 00:02:02,960 modern fast Python web framework. Uh it 41 00:02:02,960 --> 00:02:06,320 has great performance on par with go 42 00:02:06,320 --> 00:02:09,759 asterisk according to their website. Um 43 00:02:09,759 --> 00:02:12,879 it is easy to use and quick to write and 44 00:02:12,879 --> 00:02:14,879 I think it is the best web framework I 45 00:02:14,879 --> 00:02:18,480 have ever used. Uh I have used it on a 46 00:02:18,480 --> 00:02:19,760 couple of projects now. Going to talk 47 00:02:19,760 --> 00:02:22,080 about one of two of them. Who would like 48 00:02:22,080 --> 00:02:26,640 to hear about how I built this talk? 49 00:02:26,640 --> 00:02:28,160 Who would like to hear about how I built 50 00:02:28,160 --> 00:02:32,200 a backend for a web extension? 51 00:02:32,239 --> 00:02:34,879 I think this talk had it. 52 00:02:34,879 --> 00:02:36,546 Devastated. 53 00:02:36,546 --> 00:02:37,440 [laughter] 54 00:02:37,440 --> 00:02:39,120 So, 55 00:02:39,120 --> 00:02:41,120 this is a dynamic slide deck without an 56 00:02:41,120 --> 00:02:44,461 audience. Um, [laughter] 57 00:02:44,879 --> 00:02:47,680 it has a fast API back end. It has a 58 00:02:47,680 --> 00:02:50,879 React front end. Everything lives in a 59 00:02:50,879 --> 00:02:53,280 database. All of the sides, all of your 60 00:02:53,280 --> 00:02:55,680 votes, which we'll work out what's 61 00:02:55,680 --> 00:02:58,319 happening to them later. Um, there are 62 00:02:58,319 --> 00:02:59,840 websockets being used for real-time 63 00:02:59,840 --> 00:03:01,599 communication. That bit did at least 64 00:03:01,599 --> 00:03:04,159 work. We saw plenty of votes coming in. 65 00:03:04,159 --> 00:03:06,720 Um, and it is open source. Uh, at the 66 00:03:06,720 --> 00:03:08,560 end there'll be links. You can go, you 67 00:03:08,560 --> 00:03:10,239 can comment on the GitHub and say, 68 00:03:10,239 --> 00:03:14,400 "Here's where you got it wrong." Um, 69 00:03:14,400 --> 00:03:16,319 who what would we like to hear about 70 00:03:16,319 --> 00:03:18,319 first? Do we want to have a basic 71 00:03:18,319 --> 00:03:20,959 overview of fast API? Do we want to 72 00:03:20,959 --> 00:03:24,319 learn about Python types and pyantic 73 00:03:24,319 --> 00:03:27,680 which have a which fast API uses a lot? 74 00:03:27,680 --> 00:03:30,239 Or do we want to learn about websockets? 75 00:03:30,239 --> 00:03:33,120 Maybe don't learn from me. [laughter] 76 00:03:33,120 --> 00:03:36,000 Yeah, that's what I thought. Okay, we'll 77 00:03:36,000 --> 00:03:39,599 talk about the websockets. So, 78 00:03:39,599 --> 00:03:41,519 websockets enable real-time 79 00:03:41,519 --> 00:03:43,200 communication. 80 00:03:43,200 --> 00:03:46,080 um they give you a p persistent link 81 00:03:46,080 --> 00:03:50,080 between a server and a client. Normally 82 00:03:50,080 --> 00:03:53,680 when you make an HTTP request you send 83 00:03:53,680 --> 00:03:55,599 off and say hey give me this data or hey 84 00:03:55,599 --> 00:03:57,120 change this data and the server comes 85 00:03:57,120 --> 00:03:58,959 back and says great here's what I've 86 00:03:58,959 --> 00:04:01,280 done thank you very much end of 87 00:04:01,280 --> 00:04:03,280 communication if you wish to communicate 88 00:04:03,280 --> 00:04:05,519 further you need another transaction 89 00:04:05,519 --> 00:04:08,400 another request gets sent websockets 90 00:04:08,400 --> 00:04:10,159 just leave that channel open so you can 91 00:04:10,159 --> 00:04:12,080 say and here's another thing and here's 92 00:04:12,080 --> 00:04:13,599 another thing and also the server can do 93 00:04:13,599 --> 00:04:16,560 the same for you the voting system is 94 00:04:16,560 --> 00:04:18,072 built on them 95 00:04:18,072 --> 00:04:18,160 [laughter] 96 00:04:18,160 --> 00:04:20,720 um except there are problems. These 97 00:04:20,720 --> 00:04:22,160 problems that I'm referring to here are 98 00:04:22,160 --> 00:04:23,440 not these problems that we have 99 00:04:23,440 --> 00:04:26,000 experienced here. [laughter] 100 00:04:26,000 --> 00:04:32,759 These are fresh exciting problems. Um so 101 00:04:36,639 --> 00:04:40,680 why did it go to that slide? 102 00:04:42,720 --> 00:04:43,840 Okay. [sighs] 103 00:04:43,840 --> 00:04:46,960 My I'm very sorry. 104 00:04:46,960 --> 00:04:49,600 Yeah, we're just going to hit refresh 105 00:04:49,600 --> 00:04:53,600 and do things. Why is it I'm so 106 00:04:53,600 --> 00:04:58,680 lied to be honest. Um 107 00:05:00,400 --> 00:05:02,240 the web. 108 00:05:02,240 --> 00:05:04,240 Yes. Now take us to the correct next 109 00:05:04,240 --> 00:05:08,639 slide. There we go. Okay, cool. So 110 00:05:08,639 --> 00:05:12,000 yeah. Yeah. Um 111 00:05:12,000 --> 00:05:14,960 so 112 00:05:14,960 --> 00:05:17,919 the server the fast API server running 113 00:05:17,919 --> 00:05:21,280 in the cloud has multiple workers 114 00:05:21,280 --> 00:05:23,840 these workers don't communicate with 115 00:05:23,840 --> 00:05:26,720 each other they do not share RAM they 116 00:05:26,720 --> 00:05:30,080 don't share the memory state um and so 117 00:05:30,080 --> 00:05:33,199 if all if half the audience joins one 118 00:05:33,199 --> 00:05:35,199 worker and then half the audience joins 119 00:05:35,199 --> 00:05:37,440 another worker it just depends which 120 00:05:37,440 --> 00:05:40,160 worker that the presenter 121 00:05:40,160 --> 00:05:44,479 joins. But there is a solution though. 122 00:05:44,479 --> 00:05:47,199 This solution is called a pub sub 123 00:05:47,199 --> 00:05:50,400 service and it is essentially a 124 00:05:50,400 --> 00:05:52,479 specialized service to help you manage 125 00:05:52,479 --> 00:05:55,520 these websocket connections. Do we want 126 00:05:55,520 --> 00:05:57,280 to hear more about this which is what I 127 00:05:57,280 --> 00:06:00,000 suspect is going wrong or do we want to 128 00:06:00,000 --> 00:06:02,560 be taken somewhere else? 129 00:06:02,560 --> 00:06:06,859 Yeah, thanks. [laughter] 130 00:06:08,400 --> 00:06:12,319 So I use Azure web pub subservice for 131 00:06:12,319 --> 00:06:15,974 this. So what we are all going to do 132 00:06:15,974 --> 00:06:16,800 [laughter] 133 00:06:16,800 --> 00:06:21,214 is blame Microsoft. 134 00:06:21,214 --> 00:06:23,234 [cheering] 135 00:06:25,840 --> 00:06:27,440 And actually I've just had a wild and 136 00:06:27,440 --> 00:06:29,440 wacky idea. We're going to try one thing 137 00:06:29,440 --> 00:06:31,360 very quickly, 138 00:06:31,360 --> 00:06:35,720 which is local. 139 00:06:36,080 --> 00:06:40,840 Yep. Resume session. 140 00:06:41,360 --> 00:06:44,400 Well, that's the wrong slide, but we'll 141 00:06:44,400 --> 00:06:45,759 let that think for a little bit. We'll 142 00:06:45,759 --> 00:06:48,720 kind of carry on over here for a take. 143 00:06:48,720 --> 00:06:50,400 So 144 00:06:50,400 --> 00:06:53,520 the way these work is that the front end 145 00:06:53,520 --> 00:06:55,280 the the various front ends both my 146 00:06:55,280 --> 00:06:57,680 presenter front end your audience voting 147 00:06:57,680 --> 00:06:59,440 front end 148 00:06:59,440 --> 00:07:01,039 they connect and maintain that 149 00:07:01,039 --> 00:07:04,560 communication via websockets 150 00:07:04,560 --> 00:07:07,919 and the back end communicates with this 151 00:07:07,919 --> 00:07:11,360 pub sub service via your standard REST 152 00:07:11,360 --> 00:07:14,400 requests both from the pub subservice 153 00:07:14,400 --> 00:07:18,080 saying hey messages have been sent here 154 00:07:18,080 --> 00:07:20,240 is you know you've told me send these 155 00:07:20,240 --> 00:07:21,680 kinds of messages off to this endpoint 156 00:07:21,680 --> 00:07:24,400 so here you go and the server saying 157 00:07:24,400 --> 00:07:26,400 great I now need you to tell everybody 158 00:07:26,400 --> 00:07:28,880 who is subscribed that I've published a 159 00:07:28,880 --> 00:07:34,880 thing hence pub sub this allegedly helps 160 00:07:34,880 --> 00:07:38,080 ensure that everything works 161 00:07:38,080 --> 00:07:41,080 um 162 00:07:41,360 --> 00:07:43,919 obviously this is a complicated thing 163 00:07:43,919 --> 00:07:46,800 this does not always 164 00:07:46,800 --> 00:07:49,280 I would be more than happy to tell any 165 00:07:49,280 --> 00:07:55,319 of you who hunt me down, let's say what 166 00:07:56,479 --> 00:07:57,680 I'll have a quick squeeze on the other 167 00:07:57,680 --> 00:07:59,360 one. See if it's caught up. See if we 168 00:07:59,360 --> 00:08:01,840 know where that is. What slide are we 169 00:08:01,840 --> 00:08:08,039 on? 13. Let's find out how this behaves. 170 00:08:08,800 --> 00:08:10,879 If you have it on your phones and it's 171 00:08:10,879 --> 00:08:13,199 taken you to the pub sub service thing, 172 00:08:13,199 --> 00:08:15,599 it should say at the top, just vote for 173 00:08:15,599 --> 00:08:17,680 me. Doesn't do it, no worries. We'll 174 00:08:17,680 --> 00:08:19,280 carry on regardless and we'll make 175 00:08:19,280 --> 00:08:25,080 things full screen again. Cool. So, 176 00:08:26,160 --> 00:08:27,520 there was more I was going to say about 177 00:08:27,520 --> 00:08:30,080 both websockets and pubsub. Obviously, 178 00:08:30,080 --> 00:08:31,440 we're going to leave that for a little 179 00:08:31,440 --> 00:08:33,599 bit now. Um, so what would we like to 180 00:08:33,599 --> 00:08:35,200 hear about next? Do we want to hear 181 00:08:35,200 --> 00:08:40,000 about how fast API utilizes Python types 182 00:08:40,000 --> 00:08:44,320 and pedantic and uh in order to make 183 00:08:44,320 --> 00:08:47,600 basically everything much easier? Or do 184 00:08:47,600 --> 00:08:50,560 you want to hear about how it utilizes 185 00:08:50,560 --> 00:08:52,240 uh how it automatically generates your 186 00:08:52,240 --> 00:08:56,640 documentation with uh into the open API 187 00:08:56,640 --> 00:08:58,560 spec. 188 00:08:58,560 --> 00:09:01,279 That was pretty even. I reckon the types 189 00:09:01,279 --> 00:09:02,959 are better than people give them credit 190 00:09:02,959 --> 00:09:06,080 for. So, we're going to go here. And I 191 00:09:06,080 --> 00:09:08,241 am no longer beholdened to numbers. 192 00:09:08,241 --> 00:09:09,920 [laughter] 193 00:09:09,920 --> 00:09:16,000 So, type hints are great in Python. Um, 194 00:09:16,000 --> 00:09:18,720 with just sprinkling a few of them in, 195 00:09:18,720 --> 00:09:20,399 you don't even have to put them on every 196 00:09:20,399 --> 00:09:23,680 variable. You get better autocomplete. 197 00:09:23,680 --> 00:09:26,320 You get improved linting. You just gain 198 00:09:26,320 --> 00:09:29,920 confidence that the logic of your app 199 00:09:29,920 --> 00:09:33,200 works better, that things are what you 200 00:09:33,200 --> 00:09:36,399 expect them to be. Pyantic takes this 201 00:09:36,399 --> 00:09:38,000 one step further and makes it even 202 00:09:38,000 --> 00:09:41,000 better. 203 00:09:48,399 --> 00:09:52,880 This lets you define Hulk classes and 204 00:09:52,880 --> 00:09:56,160 then pass in other objects, other Python 205 00:09:56,160 --> 00:09:58,640 objects, other Python Python 206 00:09:58,640 --> 00:10:01,200 dictionaries and say, "Hey, does this 207 00:10:01,200 --> 00:10:03,920 match the model that I've defined and it 208 00:10:03,920 --> 00:10:06,160 will validate that for you." [snorts] 209 00:10:06,160 --> 00:10:11,440 Fast API uses paid by default. And what 210 00:10:11,440 --> 00:10:13,200 this means is that if you have defined 211 00:10:13,200 --> 00:10:16,000 your models correctly, you don't have to 212 00:10:16,000 --> 00:10:18,240 do any of the validation that you would 213 00:10:18,240 --> 00:10:21,760 normally expect by yourself. 214 00:10:21,760 --> 00:10:26,360 And examples coming. 215 00:10:28,160 --> 00:10:30,079 Cool. 216 00:10:30,079 --> 00:10:34,360 Maybe it hates the full screenness. 217 00:10:35,040 --> 00:10:41,440 Why are we here? Cool. Why are we here? 218 00:10:41,440 --> 00:10:45,480 I don't trust the full screen. 219 00:10:46,720 --> 00:10:48,000 Yeah, that's what I mean. I don't trust 220 00:10:48,000 --> 00:10:50,240 this full screen thing that I was doing. 221 00:10:50,240 --> 00:10:54,959 Um, okay. So, 222 00:10:54,959 --> 00:10:57,040 when it loads, there's a picture. I want 223 00:10:57,040 --> 00:11:03,839 to talk to the picture. And cool. So 224 00:11:03,839 --> 00:11:08,720 fast API gives us uh uses pyantic types 225 00:11:08,720 --> 00:11:11,279 in a few different ways. What we've got 226 00:11:11,279 --> 00:11:15,360 in number one, so this is a relatively 227 00:11:15,360 --> 00:11:20,160 simple but real root on uh one of the 228 00:11:20,160 --> 00:11:23,519 apps I made um for adding a task for 229 00:11:23,519 --> 00:11:27,519 kind of a to-do list type thing. 230 00:11:27,519 --> 00:11:30,240 Point one where we use the pyantic types 231 00:11:30,240 --> 00:11:34,000 is we say we tell it we expect a create 232 00:11:34,000 --> 00:11:37,440 task model in the body. The create task 233 00:11:37,440 --> 00:11:40,399 model and I'll show it on the next slide 234 00:11:40,399 --> 00:11:42,399 has a bunch of fields in it that it 235 00:11:42,399 --> 00:11:44,880 expects you the name of the task the 236 00:11:44,880 --> 00:11:47,200 start date you know start date time end 237 00:11:47,200 --> 00:11:50,399 date time things like that by telling it 238 00:11:50,399 --> 00:11:52,959 we want it in the body we it goes and 239 00:11:52,959 --> 00:11:55,600 expects it to be a JSON blob in the body 240 00:11:55,600 --> 00:11:59,720 of the request 241 00:11:59,920 --> 00:12:03,519 and Pantic and fast API validate this 242 00:12:03,519 --> 00:12:05,680 for you if you get a request that is 243 00:12:05,680 --> 00:12:08,000 missing request parameters, it will 244 00:12:08,000 --> 00:12:10,880 raise an error. If you get a request 245 00:12:10,880 --> 00:12:13,360 that has additional parameters, they 246 00:12:13,360 --> 00:12:17,440 will get properly filtered out. Um, and 247 00:12:17,440 --> 00:12:21,760 so all of this makes it gel quite a bit 248 00:12:21,760 --> 00:12:24,399 nicer together, takes a lot of the load 249 00:12:24,399 --> 00:12:26,240 off 250 00:12:26,240 --> 00:12:28,560 yourself, 251 00:12:28,560 --> 00:12:31,600 then you have a very simple job of 252 00:12:31,600 --> 00:12:34,079 turning it into your task and adding it 253 00:12:34,079 --> 00:12:36,480 to your which is in step two. and adding 254 00:12:36,480 --> 00:12:40,880 it to your database, which looks at that 255 00:12:40,880 --> 00:12:42,480 on the step four, but that's not the 256 00:12:42,480 --> 00:12:44,240 point I'm going to talk about next. 257 00:12:44,240 --> 00:12:48,160 We've also defined up at 3 a public 258 00:12:48,160 --> 00:12:50,079 task. 259 00:12:50,079 --> 00:12:53,680 This lets us go, okay, the task has a 260 00:12:53,680 --> 00:12:55,600 bunch of extra information. We don't 261 00:12:55,600 --> 00:12:59,200 necessarily want to tell our user all 262 00:12:59,200 --> 00:13:01,040 those things. Now, for a task on a to-do 263 00:13:01,040 --> 00:13:04,079 list, we probably do. But for your user 264 00:13:04,079 --> 00:13:07,680 model, you might have, you know, their 265 00:13:07,680 --> 00:13:09,600 authentication question. You might have 266 00:13:09,600 --> 00:13:12,160 their hashed password. These are things 267 00:13:12,160 --> 00:13:14,160 you don't want to just be sending back 268 00:13:14,160 --> 00:13:16,880 out into the world willy-nilly. And so, 269 00:13:16,880 --> 00:13:19,760 you define a public user and filter down 270 00:13:19,760 --> 00:13:22,800 what you wish to return. 271 00:13:22,800 --> 00:13:25,040 And then down step four, we do a model 272 00:13:25,040 --> 00:13:27,839 validate. and you take your task or your 273 00:13:27,839 --> 00:13:30,320 user and you validate it as a public 274 00:13:30,320 --> 00:13:32,560 task or a public user and it will strip 275 00:13:32,560 --> 00:13:34,959 out all that extra stuff, make sure it's 276 00:13:34,959 --> 00:13:36,880 all in the right format and send it on 277 00:13:36,880 --> 00:13:39,279 out. And so this all combines together 278 00:13:39,279 --> 00:13:41,200 to make something really nice and easy 279 00:13:41,200 --> 00:13:44,360 to use. 280 00:13:45,360 --> 00:13:48,720 Host uh defining these pyantic types 281 00:13:48,720 --> 00:13:52,320 also not too tricky. Yeah, nice try. But 282 00:13:52,320 --> 00:13:53,824 unfortunately, 283 00:13:53,824 --> 00:13:55,844 [laughter] 284 00:13:56,160 --> 00:13:58,079 the way I went about it was I just 285 00:13:58,079 --> 00:14:01,839 defined a base task that had the things 286 00:14:01,839 --> 00:14:03,680 that were shared among all the types. 287 00:14:03,680 --> 00:14:05,680 This is the core information of your 288 00:14:05,680 --> 00:14:07,519 task. 289 00:14:07,519 --> 00:14:09,440 Any extra things needed to create a 290 00:14:09,440 --> 00:14:11,440 task, none were needed in this case, so 291 00:14:11,440 --> 00:14:13,760 I just did a pass, but I typed it off 292 00:14:13,760 --> 00:14:15,760 that base task rather than Pyantic's 293 00:14:15,760 --> 00:14:17,920 base model. And then the public task, 294 00:14:17,920 --> 00:14:19,680 which has a bunch of extra information 295 00:14:19,680 --> 00:14:22,160 in it. Now, you'll also notice here I've 296 00:14:22,160 --> 00:14:25,199 got other classes linked in 297 00:14:25,199 --> 00:14:28,800 this all plays really nicely 298 00:14:28,800 --> 00:14:32,320 with SQL alchemy and the OM models 299 00:14:32,320 --> 00:14:35,120 there. And so 300 00:14:35,120 --> 00:14:37,279 getting the steps for the task, I would 301 00:14:37,279 --> 00:14:39,760 just pass in my task model. It knows 302 00:14:39,760 --> 00:14:42,160 about that relationship. It will go, it 303 00:14:42,160 --> 00:14:45,680 will collect them. It will uh validate 304 00:14:45,680 --> 00:14:48,160 them as public steps, bundle all that 305 00:14:48,160 --> 00:14:50,000 up, and your response will include them. 306 00:14:50,000 --> 00:14:52,560 And so as you add new fields, as you 307 00:14:52,560 --> 00:14:56,560 wish to send any extra information, your 308 00:14:56,560 --> 00:14:58,639 models expand, you define new ones. It 309 00:14:58,639 --> 00:15:01,680 is extremely easy just to add them in, 310 00:15:01,680 --> 00:15:05,920 send them out. The as much as I this 311 00:15:05,920 --> 00:15:08,240 pitched as a fast API talk, it 312 00:15:08,240 --> 00:15:11,120 absolutely could be a pyantic talk, they 313 00:15:11,120 --> 00:15:13,680 are very tightly integrated. Pyantic 314 00:15:13,680 --> 00:15:15,760 goes a long way to making fast API 315 00:15:15,760 --> 00:15:17,279 great. 316 00:15:17,279 --> 00:15:19,440 Um, 317 00:15:19,440 --> 00:15:21,440 let's let's abandon the voting. I 318 00:15:21,440 --> 00:15:22,639 appreciate it. I also don't know if 319 00:15:22,639 --> 00:15:24,639 anyone's still voting or if it's just 320 00:15:24,639 --> 00:15:28,800 like this now. Um, 321 00:15:28,800 --> 00:15:32,000 yeah. Cool. Um, so a quick show of 322 00:15:32,000 --> 00:15:33,920 hands. Who would like to know where I 323 00:15:33,920 --> 00:15:35,600 host all of this? How how does the 324 00:15:35,600 --> 00:15:40,000 hosting work for these projects? 325 00:15:40,000 --> 00:15:41,680 And who would like to know where am I 326 00:15:41,680 --> 00:15:43,839 actually putting the data when I run 327 00:15:43,839 --> 00:15:45,519 these things? 328 00:15:45,519 --> 00:15:49,120 I think the data had that. 329 00:15:49,120 --> 00:15:51,279 So 330 00:15:51,279 --> 00:15:53,680 I use Postgress. 331 00:15:53,680 --> 00:15:57,920 Probably many of you do as well. 332 00:15:57,920 --> 00:16:01,519 I use SQL alchemy. It is a great library 333 00:16:01,519 --> 00:16:06,240 for OM in Python. Uh it lets you manage 334 00:16:06,240 --> 00:16:08,880 your models quite nicely. Handles a lot 335 00:16:08,880 --> 00:16:10,959 of the 336 00:16:10,959 --> 00:16:13,680 querying building of those queries. 337 00:16:13,680 --> 00:16:16,079 helps protect you from SQL injection in 338 00:16:16,079 --> 00:16:18,959 how the queries get built. 339 00:16:18,959 --> 00:16:20,720 I think that works very well. As I 340 00:16:20,720 --> 00:16:22,800 mentioned before, it works great with 341 00:16:22,800 --> 00:16:25,120 Pyantic 342 00:16:25,120 --> 00:16:28,560 and there is a tool limbic 343 00:16:28,560 --> 00:16:31,040 uh which gives 344 00:16:31,040 --> 00:16:33,839 uh which enables migrations for easy 345 00:16:33,839 --> 00:16:36,839 management. 346 00:16:37,360 --> 00:16:39,440 This is not a particularly complicated 347 00:16:39,440 --> 00:16:42,240 or novel database 348 00:16:42,240 --> 00:16:45,519 layer. uh database stack. Uh I imagine 349 00:16:45,519 --> 00:16:48,480 many of you have used something more or 350 00:16:48,480 --> 00:16:52,639 less if not identical to this. 351 00:16:52,639 --> 00:16:55,040 I am happy to talk on it more if people 352 00:16:55,040 --> 00:16:57,440 want but I think this is probably one of 353 00:16:57,440 --> 00:17:00,880 the less interesting bits. Now for the 354 00:17:00,880 --> 00:17:03,920 next thing we can go back to that auto 355 00:17:03,920 --> 00:17:06,240 documentation and open API stuff. There 356 00:17:06,240 --> 00:17:08,240 were quite a number of hands for that. 357 00:17:08,240 --> 00:17:12,400 Or also there is a secret slide that we 358 00:17:12,400 --> 00:17:14,319 have got to. 359 00:17:14,319 --> 00:17:18,000 Yeah, I thought so. 360 00:17:18,000 --> 00:17:21,959 Are you sure you want it though? 361 00:17:23,039 --> 00:17:25,199 I don't I don't know. I think this would 362 00:17:25,199 --> 00:17:28,011 have been so much funnier with the votes 363 00:17:28,011 --> 00:17:28,559 [laughter] 364 00:17:28,559 --> 00:17:30,640 and I want you all to know how 365 00:17:30,640 --> 00:17:33,200 devastated I am. 366 00:17:33,200 --> 00:17:35,840 Okay. 367 00:17:35,840 --> 00:17:40,400 So the secret is my big secret to all 368 00:17:40,400 --> 00:17:43,520 development. This is 369 00:17:43,520 --> 00:17:46,559 truly I think the most important thing 370 00:17:46,559 --> 00:17:49,440 to recognize for any project that you 371 00:17:49,440 --> 00:17:52,919 are working on. 372 00:17:55,522 --> 00:17:57,542 [laughter] 373 00:17:58,142 --> 00:17:59,120 [cheering] 374 00:17:59,120 --> 00:18:02,727 That is not that's not the 375 00:18:02,727 --> 00:18:03,600 [applause] 376 00:18:03,600 --> 00:18:06,799 Uh, did anyone even see which one it 377 00:18:06,799 --> 00:18:12,720 was? Yep. Yep. 23. Yeah. 26. I'm just 378 00:18:12,720 --> 00:18:15,200 going to put that in manually. Love 379 00:18:15,200 --> 00:18:17,440 this. For me, [laughter] the best 380 00:18:17,440 --> 00:18:20,400 framework 381 00:18:20,400 --> 00:18:23,687 is the one that you're familiar with. 382 00:18:23,687 --> 00:18:25,707 [applause] 383 00:18:26,640 --> 00:18:28,720 It is all well and good for me to stand 384 00:18:28,720 --> 00:18:31,360 up here and say, "Hey, use fast API. I 385 00:18:31,360 --> 00:18:33,200 could sing its praises from now until 386 00:18:33,200 --> 00:18:35,679 the cows come home. And truly fast API 387 00:18:35,679 --> 00:18:37,039 is not the thing that is causing the 388 00:18:37,039 --> 00:18:38,320 issues here. [laughter] 389 00:18:38,320 --> 00:18:42,160 Um, and so I will continue to do so. Um, 390 00:18:42,160 --> 00:18:43,360 probably what's causing the issues here 391 00:18:43,360 --> 00:18:46,720 is me, but uh or or Microsoft and we've 392 00:18:46,720 --> 00:18:48,480 all agreed. 393 00:18:48,480 --> 00:18:51,360 You all nodded. 394 00:18:51,360 --> 00:18:53,520 um 395 00:18:53,520 --> 00:18:56,640 for for projects at work, chances are 396 00:18:56,640 --> 00:18:58,480 you are not the person who gets to 397 00:18:58,480 --> 00:19:03,919 choose the framework. And if your boss, 398 00:19:03,919 --> 00:19:07,120 team lead, whoever says use X and you 399 00:19:07,120 --> 00:19:10,720 use Y, that is a poor career decision 400 00:19:10,720 --> 00:19:13,440 and I cannot recommend it. Uh, and if 401 00:19:13,440 --> 00:19:15,840 you are doing a project on your own just 402 00:19:15,840 --> 00:19:19,280 for fun, chances are you care more about 403 00:19:19,280 --> 00:19:22,880 the like the output than how you built 404 00:19:22,880 --> 00:19:25,360 it. And so, whatever helps you build the 405 00:19:25,360 --> 00:19:27,600 thing as fast as possible is the way to 406 00:19:27,600 --> 00:19:30,080 go. Of course, there are exceptions to 407 00:19:30,080 --> 00:19:32,320 this. If you want to learn how to use a 408 00:19:32,320 --> 00:19:34,240 framework, then really you have to use 409 00:19:34,240 --> 00:19:36,400 that one. 410 00:19:36,400 --> 00:19:41,440 Um, and that is the secret. the next SL. 411 00:19:41,440 --> 00:19:42,720 I don't remember if that's the next 412 00:19:42,720 --> 00:19:44,908 slide, but we'll go from here. 413 00:19:44,908 --> 00:19:47,200 [laughter] Um, that's okay. There are 414 00:19:47,200 --> 00:19:48,960 magic buttons that will skip me to the 415 00:19:48,960 --> 00:19:51,458 end when I need to be at the end. 416 00:19:51,458 --> 00:19:53,360 [laughter] 417 00:19:53,360 --> 00:19:56,799 Um, assuming, um, 418 00:19:56,799 --> 00:20:00,240 so all of my fast API projects have been 419 00:20:00,240 --> 00:20:02,160 hosted on Azure. This is because 420 00:20:02,160 --> 00:20:03,840 Microsoft gave me a stack of free 421 00:20:03,840 --> 00:20:06,400 credits from a 422 00:20:06,400 --> 00:20:10,799 Founders Hub startup thing. Um, and it 423 00:20:10,799 --> 00:20:13,039 was pretty good overall, he said, 424 00:20:13,039 --> 00:20:15,360 revising slightly. 425 00:20:15,360 --> 00:20:19,360 Um, I prefer it to AWS. I understand 426 00:20:19,360 --> 00:20:20,880 that 427 00:20:20,880 --> 00:20:22,400 on the one hand, it's a matter of 428 00:20:22,400 --> 00:20:24,640 familiarity. I have used Azure more 429 00:20:24,640 --> 00:20:28,400 recently and more, but 430 00:20:28,400 --> 00:20:32,000 I think that a huge problem with AWS is 431 00:20:32,000 --> 00:20:33,520 that everything gets its own little 432 00:20:33,520 --> 00:20:37,520 arcane code of what what does S3 mean? I 433 00:20:37,520 --> 00:20:40,240 know it stands for something, but 434 00:20:40,240 --> 00:20:43,120 everybody just says S3. What does EC2 435 00:20:43,120 --> 00:20:47,200 mean? What does Beanstalk actually do? 436 00:20:47,200 --> 00:20:47,840 Nobody. 437 00:20:47,840 --> 00:20:50,159 No. [laughter] Yeah, 438 00:20:50,159 --> 00:20:53,840 these don't help you learn the things. 439 00:20:53,840 --> 00:20:57,360 The things in Azure tend to be named 440 00:20:57,360 --> 00:21:00,240 about what they do. Now, call it boring, 441 00:21:00,240 --> 00:21:02,240 call it corporate, I call it 442 00:21:02,240 --> 00:21:04,159 understandable. 443 00:21:04,159 --> 00:21:07,919 Things like container web app. 444 00:21:07,919 --> 00:21:12,320 web app web pub sub service. These 445 00:21:12,320 --> 00:21:14,400 things do what they say on the tin and I 446 00:21:14,400 --> 00:21:15,760 think that that is an undervalued 447 00:21:15,760 --> 00:21:18,400 aspect. Um I think their interface is 448 00:21:18,400 --> 00:21:20,400 easier to use as well. Uh I mean 449 00:21:20,400 --> 00:21:22,480 obviously any cloud provider's interface 450 00:21:22,480 --> 00:21:25,600 is going to be esoteric and arcane and 451 00:21:25,600 --> 00:21:28,240 non impossible to use. I think this one 452 00:21:28,240 --> 00:21:32,159 is slightly less impossible to use. Um, 453 00:21:32,159 --> 00:21:35,200 and so if you haven't used it, I would 454 00:21:35,200 --> 00:21:37,200 recommend checking it out, seeing the 455 00:21:37,200 --> 00:21:38,640 earlier point about you got to do what 456 00:21:38,640 --> 00:21:42,200 your boss says mostly. 457 00:21:42,640 --> 00:21:43,919 And we're just going to roll the dice on 458 00:21:43,919 --> 00:21:45,919 what slide we end up on. Apparently, it 459 00:21:45,919 --> 00:21:48,480 might just be this one again. [laughter] 460 00:21:48,480 --> 00:21:49,440 The URL change 461 00:21:49,440 --> 00:21:51,280 the URL. Yeah, this slide's secretly in 462 00:21:51,280 --> 00:21:52,320 here twice. 463 00:21:52,320 --> 00:21:53,440 Oh. 464 00:21:53,440 --> 00:21:55,600 Um, 465 00:21:55,600 --> 00:21:58,400 cool. So 466 00:21:58,400 --> 00:22:01,840 this website is just on app service. The 467 00:22:01,840 --> 00:22:03,600 extensions back end was done on 468 00:22:03,600 --> 00:22:05,919 container app service. I found both of 469 00:22:05,919 --> 00:22:09,280 them pretty easy to use. I've used a 470 00:22:09,280 --> 00:22:10,880 bunch of their other services too. The 471 00:22:10,880 --> 00:22:14,080 pub sub one. I've used uh email sending 472 00:22:14,080 --> 00:22:16,000 service. I've used communication manager 473 00:22:16,000 --> 00:22:18,960 service. I've used Postgress database 474 00:22:18,960 --> 00:22:21,760 for Azure. You'll never guess what that 475 00:22:21,760 --> 00:22:25,919 did. Um, for many of these projects, I 476 00:22:25,919 --> 00:22:28,919 definitely 477 00:22:39,440 --> 00:22:42,559 no worse than AWS. 478 00:22:42,559 --> 00:22:44,559 This is not a Microsoft pitch. Clearly, 479 00:22:44,559 --> 00:22:48,720 I've we all agreed. But [laughter] 480 00:22:48,720 --> 00:22:50,880 and yeah, here's the other here's the 481 00:22:50,880 --> 00:22:52,320 reason why this slide was in here twice 482 00:22:52,320 --> 00:22:54,559 is because depending there two ways to 483 00:22:54,559 --> 00:22:56,159 get to the secret slide. I wanted you to 484 00:22:56,159 --> 00:22:59,280 get to the secret side, it turned out. 485 00:22:59,280 --> 00:23:01,039 And now we're back at the database 486 00:23:01,039 --> 00:23:02,960 because it's just broken my things. This 487 00:23:02,960 --> 00:23:05,340 isn't where we were supposed to be. 488 00:23:05,340 --> 00:23:06,960 [laughter] 489 00:23:06,960 --> 00:23:08,400 That's okay. There's a couple of other 490 00:23:08,400 --> 00:23:11,120 slides at the end. So, 491 00:23:11,120 --> 00:23:13,360 we we're not actually done. There was 492 00:23:13,360 --> 00:23:16,000 more after the end slide because I am 493 00:23:16,000 --> 00:23:20,480 the worst. Um, but you did vaguely 494 00:23:20,480 --> 00:23:23,440 choose a way through this talk. We did 495 00:23:23,440 --> 00:23:25,360 actually see many of the things in the 496 00:23:25,360 --> 00:23:28,480 talk. Some of them less than we might 497 00:23:28,480 --> 00:23:32,000 have. Um, if you wish to look at the 498 00:23:32,000 --> 00:23:34,400 source code for these, you can check out 499 00:23:34,400 --> 00:23:35,679 those. I've just realized that the back 500 00:23:35,679 --> 00:23:37,440 end might be still in private. I'll fix 501 00:23:37,440 --> 00:23:40,640 that after this. Um, if you want to 502 00:23:40,640 --> 00:23:42,400 check out the inspiration for this kind 503 00:23:42,400 --> 00:23:45,840 of talk, RL Stein, shout out. I think 504 00:23:45,840 --> 00:23:48,640 he's dead, but anyway. Um, [laughter] 505 00:23:48,640 --> 00:23:53,679 he still rules. Um, and 506 00:23:53,679 --> 00:23:55,280 you're just going to go to random ones. 507 00:23:55,280 --> 00:23:58,320 Bonus slides statistics. 508 00:23:58,320 --> 00:23:59,919 So, 509 00:23:59,919 --> 00:24:05,360 all up, this deck has 36 slides in it. 510 00:24:05,360 --> 00:24:09,120 These are non-unique slides. 511 00:24:09,120 --> 00:24:12,480 A couple of things. 512 00:24:12,480 --> 00:24:15,200 If you went to them one way, you got one 513 00:24:15,200 --> 00:24:16,480 version. If you went another way, you 514 00:24:16,480 --> 00:24:18,080 got a slightly different version. 515 00:24:18,080 --> 00:24:19,600 Usually, the difference was that you 516 00:24:19,600 --> 00:24:21,840 didn't get shown, oh, do you want to go 517 00:24:21,840 --> 00:24:24,320 to the secret side a second time? On the 518 00:24:24,320 --> 00:24:25,840 other hand, I didn't think it was likely 519 00:24:25,840 --> 00:24:27,440 that the secret side wouldn't be 520 00:24:27,440 --> 00:24:28,960 selected. 521 00:24:28,960 --> 00:24:33,440 There are 53 edges on this graph. 522 00:24:33,440 --> 00:24:36,640 If I counted correctly, there are 65 523 00:24:36,640 --> 00:24:38,720 unique talks I could have given and I 524 00:24:38,720 --> 00:24:40,971 think this is probably the 66th one. 525 00:24:40,971 --> 00:24:42,992 [laughter] 526 00:24:44,247 --> 00:24:46,080 [applause] 527 00:24:46,080 --> 00:24:48,880 Now, 528 00:24:48,880 --> 00:24:50,720 what I'm very curious at and we'll see 529 00:24:50,720 --> 00:24:52,880 how what this has done here is we're 530 00:24:52,880 --> 00:24:54,559 going to check the other tab and run the 531 00:24:54,559 --> 00:24:56,720 query on the database console and see 532 00:24:56,720 --> 00:24:59,679 how many votes and voters we had. I 533 00:24:59,679 --> 00:25:01,600 genuinely don't know what will happen 534 00:25:01,600 --> 00:25:04,400 here because clearly it didn't go great. 535 00:25:04,400 --> 00:25:06,880 We had 91 unique voters. That could be 536 00:25:06,880 --> 00:25:08,720 true. There's a lot of you here and we 537 00:25:08,720 --> 00:25:12,080 only had 170 votes. 538 00:25:12,080 --> 00:25:13,279 Look, 539 00:25:13,279 --> 00:25:15,520 that seems unlikely given how many votes 540 00:25:15,520 --> 00:25:18,679 we're changing. 541 00:25:18,720 --> 00:25:22,480 Last up, we have a graph. 542 00:25:22,480 --> 00:25:25,679 This is the talk. 543 00:25:25,679 --> 00:25:31,279 I will let you work out which nodes 544 00:25:31,279 --> 00:25:33,520 you saw, which nodes you didn't. I'll 545 00:25:33,520 --> 00:25:37,360 let you work out where it starts. Um, 546 00:25:37,360 --> 00:25:38,960 but 547 00:25:38,960 --> 00:25:40,640 uh, and in case anyone's wondering, I 548 00:25:40,640 --> 00:25:43,120 just made this with a tool called y and 549 00:25:43,120 --> 00:25:46,400 then it has a auto layout button. Uh, I 550 00:25:46,400 --> 00:25:47,919 I did not bother laying all this out, 551 00:25:47,919 --> 00:25:50,400 which is why some things just get 552 00:25:50,400 --> 00:25:52,720 unrelated to their other ones. They just 553 00:25:52,720 --> 00:25:54,000 get moved over to the other side. It 554 00:25:54,000 --> 00:25:55,039 doesn't know that they're actually 555 00:25:55,039 --> 00:25:57,039 related. 556 00:25:57,039 --> 00:25:59,600 So, with that, I think I've got a little 557 00:25:59,600 --> 00:26:02,880 bit of time for questions. Um, don't ask 558 00:26:02,880 --> 00:26:05,467 the question that you know to not ask. 559 00:26:05,467 --> 00:26:07,487 [laughter] 560 00:26:07,600 --> 00:26:08,960 Yeah, there's a I think there's a 561 00:26:08,960 --> 00:26:12,360 microphone coming. 562 00:26:12,960 --> 00:26:16,080 Thank you. The issue was in your front. 563 00:26:16,080 --> 00:26:18,159 I pushed the PR. 564 00:26:18,159 --> 00:26:18,960 It was what? 565 00:26:18,960 --> 00:26:21,843 It was in your front end. I pushed a PR. 566 00:26:21,843 --> 00:26:23,153 [laughter] 567 00:26:23,153 --> 00:26:23,200 [applause] 568 00:26:23,200 --> 00:26:24,960 Shout out 569 00:26:24,960 --> 00:26:27,793 my man. [cheering] 570 00:26:30,320 --> 00:26:33,688 Yeah. Cool. [laughter] 571 00:26:34,000 --> 00:26:36,559 That was a question. 572 00:26:36,559 --> 00:26:38,240 Anyone else? 573 00:26:38,240 --> 00:26:40,893 Yeah. [laughter] 574 00:26:41,440 --> 00:26:42,000 Hang on. 575 00:26:42,000 --> 00:26:43,760 He has a mic coming. 576 00:26:43,760 --> 00:26:44,640 Thank you. 577 00:26:44,640 --> 00:26:46,159 Uh you mentioned you got some free 578 00:26:46,159 --> 00:26:47,919 credits from Azure and it was for a 579 00:26:47,919 --> 00:26:50,880 special event or something. No, the the 580 00:26:50,880 --> 00:26:53,200 Microsoft Founders Hub, you say, "I have 581 00:26:53,200 --> 00:26:55,520 a startup. Please give me free Azio." 582 00:26:55,520 --> 00:26:57,120 And they say, "Here you go. Have a whole 583 00:26:57,120 --> 00:26:59,760 stack of free credits for a year." Um, 584 00:26:59,760 --> 00:27:03,440 and I did not use enough of them for 585 00:27:03,440 --> 00:27:05,360 them to go, you should get more, which 586 00:27:05,360 --> 00:27:07,200 is confusing to me as a model, but 587 00:27:07,200 --> 00:27:10,159 that's what they did. Um, I didn't use 588 00:27:10,159 --> 00:27:11,760 enough to warrant getting more free 589 00:27:11,760 --> 00:27:13,760 things. 590 00:27:13,760 --> 00:27:14,480 Thank you. 591 00:27:14,480 --> 00:27:16,799 No worries. Uh, yeah. Some more 592 00:27:16,799 --> 00:27:18,960 questions. 593 00:27:18,960 --> 00:27:21,448 and then we can all review the PR. Um, 594 00:27:21,448 --> 00:27:22,960 [laughter] 595 00:27:22,960 --> 00:27:25,120 I will review the PR. 596 00:27:25,120 --> 00:27:28,080 Um, I noticed you said you used SQL 597 00:27:28,080 --> 00:27:30,799 Alchemy. I thought with fast API, one of 598 00:27:30,799 --> 00:27:32,799 the kind of parts of the tool chain was 599 00:27:32,799 --> 00:27:34,720 SQL model instead. 600 00:27:34,720 --> 00:27:39,120 Yes, that's a terrific question. Um, 601 00:27:39,120 --> 00:27:41,919 SQL model is being developed uh led by 602 00:27:41,919 --> 00:27:44,720 the same person. It is designed to work 603 00:27:44,720 --> 00:27:46,960 with fast API. 604 00:27:46,960 --> 00:27:49,039 uh when I started the first project that 605 00:27:49,039 --> 00:27:50,559 I did on this which was the web 606 00:27:50,559 --> 00:27:54,000 extension back end uh at the time 607 00:27:54,000 --> 00:27:57,279 certainly the docs for SQL alchemy were 608 00:27:57,279 --> 00:28:00,000 poor and non-existent in various places 609 00:28:00,000 --> 00:28:03,679 um and I was not aware at the time of 610 00:28:03,679 --> 00:28:06,559 how to get uh Olympic to also work with 611 00:28:06,559 --> 00:28:08,159 that I believe Olympic can do the 612 00:28:08,159 --> 00:28:11,200 migrations for SQL model uh but I 613 00:28:11,200 --> 00:28:14,720 definitely wanted migrations and so I 614 00:28:14,720 --> 00:28:17,200 and and SQL model is built on top of SQL 615 00:28:17,200 --> 00:28:19,360 Alchemy. So I just popped the stack, 616 00:28:19,360 --> 00:28:21,279 went down to SQL Alchemy, went from 617 00:28:21,279 --> 00:28:22,080 there. 618 00:28:22,080 --> 00:28:23,120 Yeah. 619 00:28:23,120 --> 00:28:26,480 Uh my question was to do with fast API 620 00:28:26,480 --> 00:28:29,760 and uh Pyantic and the all the type 621 00:28:29,760 --> 00:28:31,440 annotations that you were using. 622 00:28:31,440 --> 00:28:33,919 Um how have you found the dependency 623 00:28:33,919 --> 00:28:35,840 injection as part of that system? 624 00:28:35,840 --> 00:28:38,559 Yeah, we didn't hit that side. Um I 625 00:28:38,559 --> 00:28:40,480 really like the dependency injection 626 00:28:40,480 --> 00:28:45,360 system for fast API. I think that 627 00:28:45,360 --> 00:28:48,399 uh for those who aren't aware, I'm not 628 00:28:48,399 --> 00:28:50,080 going to go to a slide for it. Uh the 629 00:28:50,080 --> 00:28:54,240 dependency injection is like how I in in 630 00:28:54,240 --> 00:28:56,799 that side that we saw where it said uh 631 00:28:56,799 --> 00:28:59,679 get the create task from the body and 632 00:28:59,679 --> 00:29:02,159 that was actually a type on that 633 00:29:02,159 --> 00:29:05,039 parameter. Fast API reads that type and 634 00:29:05,039 --> 00:29:07,520 says, "Oh, well, I know to do these 635 00:29:07,520 --> 00:29:09,360 things when the type is like this." and 636 00:29:09,360 --> 00:29:11,600 it in and then it goes and it gets the 637 00:29:11,600 --> 00:29:13,279 body from the request and injects it 638 00:29:13,279 --> 00:29:14,960 there. There are various other things it 639 00:29:14,960 --> 00:29:16,720 can do. You might have also seen it said 640 00:29:16,720 --> 00:29:19,440 get DB and so it has fetched the 641 00:29:19,440 --> 00:29:21,679 database connection and plumbed it in 642 00:29:21,679 --> 00:29:24,480 there. I think these are really nice. 643 00:29:24,480 --> 00:29:27,520 You can define a custom type that 644 00:29:27,520 --> 00:29:30,159 basically goes to anything any kind of 645 00:29:30,159 --> 00:29:33,840 function that yields some response. uh 646 00:29:33,840 --> 00:29:36,399 the main one being get your database but 647 00:29:36,399 --> 00:29:40,000 also things like get your uh connection 648 00:29:40,000 --> 00:29:43,120 to your web pub sub service um things 649 00:29:43,120 --> 00:29:47,840 like that. These let you really cut down 650 00:29:47,840 --> 00:29:50,000 on the amount of code that you need on 651 00:29:50,000 --> 00:29:57,000 each route of your of your service. 652 00:29:57,039 --> 00:29:58,320 That's the main thing. I think they're 653 00:29:58,320 --> 00:30:01,520 really good. Um uh the trick to remember 654 00:30:01,520 --> 00:30:03,279 if you are then calling another one of 655 00:30:03,279 --> 00:30:06,320 these you need to pass all the 656 00:30:06,320 --> 00:30:08,480 dependencies in yourself. It is just the 657 00:30:08,480 --> 00:30:09,840 first level that gets the dependency 658 00:30:09,840 --> 00:30:12,240 injection. That is my big gripe. I don't 659 00:30:12,240 --> 00:30:14,960 know how you would solve it but also 660 00:30:14,960 --> 00:30:17,279 it's relatively easy to work around. 661 00:30:17,279 --> 00:30:19,919 Great. 662 00:30:19,919 --> 00:30:24,195 Cool. Well, thank you all. 663 00:30:24,195 --> 00:30:26,216 [applause] 664 00:30:29,360 --> 00:30:30,640 Thank you very much, Jack. That was a 665 00:30:30,640 --> 00:30:32,640 very entertaining and very insightful 666 00:30:32,640 --> 00:30:33,440 talk. Thank you. 667 00:30:33,440 --> 00:30:37,351 Yeah. Thank you. [applause]