How airports can help us pick correct type of database

Sumeet More
2 min readOct 2, 2022

--

Photo by Phil Mosley on Unsplash

Disclaimer: This article is based on my current knowledge and understanding. If you have any query or see any improvement, please mention in the comment section.

This is a micro blogpost which might help you to pick correct type of database based on use case.

In airports, we see queues of passengers based on their airlines which they have chosen to fly with. But let’s imagine passengers formed queues irrespective of the airlines they are travelling with, will there be any effect because of this arrangement? To understand the effect , let’s imagine airline1 wants to communicate some airline specific information to their passengers. Now if all passengers are mixed in different queues , it is a tough task to communicate this information but if there are 2 queues specific to airline1, then that communication is quite easy.

In database world, we can have row oriented database like MYSQL which will read each record row wise and column oriented database like Cassandra which will read record column wise.

So Sumit, how this passenger queue and database related? — row oriented database are really good if you want to work on multiple columns of a record but column oriented database are really good if you want to work on specific columns. Now imagine each airline queue at airport as database columns of the table. To communicate new information in mixed airline queue system would be equivalent to going row wise whereas if we have specific queue for an airline, it would be equivalent to going column wise. In this example, definitely the column wise approach wins.

Some applications/use cases will favor column based approach (specially analytical queries). Technical use case like application metrics where end user wants to understand average latency of their application over a period of time. Here latency column only plays a role so querying that column only makes sense.

Hence based on your use case, pick the database accordingly.

~ Happy coding

Note: Airport example is just used to form analogy

--

--

Sumeet More
Sumeet More

Written by Sumeet More

Software Engineer 2 at Microsoft | Backend Engineer and Architect| Blockchain & ML enthusiast | C#,.NET Core, Rust, Javascript and Go

No responses yet