Memoir Of Node Js

Sheikh Riad.png
Image By Author

What is Node.js?

Node.js is the javascript runtime. Well, let’s make runtime a little shorter, runtime’s job is to execute code. Javascript code, we have to run in the browser we know, so many browsers use many types of engines, but the most powerful is the Google V8 engine. The code that Google wrote to build this engine was open to everyone, so programmer Ryan Dall came up with an idea. Will be The idea is that Ryan Dal, who has a little bit of intellect, has got the permission of the operating system in that code so that he can take access to system resources like memory and file systems. So what happened? Adapted Node.js to work on the operating system. So that Node.js can also run on the server. These are all benefits but are not available in the browser.

How Does Node Js Work?

Suppose you go to a grocery store, and the shopkeeper’s uncle has no helper, he runs the shop alone. If you want to go and buy 1 sack of rice, the shopkeeper said to wait 2 minutes, I will give it. The shopkeeper brought 1 sack of rice from his rice warehouse and gave it to you, you left with the rice. Suppose here you are a client who requested, that the grocery store is the Node.js server and the rice warehouse in the database. As we know, JavaScript is a single-threaded language. Now a question may arise in my mind, what is the thread again brother? The thread is the shopkeeper. What if 20 more customers came when you were buying rice? What did Mama do then? One customer wanted things and the shopkeeper would give them to them one by one, right? Since the shopkeeper had no helper, it took a long time for everyone to pay. After all, those who came to the store would be annoyed to see such a long line, right? The same thing could have happened on the Node.js server, but programmer Ryan Dal wisely provided the helper with the thread so that the client would not have to wait for the request. This means that on the Node.js server, the thread just takes the request and gives it to the helper, and says, go and get these responses from another server as you can, this is the Non-Blocking I / O concept. The callback or asynchronous concept is the method by which the helper collects the responses and manages them properly and gives them to the thread. And for so long that Mr. Helper handled the request-response with so much effort, he is the Event Loop.

So how did it feel to get acquainted with the famous Node.js now?

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sheikh Riad

Sheikh Riad

445 Followers

Computer Science and Engineering | Affiliate Marketer| Blogger | Doodler and Cartoonist | Programmer | Web Developer | Seo Expert |