Hi, I’m Imran Khan

A Software Engineer passionate about building scalable, efficient, and innovative web solutions. Dedicated to creating seamless digital experiences that make a real-world impact. Based in Connecticut, USA.. Read more.

Worker Threads vs. Child Processes: Making the Right Choice in Node.js

Worker Threads vs. Child Processes in Node.js: When to Use Which? Early in my career when I first started working with Node.js, I loved how fast and event-driven it was. But then I hit a wall—what happens when my app needs to crunch a lot of data, like processing large files or performing complex calculations? The event loop would freeze, and everything would slow down. That’s when I discovered Worker Threads and Child Processes—two ways to run tasks in parallel without blocking the main thread....

February 24, 2025 · 5 min

Using Redis with Keyv in NestJS for Caching

Introduction Caching is essential for improving performance and reducing database load. With new update on the nestjs , there are few breaking changes modules. One of them is caching. They have migrated to Keyv In this post, I’ll show how to integrate Redis caching using Keyv in a NestJS application. Keyv is a simple key-value storage adapter that supports multiple backends, including Redis. First, install Keyv and the Redis adapter:...

February 12, 2025 · 2 min

Why You Can’t Stop Scrolling: The Algorithm Explained

Introduction: How Social Media Knows What You Want to See Ever wonder why some posts on your social media feed feel like they were picked just for you? It’s not magic, it’s the algorithm at work, quietly learning your interests and connections to serve up content you’ll find engaging. Behind the scenes, it’s piecing together a puzzle based on your actions and interactions. Let’s see how this works in detail …...

January 14, 2025 · 2 min

Interface in Typescript

Understanding Interfaces in TypeScript An interface in TypeScript is a powerful way to define the structure of an object. It acts like a contract within your code or a blueprint for an object. When you create an interface, you specify the properties and their types that an object must have. This helps TypeScript’s compiler to catch errors and ensure that objects always meet the required shape. Why Use Interfaces? Type Checking: Interfaces help the compiler check if an object meets the criteria set in the interface....

January 6, 2025 · 2 min

Advanced Git Commands

In this article, we’ll dive into some of the most powerful and essential Git commands. Whether it’s managing changes, working with tags, rebasing commits, or debugging, these commands will elevate your version control skills and make complex operations a breeze. Let’s get started! 1. Stashing Changes Stashing allows you to temporarily save your uncommitted changes without committing them. This is useful when you need to switch branches or perform other tasks without losing your current work....

December 14, 2024 · 5 min

Binary Search Tree (BST)

Binary Search Tree Today I wanted to talk about Binary Search Tree (BST). Basically, a binary search tree is a data structure used in computer science for organizing and storing data in a sorted manner. If you think of a tree, it has many branches. One branch leads to another branch, and that branch splits into others. The same concept applies to a binary search tree. In a BST, each node has at most two children, referred to as the left child and the right child....

July 11, 2024 · 5 min

Design Patterns in software development

Design patterns are essential in software development because they provide proven solutions to common problems, making code easier to understand, reuse, and maintain. They help ensure that software is well-structured and robust, reducing the chances of errors and improving development efficiency. for example when building something with lego we make sure everything fits together and works as intended. Same applies to design pattern in software development, they have tried and given proven solutions to the common problems that developers face when building software....

July 2, 2024 · 6 min

SOLID PRINCIPLES

There are 5 SOLID Principles that is used in software development that helps the developers to maintain, test and extensible the code as it grows. Before we jump into know each of the S.O.L.I.D acronyms and why we need to apply these principles into our project, first we should know what is SOLID stands for. S - Single Responsibility Principle Its is the first of the five design principle in object oriented design....

June 30, 2024 · 9 min

Working with streams in NodeJS

What are Streams ? Streams are just collections of data that is sent in small chunks, and it also don’t have to fit in memory. Meaning, when dealing with big chunk of data either read or write, the memory usage is less consumed, which is extremely useful. let me show two examples how streams can be optimized the memory consumption. writeStream.js const fs = require('fs'); const file = fs.createWriteStream('file.txt'); for(let i=0; i<=2e6; i++) { file....

April 17, 2019 · 2 min