Technology

Understanding DNS: The Internet's Phone Book

2025-07-28

Understanding DNS: The Internet’s Phone Book

Ever wondered what happens when you type google.com into your browser? Behind that simple action lies one of the most elegant distributed systems ever created: the Domain Name System (DNS). Think of it as the internet’s phone book, but instead of looking up phone numbers, it translates human-readable domain names into IP addresses that computers can understand.

What Exactly is DNS?

DNS is essentially a hierarchical, distributed database that maps domain names to IP addresses. When you visit a website, your computer needs to know the exact IP address of the server hosting that site. Since remembering 142.250.80.14 is much harder than remembering google.com, DNS acts as the translator.

Deconstructing Kubernetes Scheduling Mechanisms

2024-10-10

Deconstructing Kubernetes Scheduling

Think of Kubernetes as a super-organized logistics manager. Its job? To ensure every Pod finds the perfect node to live on, based on its requirements, preferences, and constraints.

But Kubernetes isn’t just about making sure the Pod “finds a place.” It uses sophisticated scheduling mechanisms like affinity, anti-affinity, taints, tolerations, and even direct assignments with nodeName.

Let’s dive into how Kubernetes works its scheduling magic. Before we start with that, lets just get a brief idea on how the api server decides which node the application should be deployed into.

Deconstructing a Kubernetes Deployment

2024-09-23

Deconstructing a Kubernetes Deployment

Think back to the first time you laid eyes on a Kubernetes deployment manifest. Did it make any sense to you apart from the image and container parameters? Wait, it did? Well, that makes one of us!

When I first saw a Kubernetes deployment, I was hit with a flurry of questions. Questions that made me feel like I had opened the Matrix. Now, after some much-needed experience (and a few existential crises), I think I can finally answer some of those burning questions.

Just Enough Kubernetes: Architecture

2022-09-10

TLDR

Kubernetes is a container orchestration tool in which you can use multiple machines/VM’s to create a cluster. When cluster is created, application deployed on it are distributed throughout the nodes and Kubernetes makes sure they are up and available depending on the provided configuration.

Architecture

Node: A physical machine or VM where our applications are run when deployed.

Cluster: A combination of nodes running together. It is best practice to have multiple nodes running at the same time to avoid a failure if any one of the nodes in the cluster stops working.

Creating complex objects using the Builder Pattern

2022-04-30

Overview

The builder creational design pattern is used to create a complex object, in a step by step manner.

You might have come across the same using while using some Java Clients or any other framework, lets us now see what problem it solves.

The core idea here is that if we need to send too many parameters in a constructor call,its hard to maintain the order of the call, and the constructor call itself is very difficult to read. And in most cases all the parameters are not necessary for object initialization and can be skipped instead of passing mandatory fields when object is created via a constructor.

Design Patterns Days: Observer Pattern and Publishing/Subscribing

2021-10-03

Overview

As the wikipedia definition says:

The observer pattern is a software design pattern in which an object, named the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods.

To someone not familiar with this pattern the first thing that would come to their mind is Polling. If we want to know about changes that are done to a central body/system we continuosly send request to the server and check for changes based on the responses But the problem with this approach is, with a significant increase in clients that are polling the system, the continuous request going to the system will overwhelm the system. Also making huge amount of IO/Network requests is bad (Just take my word for it).

Design Patterns Days: Strategy

2021-07-21

Overview

As the Wikipedia definition says:

The strategy pattern is useful for situations where it is necessary to dynamically swap the algorithms used in an application. The strategy pattern is intended to provide a means to define a family of algorithms, encapsulate each one as an object, and make them interchangeable. The strategy pattern lets the algorithms vary independently from clients that use them.

Or in simpler terms, Instead of hardcoding an implementation that can vary according to the various classes. We on runtime inject the appropriate algorithm/behaviour that the class will need.

A Gentle Introduction to Big-O notations

2020-11-01

Big-O Notation

Section 1: What is it?

Big-O Notation helps us talk about the time taken by an algorithm to run given a particular input size.

Section 2: Why do we need it?

Imagine there are multiple solutions to a single problem but with different approaches/data structure, how do you know which one is better? Do you choose the solution that was the easiest to code or the solution you wrote and not the one your colleague did. Do we run both of them and decided by what is finished quicker? But what if one of the solutions is in a low-level/faster language than the other??

Disk Space Analysis in Linux

2020-08-02

1. Overview

One of the most common administrative tasks while using Linux is finding out the disk space usage in our system. The most common command-line utilities to find the free disk space usage are the df (Disk Free) and du (Disk Usage commands).

In this tutorial, we will have a look at the common scenarios and usage of the du and df commands.

2. Common Usage Scenarios

We will be using the df and du commands interchangeably based on the information we are seeking, to check the amount of space used and free on our filesystem and partitions the df command is used additionally to check for space usage on a directory level the command du is used.

Converting Langfiles using Bash and Translate-Shell

2019-12-01

Introduction

The most mundane task a developer can be asked to do is creating new lang files (adding support for Spanish,German ) in your app. Unless you are using a library for dynamic translation in your app or browser capabilities,the whole process to convert the base language file (say English) to other languages is just time-consuming also if the software you are working on is huge, say 5k lines of text on the base language file. Converting the file manually will take you days.

Intro to Regular Expressions

2019-12-01

Introduction

Being a Linux user and not coming across Regular Expressions or regex is next to impossible. I kept seeing the cryptic little set of characters everywhere and the people who could use it looked like ninjas to me. They are everywhere text editor's, JavaScript, Python, JAVA , Bash……and the list goes on.

XKCD Regex Comic

What Exactly is a Regular Expression?

A regular expression is a string containing a combination of normal characters and special meta-characters or meta-sequences. The normal characters match themselves. Meta-characters and meta-sequences are characters or sequences of characters that represent ideas such as quantity, locations,or types of characters.

Writing a Shell in C

2019-12-01

Do you have dreams about writing C shells by the sea shore? That makes two of us.

One of the many cool projects you can make while learning to program in the Linux environment is to make a command-line interpreter like the Bash shell or the command prompt in windows. In the process you will learn how to handle fork + exec calls and the various system calls associated with the working of a shell.