WEB-2-Nested-Resources-and-Authentication Flashcards
What is Node.JS?
Node.JS is a JS runtime that allows you to build scalable applications using JavaScript on the server-side.
Why is Node.JS so fast?
Because under-the-hood it is all written in C.
Also, it was designed to be non-blocking, meaning events can run in parallel instead of having to wait for an event to finish, in order to start another one.
What can be built with Node.JS?
A web socket server like a chat server
A file upload client
An Ad server
Any real-time data apps
What isn’t Node.JS?
Web Framework
For Beginners
Multi-Threaded
Why JavaScript?
JavaScript makes it relatively easy to program in an evented way. Because of this, you can write code that is potentially non-blocking, which means you can write code that is processed a lot faster.
What is the event loop?
When we run a node, it registers a lot of requests such as
- request
- response
- close
and these events can trigger more events, which leads to an event loop that is constantly looking for events and triggering them into an event queue
Are events processed one at a time? Yes/No
Yes