Join me as we discuss various software engineering topics with examples and add fun elements to them. We always try to learn by example here in this educational Youtube channel which we believe is the right way to learn. I love Software engineering (especially the backend) and I strive to be a better software engineer every day. Join me on this journey and let us learn together.
All opinions, suggestions, and tips I provide in all of this channel's content are my own. Information provided is for educational purposes only.
Consider becoming a member to support the channel
youtube.com/channel/UC_ML5xP23TOWKUcc-oAE_Eg/join
Check out my courses
courses.husseinnasser.com
Stay awesome!
Hussein Nasser,
www.husseinnasser.com
Feel free to shoot me an email h@husseinnasser.com
twitter: @hnasr
Hussein Nasser
I like how in SQL Server you can limit how much memory granted to a single query. This avoid starving other queries. I think you can do that with CPU too.
Hints should really be normalized in the database world more.
The app often has more context than the database.
7 hours ago | [YT] | 150
View 4 replies
Hussein Nasser
How the Internet works:
1) If the target IP X is within any of your networks, lookup X's MAC and send the packet to it directly
2) If not, find a nexthop device within your network that knows how to reach X. Look up their MAC and send the packet to nexthop.
3) Repeat til X gets it
Step 2 is done with routing table, that gets updated by various protocols so that cost is involved ( shortest path, highest bandwidth )
2 days ago | [YT] | 302
View 20 replies
Hussein Nasser
I built pglocks.org to better understand locking in postgres. I learned since about the different locking techniques, which I compiled in my database course.
If you are interested in database systems, checkout my 30 hours database course.
courses.husseinnasser.com/
$11.99 coupon, expires May 5
6 days ago | [YT] | 389
View 6 replies
Hussein Nasser
You can't understand your SQL query performance by looking at the SQL code. You need the execution plan.
Take the SQL : select id from student where grade >= 99
It doesn’t tell you how fast it will run.
If there isn’t an index on the grade column, it will do a full table scan taking multiple seconds depends on how many rows it returns.
Add an index on the grade field, run the same query now it takes few seconds
Make it a covering index (add id as included column to the grade index) and now it’s an index only scan even faster.
Insert a million students into the table and re execute the query immediately (don’t give a chance for MVCC garbage collection to run) and the query will slow down again, because we need to go to the heap to see if the row is visible.
In all the four examples above the backend app code running the query didn’t change, same code, same query.
However, the performance of the query varies every time based on the state of the database.
The execution plan tells us what how the SQL was executed in each of those four examples. It is the key.
1 week ago | [YT] | 624
View 19 replies
Hussein Nasser
I like asking this question in interviews, it allows for a wide range of beautiful technical conversation.
How would you go about canceling an HTTP request that initiated a long running transaction in the database?
The system is a frontend, api gateway, several backend app servers, a database.
You own it all. You have full control.
2 weeks ago | [YT] | 434
View 46 replies
Hussein Nasser
The best way to work with billions of rows is to avoid working with billions of rows.
Everything from indexing, partitioning, sharding does exactly that.
And ever better if the billions of rows can be avoided all together during the application design.
3 weeks ago | [YT] | 407
View 10 replies
Hussein Nasser
Design choice:
When the db reads a page from disk it needs free memory in the shared buffers to place the page in.
It can:
1) Allocate the memory right there and then
or
2) Allocate all buffers memory at startup, then look for a free slot using a data structure when needed
3 weeks ago | [YT] | 187
View 16 replies
Hussein Nasser
If you built tools, backends and apps on top of this great runtime, understanding how it works will make you appreciate it even more.
Check out my new course Node Internals.
Head to node.win
More courses courses.husseinnasser.com/
1 month ago (edited) | [YT] | 387
View 7 replies
Load more