Class PPT
Agenda
NodeJs
- A software platform that is used to build scalable network applications.
- It is developed by Rayn Dahl in 2009
- It is a javascript runtime built on Google's V8 JavaScript Engine
- Node.js runs the V8 JavaScript engine, the core of Google Chrome, outside of the browser. This allows Node.js to be very performant.
- A Node.js app runs in a single process, without creating a new thread for every request.
- It provides a set of asynchronous I/O primitives in its standard library that prevent JavaScript code from blocking and generally libraries in Node.js are written using non-blocking paradigms, making blocking behavior the exception rather than the norm.
- When an I/O operation like reading from the network, accessing a database or the filesystem, then instead of blocking the thread and wasting CPU cycles waiting, Node.js will resume the operations when the response comes back.
- This allows Node.js to handle thousands of concurrent connections with a single server without introducing the burden of managing thread concurrency, which could be a significant source of bugs.
- It has a unique advantage because millions of frontend developers that write JavaScript for the browser are now able to write the server-side code in addition to the client-side code without the need to learn a completely different language.
- In Node.js the new ECMAScript standards can be used without problems.
Components of NodeJs
- JavaScript runtime: V8
- EventLoop : Libuv (A multi-platform support library which focuses on asynchronous I/O, primarily developed for use by Node.js.)
- Standard Components
- Filesystem Access
- Crypto
- TCP/UDP
- HTTP
- Buffer
- etc
Use Cases of NodeJs