[0:00] all right in this video we're going to [0:01] be discussing three main points for [0:02] comparing fast API to the Jango rest [0:05] framework and to know which one is [0:07] better and which one you want to learn [0:09] and use in the future this entire [0:11] comparison comes from sitting across [0:14] from a colleague of mine and we were [0:16] discussing the rapid development of [0:18] Frameworks and libraries and when you [0:20] really start analyzing different [0:22] Frameworks and libraries you notice a [0:25] slight Trend in the similarities between [0:27] them but what you don't see as easy is [0:29] per performance ease of learning and the [0:32] supportiveness from the community so I [0:34] spent hours and hours analyzing data [0:38] points from these three main subjects [0:41] and we'll be using them as the data for [0:43] this video starting with performance let [0:46] me walk you through how I set up the [0:47] performance Benchmark I wanted to create [0:49] a realistic testing environment so I [0:51] designed two identical API endpoints one [0:55] using fast API and the other using Jingo [0:58] rest framework both endpoints were [1:00] tasked with performing similar [1:02] operations which included just basic [1:04] crud operations on a simple database [1:06] model and then returning Json responses [1:09] to ensure overall fairness I deployed [1:11] both applications on the exact same [1:13] server with identical hardware specs I [1:15] used a popular load testing tool called [1:17] Locust to simulate thousands of requests [1:20] per second to these endpoints I chose [1:22] requests per second in latency as my [1:25] primary metrics for comparison as these [1:28] are crucial indicators of just overall [1:30] API performance after running The [1:33] Benchmark for a consistent period I [1:35] gathered the data and compiled it into a [1:37] graph that you see here let's start with [1:40] the requests per second fast API [1:42] significantly outperform Jango rest [1:44] framework handling around 1,000 requests [1:47] per second compared to D Jango rest 300 [1:50] requests per second now this wasn't too [1:52] surprising given the tools in the [1:54] infrastructure of both fast api's [1:56] reputation for being lightweight and [1:58] optimized for high performance due to [2:00] the ASG framework that fast API is [2:02] ultimately built on along with its [2:04] native support for asynchronous [2:05] operations gives it a slight Edge in [2:08] being able to go against requests per [2:10] second now when it comes to latency [2:13] though is where I was a little bit more [2:14] surprised because fast API also came out [2:17] ahead with an average latency of just 50 [2:20] milliseconds where drf's latency was [2:23] around 200 milliseconds this lower [2:26] latency means that fast API can respond [2:28] to client requests very quick in both [2:31] latency and requests per second so when [2:34] it comes to Performance I'm going to [2:36] have to say fast API is the winner but [2:38] now let's switch to point number two [2:40] which is ease of learning now the ease [2:43] of learning Factor largely depends on [2:45] your current background and experience [2:47] Jingo rest framework is built on top of [2:50] like the full Jingo framework you can [2:52] kind of think of Jingo rest framework as [2:54] like an attachment to the larger Jingo [2:57] project so if you already have [2:58] experience with Jingo you will be able [3:00] to quickly pick up jeno rest framework [3:03] as there are a ton of similarities when [3:04] navigating around the project jeno is [3:07] also considered to have a steep learning [3:09] curve but if you already have that out [3:11] of the way and you already know D jeno [3:12] then picking up drf is going to be easy [3:14] as the framework has a lot of those same [3:17] batteries and building blocks fast API [3:19] on the other hand doesn't have the D [3:21] jeno or backend experience you know [3:24] bonus points that you get if you already [3:25] know Jingo um it was designed with the [3:28] idea of being easy to use in being [3:30] developer friendly especially if you are [3:32] really good at python because it comes [3:34] with python type hints fast API um [3:36] leverages Python's modern features like [3:39] type annotations to provide better error [3:40] messages and automatic validating with [3:43] pantic so if you're familiar with pantic [3:46] and you're familiar with python typend [3:48] then that just makes the overall process [3:50] of learning fast API just quicker [3:53] because you can add in data validation [3:55] with pantic you can add in exception [3:57] handling you can add in a lot of things [3:58] very quick cuz it's all based off of um [4:01] python typend now the third point is uh [4:03] quite interesting in my opinion I I love [4:06] this third point and that's the [4:07] supportiveness and the community behind [4:09] each project um the best way to do this [4:11] analysis in in my opinion is kind of [4:14] checking out the GitHub stars jeno is a [4:16] leader with [4:17] 78.6k stars with fast API right behind [4:21] it at 74.8k stars and then jeno rest is [4:25] quite far behind both of them at 28k [4:28] stars if we broke down the application [4:30] into a pie chart so here we can see this [4:32] we can see that fast API is more [4:34] comparable to like jeno when it comes [4:36] into popularity but D jeno is [4:39] significantly older than fast API right [4:42] so when you're talking about popularity [4:44] in the community behind it the best way [4:46] is really seeing like the last few years [4:48] and seeing how the last few years have [4:50] caught up with either one of the [4:52] projects and we know that fast API is [4:55] gaining a ton of traction right now like [4:58] it is shooting up and be I wouldn't be [5:00] surprised if fast API passed jeno in [5:03] another year or two like it is growing [5:05] at a significant speed when it comes to [5:07] just people starring the repository jeno [5:10] has been around for a very long time so [5:11] there's going to be more Legacy projects [5:13] and just projects in general using the [5:15] entire D jeno battery pack and and drf [5:18] sits on top of that right so you can now [5:20] call end points throughout your jeno [5:22] application but when it just comes to [5:23] just creating microservices or API [5:26] endpoints or just the back end and the [5:28] responsibility that the back T fast API [5:31] probably has a bigger supportive group [5:33] when it comes to just back in [5:34] development while jeno probably has a [5:35] bigger supportive group when it comes [5:37] into the framework that can build the [5:39] entire web application but if we're just [5:41] going to compare drf to fast API I'm [5:44] going to have to give that win to fast [5:46] API so now that you have all this [5:48] information you can use it to make um a [5:51] better framework decisions and better [5:52] Library decisions for you and your [5:53] future applications so with that cheers [5:56] friend