django Architecture - Connection Management

preview_player
Показать описание
In this video I explore Django’s architecture especially related to backend connection management and persistent connections.

Fundamentals of Networking for Effective Backends udemy course (link redirects to udemy with coupon)

Fundamentals of Database Engineering udemy course (link redirects to udemy with coupon)

Introduction to NGINX (link redirects to udemy with coupon)

Python on the Backend (link redirects to udemy with coupon)

Become a Member on YouTube

Buy me a coffee if you liked this

Arabic Software Engineering Channel

🔥 Members Only Content


🏭 Backend Engineering Videos in Order

💾 Database Engineering Videos

🎙️Listen to the Backend Engineering Podcast

Gears and tools used on the Channel (affiliates)

🖼️ Slides and Thumbnail Design
Canva


Stay Awesome,
Hussein
Рекомендации по теме
Комментарии
Автор

I feel like Hussain is one of the only YouTubers that actually puts hours into his work. Keep up the good job

phantomrex
Автор

Hussein, I love and appreciate all the content you put out. You truly are a rare breed of teacher.

I can't express my gratitude enough as well as how much you have taught and have helped me throughout my career. I always learn something new when I watch your videos, take your courses, listen to your podcasts or read your articles.

You have this great ability to go very deep into the technology stack without confusing people. Really, not all heroes wear capes.

Also, are we seeing a teaser for a Udemy course here? 👀

Salam from 🇩🇿

samydriss
Автор

I believe the problem is not with Django per say but python's threading model. Yes you guessed right, the GIL. Also to avoid data races, Django has to execute the queries synchronously. Even using async frameworks like django channel, you must wrap your async coroutines with synchronous helpers. Hello GIL

abiiranathan
Автор

Hussain I don't hv words to say, these stuff are absolutely important and these are the actual engineering stuff. I love this content and really appreciate your effort on these videos. There stuff are really important for everyone specially for fresh graduates like me. Again thank you so much. Watching and noting down your videos is my new hobby. Thanks again.

isurucumaranathunga
Автор

Thanks to watching this guy last year, I now understand everything in this video lol. Last year, it felt so foreign. Even before he mentioned cores, i already knew where he was heading. Hussein is an excellent teacher.

imanmokwena
Автор

Really informative video. Make more like these !! We love it.

MakeItStik
Автор

Django is ❤

Thank you Hussein for talking about Django and covering about this topic...

aashayamballi
Автор

Thank you for this amazing video! I would love to see a video on frontend listening models.

matrixtoogood
Автор

As always, great video. Thanks you so much, learned few new things!

_overide
Автор

Great content! Very well explained! Thanks for all the effort you put into this.

KostasPanagias
Автор

Hi Hussein, thanks for such content, it is really helpful and help me to evolve.
I feel like using your old way of explaining stuff (using a PowerPoint presentation) is much easier to follow and make the topic you are trying to explain much simpler, I hope you return back to use it again, Thanks.

malekalhourani
Автор

Great stuff!
it think it worthes mentioning that ORM only lately started being async in a very recent version, which means the thread will keep the request waiting and any other calculation as-well!
we d love to see how to do parallel processing in python and especially Js and Python!

mustaphab
Автор

Great video from one Hussein to another

LOLxUnique
Автор

Very interesting! Can you please make a video on spring/springboot backend architecture?

dipjul
Автор

Hi Hussein, I don't quite agree with your discussion regarding context-switching near the end of the video. Your typical web-server is IO bound and like you explained the worker threads are just mostly sitting idly waiting for a response from the database. If that is the case, why would context-switching be a significant concern? Even if you have a hundred threads, the context switch only happens when there is an actual response from the db server, right? And when it does happen, the cost of the context switch (< 10 μs) is insignificant compared to typical db response times (at least a few milliseconds).

alexsmart
Автор

I highly appreciate your video and the hardwork behind it. One request to you could you please make a same kind of video for hibernate and tomcat. Please...

rizwanfirdous
Автор

🎯 Key Takeaways for quick navigation:

00:00 *🐍 Django simplifies database connections by using objects instead of writing SQL queries.*
01:22 *💻 HTTP requests to Django connect to the database to execute queries and build responses.*
02:56 *📊 Django establishes database connections upon receiving requests, minimizing connection overhead.*
05:37 *🔄 Persistent connections are favored in modern architectures to minimize connection overhead.*
06:19 *🛠️ Django allows configuring persistent connections with 'connection max age=none' for efficient handling.*
07:00 *📄 Django follows a one connection per thread model, limiting connections to the number of threads.*
09:35 *⛔ Django's single connection per thread model can lead to blocking when multiple clients request database connections simultaneously.*
11:57 *🔀 Scaling Django with multiple threads can improve performance but should align with CPU core recommendations to avoid context switching overhead.*

Made with HARPA AI

hxxzxtf
Автор

Very interesting, I would be interested to hear your opinions on Laravel a popular PHP framework.

DanielTateNZ
Автор

I think this is one of the major drawbacks of doing backend processing in django, because if we have to update databases continuously in a background thread, that means we can't use persistent connection as it will keep one of the connections in idle state always

adityajoardar
Автор

Greatly informative like every other video. What do you think about netty and its use cases??

Dinesh-babu