A lot of databases use LSM trees for storing the data where high write throughput is required. In this article we will go through the design and data structures used.

For the sake of the argument, let us assume we only have key — value pairs. Also, for the sake of simplicity let’s assume the key and values are strings.

Append only Log File

To ensure high writes we need to have sequential writes and reduce random writes. Let us start with writing the key-values to an append only file.

We also maintain an in memory hash map which contains the key and value…

A while back I had a chance to attend a webinar with Ravi Shastri. A lot of the discussion was how to build teams and how to build yourself, that perform.

The below are few ideas from the session (my interpretation). Thank you Ravi Shastri for being an amazing player, coach and an inspiration.

You say I when team fails, and say we when team succeeds.

If we want to ensure a lasting success, as leaders we should be the first one to accept failure and the last one to celebrate victory.

Defeat is a mentality.

You may loose a…

I have never been fond of running. Even during my teenage years I have not run more than a kilo-meter at a stretch. Then how do you go from being a couch potato to running a half marathon? Are the learnings transferrable to business as well? Can we use the same strategy to achieve targets in our professional and personal life?

The first step — Identify the need for change

The journey started when around May, 2020 I decided to run a full marathon. I had been eating (a lot) and my weight was continuously increasing. I was well inside…

I started the year with a target of completing 52 books, I was able to reach 50.

For the complete list you can refer to https://www.goodreads.com/user/year_in_books/2020/18286248

To follow me on GoodReads https://www.goodreads.com/user/show/18286248-jai

Below I present my recommendations from these 50 books.

Top 5 books (All Genres)

Creating this list was difficult. Lot of books in the list were very well written. Each author pushed the boundaries in its own domain.

Presenting my biased view :-

Müller-Lyer illusion

Look at the above image. Which line is longer?

Müller-Lyer Illusion

Most of the people would see the first one as the longer one This is the famous Müller-Lyer illusion. Here, both the lines are of equal length. You can use a ruler to check. Or you could hide the fins and then see that they are of equal length.

Even after knowing that both these lines are of equal length, you still continue to see the lines of different length. …

Waiting for access to cashier one-at-a-time

In programming one of the most common requirements is that of accessing resources concurrently.

Mutual exclusion implies that no two processes would access the resource concurrently.


The processes that try to acquire the common resource should not in any situation reach

a) Deadlock — This is a situation when no process can proceed further. In a scenario when all processes are waiting on each other to proceed, no process proceeds thereby leading to a situation where the system comes to a halt.

Ex. Say Process P1 & P2 and resources R1 & R2. Say P1 has R1 and is…


Lets say we have few million of keys along with a value. For example, the order id may have a reference to the order details on an e-commerce website.

We want to have a O(1) lookup for a key. Assuming the keys cannot fit in a single machine (unless we use a very large machine where the cost is not justified) we need a distributed system to store keys.


Lets say that we have n systems. There could be multiple ways to distribute the keys in these n systems.

Let us number each node as 0……n-1.

Understanding The Prisoners Dilemma

Let us say that there are 2 people (A & B) who have a charge of theft brought against them. Both of them are kept in separate rooms where they cannot communicate amongst themselves in any manner and neither know what the other has chosen.

The options that are provided to them are :-

a) If the person (A) confesses to the crime and the other(B) does not confess, the person to confess(A) goes free and (B) gets 3 years. …

The human race has been fighting for resources since the beginning. Initially, there were plenty of uninhabited places that the hunter gatherer and later the agricultural society could expand with an increase in population. In the recent times the population explosion has happened with no new space to occupy.

The human race has always been of ‘savages’ with the only change that today it is ‘intelligent savages’, savages nonetheless. When it comes to survival, the primitive mind will take over, and fights will happen. …

One of the important responsibility of a developer is estimating a feature. In this article we articulate what would is the best way for estimations.

The current process to estimate involves breaking the task to sub components and then providing an estimate against it. Including time for integration and other such components.

Sample estimation work

For a final delivery date, various methods such as Gant Chart can be used.

Similarly for estimation various methods such as ‘Story points’ in Agile, or ‘HLD/LLD breakdown’ can be used.

The question that I raise is ‘How accurate should xn(days) in above chart be’. …


I am passionate about designing and developing complex systems that impact people’s life. A avid reader and a believer of multi-disciplinary teaching.

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