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