Stateful vs Stateless Applications (Explained by Example)
ฝัง
- เผยแพร่เมื่อ 9 ส.ค. 2024
- If you ever wondered the difference between stateless and stateful applications, REST, horizontal scaling versus vertical scaling? We tackle those in a small example. Hope you guys enjoy this quick video. We explain the advantages and disadvantages of each application.
0:00 Intro
1:14 Stateful Application
8:40 Stateless Application
Online diagram tool used in this video: Http://www.gliffy.com
Checkout the rest of the content for more software engineering topics by example.
🏭 Software Architecture Videos
• Software Architecture
💾 Database Engineering Videos
• Database Engineering
🛰 Network Engineering Videos
• Network Engineering
🏰 Load Balancing and Proxies Videos
• Proxies
🐘 Postgres Videos
• PostgresSQL
🧮 Programming Pattern Videos
• Programming Patterns
🛡 Web Security Videos
• Web Security
🦠 HTTP Videos
• HTTP
🐍 Python Videos
• Python by Example
🔆 Javascript Videos
• Javascript by Example
Stay Awesome
-Hussein Nasser
www.husseinnasser.com - วิทยาศาสตร์และเทคโนโลยี
If you were my professor, I would be ready to sit in your lecture for hours. Beautiful explanation
Nikhil Balwani im humbled ❤️ thanks
If he were my professor, I would be sitting at FAANG now.
And you would land any job you want, he exolains concerts with simplicity and efficiency
Check out my new video about stateful apps th-cam.com/video/EKCM1oQQrCM/w-d-xo.html
Watch the new 2019 video Stateless vs Stateful python 🐍 application code examples th-cam.com/video/nhwZn6v5vT0/w-d-xo.html
Even 3 years later this explanation is one of the best on the web. Thanks a bunch mate!
This video makes a lot of other web app concepts so much more clearer. Thanks a mil!
Man am I glad I found someone that really knows how to really explain something. Great video ! 👍🙋♀️
Thank you Claire 🙏 I am glad you enjoyed the content and found it helpful
I work full time as a software developer, I stumbled across this while doing some research, and what can I say? you have an amazing character. Well explained :)
Matthew Spiteri Thank you so much for your wonderful comment. Glad to see fellow software developers here. Best of luck !
Check out my udemy Introduction to Database Engineering course
database.husseinnasser.com
Learn the fundamentals of database systems to understand and build performant backend apps
Been programming over a year and never realized the correlation between REST and Stateless. Mind = blown. THANK YOU.
nice video! i really appreciate videos like this that talk about real concepts/use cases in a simple way that you can watch on down time. keep at it cause it looks like the videos you're making are really cool!
mollycrime Thanks! I try to give examples where I can from my personal experience working with a technology. Appreciate it!
I am hooked to your videos and as a junior back end developer i am learning a lot seeing things from different perspectives in my job. Thankyou so much
Brilliantly and Concisely explained! Thanks a Lot HN!
2:44
4:41 introduction to the problem of stateful application
5:50 problem: impossible to scale up
6:10
6:51 stateful with load balancer
8:36 stateless example
8:52 Alice is using REST, State transfer
11:14 server sends Alice a *token*
11:34 then Alice will send request always with the token
wow, indented sub-chapters. TH-cam should support MD for comments. 🔥🔥
I'm on a marathon of your videos man. Awesome content
Enjoy 😊
dude just thanks, really helped to quickly get a grasp of it
Stateful Example: 1:10
Stateless Example: 8:30
Stateless vs Stateful pros and cons: 13:30
ونعم ابوعلي
This was amazing man!! Loved the way you impart things to the viewers!! High Five!
Brilliant explanation champ! I've watch about 3 or other videos (each being 2 or 3 times longer) and NOT ONE of them came close to explaining it this comprehensively! Well don and a sub from me!
God bless you sir, when no one could explain me this thing...u did it in such a simple way. And yeah that accent of ur's its awesome....I can listen to your lectures for hours
This is the best tutorial I have ever seen in my life. I'm awed!.
I can listen to on any topic you teach, I love your teaching style and voice. I am so glad I came across this channel.
Great video Hussein. Thanks for the example.
Plain and simple. Thanks Hussein
This is outrageously good. Thank you, mate!
very clear and easy to understand by the excellent explanation. Thank you so much.
very well explaining, thank you man !
Very helpful video, thank you!
It's no longer over my head. Thanks
Sending a long ass token of appreciation all the way from India !! Great & Interesting explanation.Thank you !!
Shubham Batham sending a signed and time-stamped response token of love to all my subscribers in india ❤️ passcode to decrypt “stay awesome” thanks for your comment!!
Very well explained! keep the videos coming!
Excellent explanation! Good job.
just learned about load balancers too bless you ser!!!!!!!!
I finally understand this! Thank you
Thank you for simple explanation
Thank you for a great explanation
You explained nicely.. Thanks a lot.
Really beautiful explanation !! Thank you so much
Nice work, appreciate the overview.
Just amazing explanation bro!
Awesome Video ! Glad I found this - I am VERY NEW to Web Dev and this broke this complex subject down easily :) THANKS
Natalie Schulz Glad you find was useful, checkout the rest of the content in the channel where we explain other software engineering topics by example. Cheers :)
Wow ! Simply an amazing explanation, now only I understand what it means 'State Transfer' in ReST, thanks, keep explaining.
loved it. You made it clear to me. Thanks and yes, I subscribed.
Mukesh Singh Rawat thanks Mukesh! Glad I could help and welcome to the community!! Enjoy the content
Good Explanation..Thank you
your channel is a gem!
15 mins of awesome ! Thank you !
Very well explained. Good Job Bro. It clears my concept for stateful and stateless 🌹
Thanks so much for this video tutorial.
This is the best explaination on youtube
Nice explanation ..Thank you
Thank you very much for your videos , I dare anyone to watch you explaining a concept whatever the complexity of the concept and not understand it ❤❤❤
Thanks a lot! It was crystal and clear explanation. Easy to understand. Subscribing you!
Thanks for the sub! appreciate you dear enjoy the content
Very well made. Thanks for the explanation.
I enjoyed it, simple and clear explanation.,
That's some cool explanation.
Best explain ever..Many thanks
🙏
thank you so much that's so helpful
Interesting explanation!
Very well explained, thank you ;)
Just logged in to comment a word of appreciation. Glad I found this channel. Beautiful content
Appreciate it ❤️❤️
It is worthy of investing 14 minutes of your life. Thanks Hussein
Doesn't something like "Reliable Collections" solve the scaling issue for stateful (at least for Service Fabric devs)?
Very good explanation, i want you to teach a whole class of everything i want to learn!!!!
But in a stateful app, the server still has to use cookies to authenticate or recognize the user, and when you meant we have to hit the db every time to query for the token, it sounds pretty bad, but isn't that information also cached somewhere to tie in with the cookie expiry, because if were to really look at it sometime a single page might send around 20 to 30 requests to get different information from a stateless backend(REST) but it cannot afford to authenticate the user 20 times right ?
Wonderful explanation
Hi Hussein, thanks for your channel. I really appreciate the work you are doing on this.
For this video, I would like to know if in the case of stateful app, is it possible to use an "intelligent" LB such that the requests for a given user go always to the same server. In this way we can also have a cache into the servers for their users given that we know they will always use the same one? Something like consistent hashing?
Thanks!
Great video!!! Thanks a ton Sir!
Your explanation is far more better than my college lecturer
Nicely explained in simple way... with real time login application use case scenario.....
Glad you enjoyed it! I made another video about how Amazon Alexa is stateless maybe you will enjoy that as well th-cam.com/video/zhwMv5RxGew/w-d-xo.html
You are a great teacher many thanks!
I try! thank you so much for your lovely comment
Sir, you really explained well. I am a 9th-grade student and I was completely able to understand what you meant.
Great Vids and Great explanation , Love From Indonesia
Steven Humam thanks! Much love to all my Indonesian subs you guys rock!
Awesome video, I understand most of the good points of stateless, I guess making a web application whether a session is an important concern but not important at scaling we probably would use php session as a way to maintain the session or any other programming that gives us this set of tools. but regarding the we wouldn't scale horizontal, thanks man
Kevin Montalvo Flores exactly well said. It is a trade off that you as a software engineer/architect make.
Thank you for this
Excellent explanation Hussein.....
very good explanation, thanks
❤️
best teacher man.
Great..... Thank you
love it..explain so clear
Santosh G glad it was clear to understand! Thanks for your comment
this is amazing channel
If you replacte the DB and using the same DB replications for the same Microservice replication the statefull-problem will be solved?
Good Explanation.. keep up the good work :)
Nagendra Babu thanks dude! Appreciate it
What if we just store the stateful session info in a common distributed cache (in the first example)?
Your explanation made me feel really "cool" and "lit" because I was able to understand this 😂 Definitely giving this video a like! 👍
Jordan Theisen Jordan you are cool and definitely lit 🔥 thanks for your comment!
Great..... friend your teaching is very GOOD..... Thanks.
Jk Sharma :) :) glad You like it! Thanks!!
so state vs stateless is just session vs token? What's does the "state transfer" in REST have to do with it though?
Oh, man...Wonderful!
Great video!
Great video! Thanks
Toufik Kannab :)
You’re the man! Great video my dude, the examples were spot on. Are you independent or do you work at a software company?
Hantzley Audate thanks buddy for the nice comment! I work at a software company called Esri. I do these videos on the side :) glad you like the content!
outrageously good l:D like it ! best way to spend my component afternoon at work on something ludicrous lol
Imad Amahmid haha glad I could provide education and entertainment thanks for watching
Thanks very much you are amazing
Done ✔️ thanks for knowledge 🙏
Well explained. Just watched another video on stateless v stateful and this was my exact question: Wouldnt the ideal be tokenization with API? It seems like a cache has the same issue unless the cache itself is just another word for intermediate database. Thank you for clarifying that this is exactly the case and how this can be accomplished scalably.
Very nicely explained thankyou...
gaurav vijan thanks for your nice comment sir! Glad you enjoyed the video
I know stateful but I'm new to stateless concept. I have a question:
What if I keep session data in a shared service (like Redis) and all of the servers can reach it?
Is it possible and if it is, isn't stateful a better choice than stateless?
Somebody please help me understand this concept. If we have a stateful application and are using load balancing with consistent hashing then that would solve the problem of failed viewProfile request or not?
great explanation
Correct me if i am wrong; if use jwt for session authentication(secrets on server itself) i wouldn't have to make so many calls to db(as when using session keys), making it nearly as efficient as stateful?
Saurabh Agrawal that is correct. JWT is better than session keys, JWTs has signature in them allowing server to quickly verify it Without hitting the db. They are also still stateless because the client sends the jwt with each request. So you can restart the server and the client can hit completely a different server and still be served .
With session keys (what we explained in this video we have to verify the key by hitting the db)
Good question
Check out my JWT video JSON Web Token with NodeJS & Postgres Crash Course
th-cam.com/video/T0k-3Ze4NLo/w-d-xo.html
Excellent!!!!
Great explanatio I think nowadays JWT solved the problem of querying db each time we make request.🤔