New Course - Node Internals and Architecture

Hussein Nasser · Beginner ·🏗️ Systems Design & Architecture ·1y ago

Key Takeaways

The video discusses a new course on Node.js internals and architecture, covering topics such as the V8 engine, libuv, event loop, node packages, and performance optimization.

Full Transcript

what's going on guys my name is Hussein and I subscribe to the belief that understanding uh a technology allows us to build better software on top of it and I believe the least understandable technology that and yet the most popular one is is no JS as a runtime so I spent seven months or so the better part of 2024 and 2025 uh just delving into the internals and architecture of nodejs and I found so much Beauty there so I designed this particular course that I titled nodejs internals and architecture to help the engineer look with nodejs with a different perspective in a completely transparent way to write code on top of nodejs and be able to tell exactly what happens behind the scene have you ever run nodejs code and you run it once and it produce an output and you run it again and it produce a different output that is absolutely explainable you can explain why it happens but only when you understand the different phases of the event loop I designed this course to be three major sections the first section is the node architecture what is this V8 engine why do we need it what how does it work what is the optimizations it does compile and to interpret to be specific this the JavaScript into executable code what happens what is the difference between interpreted code and language and compile language what is really the the major difference here so we talk about that talk about V8 in this architecture another component another part of the architecture is the this beautiful Library that's called libuv which is responsible for pretty much anything I owe in njs what is it what are the threadpool that exist in it how does networking Works in this Li in this Library how do we do IO and the major component of this is literally the event Loop what is this event Loop in njz what are the different phases I have a lecture for every single phase because each phase technically deserve its own lecture you know at 30 minutes or so just discussing how an input from one phase goes to the another phase and how do these are linked and why do sometimes when I run something I get the output or flipped all of this can be explainable once we understand it node packages how do node packages modules what is the cost of importing a module what really happens behind the scene understand that just calling Fitch or sorry require module or import module what's the difference what really happens behind the scene and and again you might not be interested and that's fine and again I'm talking about those who who look at this piece of technology and want to kind of explore what's behind and that that's pretty much all my courses are like that and even when you consider taking this course you'll see me just enjoying the process of exploring what's behind the scene and it's so amazing how much stuff what is promises what's a promise really in no JS and and we watch we're going to we're going to watch How to we distill that that you know abstraction down to its basic component it's so beautiful the package managers how do we link together so that's the architecture section then we take a magnifier glass for the second section node internals now let's go deeper in every single major component in note how does node TCP Works how does node DNS work what are the internals of node HTTP what are the internals of node https and I'm now let's link every single thing we learned in the previous architecture right here now show me what happen when I when I receive a request from the client as a server as a njs server what phase get executed is it the poll phase is it the check phase now what kind of phase does the request get executed in and why do we care even well we care because any delay in any of these phases because of code you have inserted will delay the next phase and when you delay the next phase you are potentially blocking the main the the the the event Loop and when you block the event Loop you delay a potential i o to the network which thens getting felt by the client or the server right depends who where are you looking from it's absolutely amazing looking at just taking the lib UV library and then breaking the thread pole and understanding how it does no DNS why when I listen on a port without a host name I can connect immediately but when I listen with the port and a host name the the listening gets delayed I cannot connect immediately it takes me a while what's the difference there is no magic it's just pure understanding of how DNS linked to socket management linked to how the kernel behave and it's all explainable and it feels so good when you understand these kind of things so I dive into lot lots of stuff here I'm looking at the lectures here it's beautiful we talk about node HTTP https UDP uh uh node streams which is a completely new abstraction in node that sits on top of pretty much almost everything that we use in node like a request in the client is what was called a writable stream because it's can continue right you can continue to write a request and it take a while because let's say you're uploading a file uh uh while a request on the server side is actually a readable stream you know because you keep reading stuff processes thread how do you clusters how to do socket Management in nodejs with the cluster module such that you can distribute connections that is that are incoming to nodejs between the different processes what are the different scheduling policies what are the difference uh what's the difference between them what is the most optimal what is the limitation currently and finally after having complete and deep understanding of the architecture the internals and the different components we bring it to the final section the performance and optimization Ts for nodejs and these are best practices that are in the wild and take best practices always with a grain of salt whatever is best practice today may be not in the future but any best practice anything that we say in this in this particular section I try to link it to a why you will always find it that anything that we mention this is why callbacks are constant because they may block the main Loop and if the main Loop what what's the what's the problem with blocking the main Loop well if you block the main Loop then you will delay the poll phase where what's the problem with delaying the poll phase then the io will be delayed what's the problem with delaying the io well you're not going to read from files you're not going to write to files and if you don't write to files you might cause corruption because someone accepted something expected something to be written and it's not written yet because you delayed it or an IO might be sent and it was not sent like a request like you're writing to a socket and it was not sent back to the client or back to the server because of a delay that happens in the loop so how how can I get around it well we can schedule it there's so many tips here we can partition we can partition the expensive compute we can offload it to complete thread we can offload it to a completely different process heck we can do a C++ add-ons in Nos and I'll show how to do that we will if if if the function is so expensive to be written in JavaScript we'll write it in C++ and we'll compile it and we'll link it back to no and we'll run it and I'll show you even how to debug C++ code from JavaScript is so amazing how much you can do with this stuff I I had so much fun designing this course and I hope you enjoy it give it a shot go to node. husin n.com for a discount coupon and I hope I see you there thank you so much for all the support appreciate you guys see you in the next one

Original Description

NodeJS and Architecture https://node.win My favorite thing in software engineering is the art of making it transparent. Node is one of the most popular runtimes used on backend engineering yet I feel it is the least understood. I surely felt this way at times. I spent 7 months working on a course to demystify NodeJS Internals and Architecture and distilled this in this comprehensive course. I built this course is for the engineers who can't stand working with something opaque. They love to understand what is running behind the engine. They enjoy tearing apart 1 the line of code into its original 1000 lines. They question why is the output of a Node program is unpredictable. They want to know when does the Node process exit. They want to know why Node takes so long to start in some cases. They appreciate how Node works on all operating systems and would like to know how it does that. For example by understanding the internals of HTTP module, you can write a backend in Node that accepts and process more requests. Every line of code you write you would think of how and when Node will process it. By understanding the event loop and the different stages you can tune and re-order your code to achieve best performance and even consistent result. Ever wrote a program in Node that fails 1% of the time while succeeds 99%? Understanding Node architecture helps you make your program predicable. As opposed to adding workaround because you don't understand. We all did that. It is all about removing blockage and letting the main loop phases “breath”. When we build software the problem is we often go against the grain. Understanding where the friction is in Node allow you to work with it as oppose to against it. In this course I cover the following - NodeJS Architecture I cover the various phases in the event loop and what exactly happens in each phase, how promises are just callbacks, how and when modules are loaded and their effect on performance, Node packages a
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Hussein Nasser · Hussein Nasser · 0 of 60

← Previous Next →
1 Extending ArcObjects (IGeometry) - 01 - Getting Started
Extending ArcObjects (IGeometry) - 01 - Getting Started
Hussein Nasser
2 Extending ArcObjects  (IGeometry) - 02 - The Document, The Map and The Layers
Extending ArcObjects (IGeometry) - 02 - The Document, The Map and The Layers
Hussein Nasser
3 Channel Update - New Book, New Job, New Videos
Channel Update - New Book, New Job, New Videos
Hussein Nasser
4 Learn Programming with VB.NET - 01 - Getting Started
Learn Programming with VB.NET - 01 - Getting Started
Hussein Nasser
5 Learn Programming with VB.NET - 02 - Classes and Objects (Part 1)
Learn Programming with VB.NET - 02 - Classes and Objects (Part 1)
Hussein Nasser
6 Learn Programming with VB.NET - 03 - Classes and Objects (Part 2)
Learn Programming with VB.NET - 03 - Classes and Objects (Part 2)
Hussein Nasser
7 Learn Programming with VB.NET - 04 - User Interface
Learn Programming with VB.NET - 04 - User Interface
Hussein Nasser
8 Learn Programming with VB.NET - 05 - By Value v. By Reference
Learn Programming with VB.NET - 05 - By Value v. By Reference
Hussein Nasser
9 Learn Programming with VB.NET - 06 - Variable size, 32 bit vs 64 bit
Learn Programming with VB.NET - 06 - Variable size, 32 bit vs 64 bit
Hussein Nasser
10 Learn Programming with VB.NET - 07 - Conditional Statements
Learn Programming with VB.NET - 07 - Conditional Statements
Hussein Nasser
11 Learn Programming with VB.NET - 08 - Inheritance
Learn Programming with VB.NET - 08 - Inheritance
Hussein Nasser
12 Learn Programming with VB.NET - 09 - Strategy Design Pattern
Learn Programming with VB.NET - 09 - Strategy Design Pattern
Hussein Nasser
13 Learn Programming with VB.NET - 10 -  How did I learn programming
Learn Programming with VB.NET - 10 - How did I learn programming
Hussein Nasser
14 IGeometry 2016 Retrospective - Channel Update
IGeometry 2016 Retrospective - Channel Update
Hussein Nasser
15 Javascript by Example - The Vook
Javascript by Example - The Vook
Hussein Nasser
16 Vlog - Keep your servers close and your database closer
Vlog - Keep your servers close and your database closer
Hussein Nasser
17 Vlog - Client/Server Programming Languages
Vlog - Client/Server Programming Languages
Hussein Nasser
18 Javascript By Example L1E01 - Getting Started
Javascript By Example L1E01 - Getting Started
Hussein Nasser
19 Persistent Connections (Pros and Cons)
Persistent Connections (Pros and Cons)
Hussein Nasser
20 Javascript By Example L1E02 - Building the Calculator Interface
Javascript By Example L1E02 - Building the Calculator Interface
Hussein Nasser
21 Happy new Year from IGeometry!
Happy new Year from IGeometry!
Hussein Nasser
22 Synchronous v. Asynchronous
Synchronous v. Asynchronous
Hussein Nasser
23 Javascript By Example L1E03 - Displaying the Digits on Calculator Screen
Javascript By Example L1E03 - Displaying the Digits on Calculator Screen
Hussein Nasser
24 Show Your Work. Blog, Vlog, Write, Create and Develop!
Show Your Work. Blog, Vlog, Write, Create and Develop!
Hussein Nasser
25 Relational Database Atomicity Explained By Example
Relational Database Atomicity Explained By Example
Hussein Nasser
26 Javascript By Example L1E04 - Operators, All Clear with Arrow Functions
Javascript By Example L1E04 - Operators, All Clear with Arrow Functions
Hussein Nasser
27 What Comes First, User Experience or Software Architecture?
What Comes First, User Experience or Software Architecture?
Hussein Nasser
28 Javascript By Example L1E05 -  Evaluate the Calculator Expressions with eval
Javascript By Example L1E05 - Evaluate the Calculator Expressions with eval
Hussein Nasser
29 Fastest Way to Learn Programming Language or Technology
Fastest Way to Learn Programming Language or Technology
Hussein Nasser
30 Javascript By Example L1E06 -  Fix Leading Zero Bug with Conditions
Javascript By Example L1E06 - Fix Leading Zero Bug with Conditions
Hussein Nasser
31 Stateful vs Stateless Applications (Explained by Example)
Stateful vs Stateless Applications (Explained by Example)
Hussein Nasser
32 Javascript By Example L1E07 - Running our Calculator on the Mobile Phone
Javascript By Example L1E07 - Running our Calculator on the Mobile Phone
Hussein Nasser
33 Advice for New Software Engineers and Developers
Advice for New Software Engineers and Developers
Hussein Nasser
34 Why JSON is so Popular?
Why JSON is so Popular?
Hussein Nasser
35 Building Scalable Software - SLA, HS, VS
Building Scalable Software - SLA, HS, VS
Hussein Nasser
36 Vlog (Istanbul) - Datacenter Proximity
Vlog (Istanbul) - Datacenter Proximity
Hussein Nasser
37 Should Software Engineers Learn Bleeding-Edge Technologies?
Should Software Engineers Learn Bleeding-Edge Technologies?
Hussein Nasser
38 Do Developers Build Bad User Interfaces/Experience?
Do Developers Build Bad User Interfaces/Experience?
Hussein Nasser
39 Learn By Doing.
Learn By Doing.
Hussein Nasser
40 I Wrote Bad Front-End Code That Broke Chrome
I Wrote Bad Front-End Code That Broke Chrome
Hussein Nasser
41 My Story
My Story
Hussein Nasser
42 Vlog - Horizontal vs Vertical Scaling
Vlog - Horizontal vs Vertical Scaling
Hussein Nasser
43 Can User Experience Help Build Better Rest API?
Can User Experience Help Build Better Rest API?
Hussein Nasser
44 Reverse engineering Instagram in flight mode
Reverse engineering Instagram in flight mode
Hussein Nasser
45 The Benefits of the 3-Tier Architecture (e.g. REST API)
The Benefits of the 3-Tier Architecture (e.g. REST API)
Hussein Nasser
46 Stateless v. Stateful Architecture (Podcast)
Stateless v. Stateful Architecture (Podcast)
Hussein Nasser
47 The evolution from virtual machines to containers
The evolution from virtual machines to containers
Hussein Nasser
48 Proxy vs. Reverse Proxy (Explained by Example)
Proxy vs. Reverse Proxy (Explained by Example)
Hussein Nasser
49 Canary Deployment (Explained by Example)
Canary Deployment (Explained by Example)
Hussein Nasser
50 No Excuses
No Excuses
Hussein Nasser
51 Synchronous vs Asynchronous Applications (Explained by Example)
Synchronous vs Asynchronous Applications (Explained by Example)
Hussein Nasser
52 What is an Asynchronous service?
What is an Asynchronous service?
Hussein Nasser
53 Difference between Client Polling vs Server Push in Notifications
Difference between Client Polling vs Server Push in Notifications
Hussein Nasser
54 Software vs. Hardware AdBlockers (Explained by Example)
Software vs. Hardware AdBlockers (Explained by Example)
Hussein Nasser
55 HTTP Caching with E-Tags -  (Explained by Example)
HTTP Caching with E-Tags - (Explained by Example)
Hussein Nasser
56 Simple Object Access Protocol Pros and Cons (Explained by Example)
Simple Object Access Protocol Pros and Cons (Explained by Example)
Hussein Nasser
57 Nodejs Express "Hello, World"
Nodejs Express "Hello, World"
Hussein Nasser
58 Reverse Engineering Instagram feed
Reverse Engineering Instagram feed
Hussein Nasser
59 Popup Modal Dialog with Javascript and HTML
Popup Modal Dialog with Javascript and HTML
Hussein Nasser
60 MIME and Media Type sniffing explained and the type of attacks it leads to
MIME and Media Type sniffing explained and the type of attacks it leads to
Hussein Nasser

The course covers Node.js internals and architecture, including the V8 engine, libuv, event loop, and performance optimization, to help engineers build better software on top of Node.js.

Key Takeaways
  1. Understand the V8 engine and its optimizations
  2. Learn about libuv and its role in Node.js
  3. Study the event loop and its phases
  4. Optimize Node.js performance using best practices
  5. Use tools like C++ add-ons to improve performance
💡 Understanding Node.js internals and architecture is crucial for building efficient and scalable software on top of Node.js.

Related Reads

Up next
NEW Ubuntu 26.04 HYPRLAND Setup: MAKE Linux BEAUTIFUL (2026)
Ksk Royal
Watch →