Documenting my learning Journey

What is Event Loop?
What is Blocking EventLoop?
Let’s block EventLoop
Now, Let’s unblock the event loop
How to avoid event-loop blocking?

What is the Event Loop?

The 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. When one of these operations completes, the kernel tells Node.js so that the appropriate callback may be added to the poll queue to…

What is the Event Loop?
So, when to use setTimeout, setImmediate, process.nextTick?
Issue with setTimeout?
Precedence within Eventloop
Take aways

Consider below code, what would be the order on execution even though it’s apparent that they do the same thing (executing the callback)?

current event loop

What is the order of execution of setTimeout, setImmediate, process.nextTick ?
To answer this let’s understand EventLoop.

What is the Event Loop?

The event loop is what allows Node.js …

This document talks about various queues concerning EventLoop to better understand how best to use Promises, Timers (setTimeout etc)

V8 Engine works by enqueuing tasks into the event loop.

But, deep down the task queue, something else is going on. The tasks are broken down further into microtask and macrotask

This document talks about ways to avoid side affects using some functional programming concepts and their benefits.

· Understanding side affects:
Consider below examples
Fixing the side affects
· Concepts:
What is functional programming?
Pure function:
Higher-order Functions
The Tenets of Functional Programming (not limited to)

Understanding side affects:

Consider below examples

Lets predict the value of foo

{ ONE: 2, TWO: 4 }
{ ONE: 6, TWO: 12 }
{ ONE: 24, TWO: 48 }
foo: { ONE: 24, TWO: 48 }

The value of foo if no longer { 'ONE'…

This document tries to explain Kafka from an API standpoint for Engineers to effectively use in their applications and answers some nitty-gritty questions which aren’t so obvious.


1. Why Kafka?
2. What is Kafka?
3. How does it work?
4. Scenarios to think through
5. Why is it hard to achieve optimal performance with Kafka?
6. How do deal with some common problems?

Why Kafka?

We wished to achieve Distributed Event-Driven(ED) architecture to get the benefits of asynchronous request processing, decoupling of microservices, overall resiliency, eventual consistency, pub-sub paradigms.

To achieve the above, Message-Queue(MQ) seemed to be one of the tools to…


Disclaimer: This article may or may not convey something new. Stating obvious helps.

Goals of code review:

Give/ take feedback, means of collaboration!

Take aways:

  • Highlighting common problems.
  • Benefits of fostering a good code review process.
  • Best practices for reviewers.
  • Best practices for authors.
  • Checklist for code review.

The main code review pitfalls are:

  • Not getting useful feedback.
  • Not having enough time to do code reviews.
  • Code reviews taking too long causing long waiting times for PR closure.
  • The review process is not constructive enough.

Here it comes……….

To the reviewer………


Pre-requisites: Understanding of javascript, client-server architecture.

The complete code can be found on github.

Part 1: Overview (Why, What, When, How of http2)
Part 2: Exploring with node-http2 core and hapijs

Disclaimer: Will be using http2 module shipped with node@v9+ in this article. Several other http2 client-server library implementations are listed here.

Let’s get started by creating a simple http1.1 server with single route.

mkdir hapijs-http2 && \
cd hapijs-http2 && \
npm init -y && \
npm i hapi@^16.6 -s && \
touch http1Server.js

copy the code below tohttp1Server.js or clone entire repo from here.

Now, let’s do…


Let’s talk about What, why, when and how of http2

The complete code can be found on github.

Part 1: Overview
Part 2: Exploring with node-http2 core and hapijs

What is http2?

http2 is the latest update after http1.1 which is being used since 1999.

The http2 protocol is focused on performance; specifically, end-user perceived latency, network and server resource usage. (Read about the specifications here)

Why http2?

In other words what’s wrong with http1.1

Loading a web page is resource intensive, as HTTP/1.1 only allows one outstanding request per TCP connection. …

You get to choose only two

What is CAP theorem?

Among Consistency, Availability, Partition-tolerance
— “pick any two”

  • CP: Consistent and Partition tolerant system
    (let-go: Availability)
  • AP: Available and Partition tolerant system
    (let-go: Consistency)
  • AC: Available and Consistent system
    (let-go: Partition tolerance)

“You can’t control what is not in your limits”

I hope we all agree that network Partition is not something which we can oversee. 🙌 Hands down!

In other words, the CAP theorem states that in the presence of a network partition, one has to choose between Consistency and Availability.

Consider a simple system as shown below, where writes are through master and reads…

Jeevan D C

I Code. I Paint. I Ride

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store