Skip to main content

Posts

Showing posts from March, 2019

Basic concepts on NodeJs

Usecases of NodeJS. Walmart and ebay. Node is not the best platform for CPU intensive heavy computational applications. But it is ideal for building fast and scalable network applications.  NodeJS is capable of handling a huge number of simultaneous connections with high throughput. For each connection NodeJS does not spawn new Thread causing max out of memory instead handle all in single thread using non-blocking I/O model. Using this architecture NodeJS has achieved over 1 Million concurrent connections. Bubbling errors up to NodeJS core event loop will cause crashing the entire program. Netflix and Uber. NodeJs is best for, I/O bound applications. Data streaming applications. Data intensive real-time applications. JSON APIs based applications. Single page applications. Modules in NodeJS. In order  a design to be reliable and maintainable should avoid defining variables and functions in the global scope. Instead we can use modular...

Introduction to NodeJS

NodeJS is know as a  highly scalable, data intensive and  a real time back-end service. NodeJS is an open source, cross platform runtime environment for server-side and networking applications. To build a back-end services there are other tools and framework such as rails, Django, asp.net etc.. Node is not a programming language not a framework. There are few characteristics that make Node more popular. Characteristics of NodeJS. Easy to get started. Can be used for prototyping and agile development. It is good to build super fast and highly scalable services.          Eg -: Paypal, Uber, Netflix, Walmart It use JavaScript. Source code will be cleaner and more consistence. Large Eco-system of open source library. Node is a runtime environment for executing JavaScript code. Runtime environment of NodeJs.  In JavaScript the application runs inside the browser . Browser has a JavaScript engine taht convert the code to ...

Callbacks,Promises,Async Await and Closure in JavaScript.

This weeks blog will be including about callbacks and issues of it,promises which was used to overcome the issues of callbacks and closure in JavaScript. Callbacks, promises and async await All theses ways are used to deal with asynchronous data. By default, JavaScript programs run using a single thread. Though there are ways to create new threads, JavaScript is considered as single threaded language. JavaScript does not wait for I/O operations to get completed, instead it continues the execution of the program. This is called as non-blocking I/O. So that JavaScript is an asynchronous programming language because of this NIO nature. Callbacks, Promises and Async Await. As an example when a request is made to a server it will take couple of seconds to response with the relevant data, therefore you do not want to stall your program till the data is returned. You must keep on going or doing something where callbacks come in. Extra facts. until es6 => callbacks were used es...