Understand Sub-documents & Nested documents in Mongoose

Mongoose is the most widely schema-based solution to model your application data in MongoDB. It includes built-in type casting, validation, query building, business logic hooks and more, out of the box.

Async Operations with AbortController & AbortSignal in Nodejs

AbortController is the standard way to abort any ongoing operations. AbortController and AbortSignal are now part of Nodejs LTS (originally introduced in v15.0.0). Modern apps usually don’t work in isolation. They interact with entities like other APIs, file system, network, databases, etc.

Understand Event Loop in Nodejs

Event Loop is what allows Node.js to perform non-blocking I/O operations — despite the fact that JavaScript is single-threaded — by offloading operations to the system kernel whenever possible. Since most modern kernels are multi-threaded, they can handle multiple operations executing in the background.

Understand the difference between setImmediate(), setTimeout() and process.nextTick()

Timers and process.nextTick() are core concepts of Nodejs. It is important to undestand and be familiar with these and use them with ease. setTimeout(callback, 0), setImmediate(callback) and process.nextTick(callback) appear to be doing the same thing.

MongoDB Installation & Configuration on AWS EC2 Instance

I had to search a lot before figuring out a proper way to install and configure MongoDB in AWS EC2 instance. I am sharing my learnings and hope it is useful for others.