happydecoder Profile picture
programmer - tweets about programming, and life advice that don’t suck. prev. flipkart
Oct 25, 2023 22 tweets 6 min read
When you are running a simple monolith application, all your services run on the same set of instances.

Successful applications have a habit of growing over time and eventually becoming huge.

Once your application become huge, it’s becomes a monstrous monolith Image As the traffic grows, the load grows, the team grows, you start slowly transforming the monolith into a set of independent services.

In other words, you transform your monolith into a microservice architecture. Image
Oct 24, 2023 12 tweets 3 min read
𝗛𝗼𝘄 𝘁𝗼 𝗽𝗮𝗿𝘁𝗶𝘁𝗶𝗼𝗻 𝗱𝗮𝘁𝗮 𝗮𝗰𝗿𝗼𝘀𝘀 𝘀𝗵𝗮𝗿𝗱𝘀 ?

🧵 Image Once you've identified that your single database server is not enough to handle the huge volume of transactions and storage of data.

To incorporate improved availability and scalability, you decide to partitioned and shard your data.
Oct 23, 2023 9 tweets 2 min read
𝗟𝗲𝘁'𝘀 𝗴𝗲𝘁 𝗶𝗻𝘁𝗿𝗼𝗱𝘂𝗰𝗲𝗱 𝘁𝗼 𝘀𝗵𝗮𝗿𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗽𝗮𝗿𝘁𝗶𝘁𝗶𝗼𝗻𝗶𝗻𝗴.

🧵 Image Partitioning and sharding are techniques used to divide and distribute large volumes of data into smaller, more manageable chunks.

The divided pieces of data is known as partitions.

When you distribute these partitions across multiple servers(shards), is known as sharding. Image
Oct 12, 2023 28 tweets 8 min read
This one thread will teach you everything that you need to know about 𝗗𝗡𝗦 ( 𝗗𝗼𝗺𝗮𝗶𝗻 𝗡𝗮𝗺𝗲 𝗦𝘆𝘀𝘁𝗲𝗺 ) 📌

🧵 Image We use IP addresses to visit websites on the internet.

Since humans cannot easily remember IP addresses to visit a website(domain name),

A global phone book was created.

The phone book maintains mappings of all domain names to IP addresses. Image
Oct 10, 2023 18 tweets 6 min read
𝗔𝗽𝗽𝗲𝗮𝗿𝗶𝗻𝗴 𝗳𝗼𝗿 𝗮 𝘀𝘆𝘀𝘁𝗲𝗺 𝗱𝗲𝘀𝗶𝗴𝗻 𝗶𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄 ?

Read this 8 system design non-functional requirements.

Non-Functional requirements defines qualities of a system, how a system is supposed to be.

For example: scalable, highly available, fast etc Image 𝟭. 𝗔𝘃𝗮𝗶𝗹𝗮𝗯𝗶𝗹𝗶𝘁𝘆

Availability = system uptime, the percentage of time system has been up

99% availability = the system was unavailable about 3.65 days a year.

Availability is measured as the success rate of requests.

99% availability = 99/100 = 1 req of 100 fails. Image
Oct 3, 2023 14 tweets 4 min read
Learn HTTP cache like you'll never forget.

🧵 Image This is part one of two parts series on HTTP cache.

Topics covered in part one:
- What is HTTP cache.
- How HTTP cache work.
- Types HTTP cache.
- States HTTP cache.

Part two will cover:
- HTTP 𝗰𝗮𝗰𝗵𝗲 𝗵𝗲𝗮𝗱𝗲𝗿𝘀
- 𝗶𝗺𝗽𝗹𝗲𝗺𝗲𝗻𝘁 HTTP cache.
Oct 2, 2023 5 tweets 2 min read
𝗜𝗱𝗲𝗺𝗽𝗼𝘁𝗲𝗻𝗰𝗲 📌

Idempotence is a property of certain operations/API.

An idempotent api can be repeated an arbitrary number of times.
And the result will be the same as if it had been done only once.

e.g. Sorting a list is idempotent, as repeated sorting has no effect Idempotent operations are often used in the design of APIs, where a request to perform an operation is guaranteed to happen at least once, but might also happen more than once.

If the operation is idempotent, then there is no harm in performing the operation two or more times.
Sep 29, 2023 19 tweets 5 min read
𝗔𝗣𝗜 𝗥𝗮𝘁𝗲 𝗟𝗶𝗺𝗶𝘁𝗶𝗻𝗴. 📝

When you're exposing an API service.

Chances are high that your service experiences a sudden burst in traffic.

This can degrade your system performance, and potentially lead to service outage.

How do you tackle this ?

🧵 𝗔𝗣𝗜 𝗿𝗮𝘁𝗲 𝗹𝗶𝗺𝗶𝘁𝗶𝗻𝗴 lets you limit the number of requests that a client can send to the server within a certain time interval.

Once the upper limit is reached,
Further requests are either queued for later processing, or straight up dropper and ignored.
Sep 21, 2023 26 tweets 6 min read
𝗟𝗲𝗮𝗿𝗻 𝗝𝗪𝗧 𝗹𝗶𝗸𝗲 𝘆𝗼𝘂'𝗹𝗹 𝗻𝗲𝘃𝗲𝗿 𝗳𝗼𝗿𝗴𝗲𝘁.

🧵 Image Before I tell you all the fun part.

First, it's important to understand two key concepts.
- 𝗔𝘂𝘁𝗵𝗼𝗿𝗶𝘀𝗮𝘁𝗶𝗼𝗻
- 𝗔𝘂𝘁𝗵𝗲𝗻𝘁𝗶𝗰𝗮𝘁𝗶𝗼𝗻

They are similar but not the same.

Let's see how ?
Aug 28, 2023 15 tweets 5 min read
Requests on the internet consumes resources(cpu, time, memory etc).

If you're aiming for a high performance, high throughput system.

You should understand and internalise the concept of batching.

Follow, and Retweet. So my tweets can haunt you. Image The idea of batching is pretty simple. Instead of sending each request or message separately, you group them together in a single request.

Usually, it is better to make fewer requests with more data as opposed to making more requests with less data.

why ? Image
Aug 24, 2023 13 tweets 4 min read
PROCESS VS THREAD

Reading this will help you understand how computer programs work and how they use your computer’s resources. Image Let's say you've got google chrome installed on your system.
It’s simply a file sitting on your disk.

When you click open chrome, you execute the file.
Your program comes to life. Memory space and other computing resources get allocated.

In other words, you initiated a process. Image
Aug 21, 2023 16 tweets 5 min read
In a distributed world the micro services need to be able to talk to each other.

For instance,
When you hit the ❤️ button, the reaction service(service A) talks to the notification service(service B), and I'm notified of your reaction.

How does micro services communicate❓ Image There are two ways a service instance A can communicate with another service instance B.

1. Synchronous
2. Asynchronous
Oct 18, 2022 27 tweets 7 min read
In the next 10 mins you'll learn/relearn Javascript prototypes.

-Thread- Well, It's understandable to get confused about Javascript prototypes.

The clarity lies in understanding, the difference between

- [[Prototype]]
- __proto__
- prototype
- F.prototype
- Native.prototype
Oct 6, 2022 26 tweets 6 min read
Learn JWT like you'll never forget.

-Thread- Before I tell you all the fun parts.
First, it's important to understand two key concepts.

Authorisation and Authentication.
They are similar but not the same.

Let's see how ?
Oct 5, 2022 5 tweets 1 min read
Are you struggling with "what should you do next ?"

-Thread- Often times we get lost with no clear thoughts on what to do next.
Here is something that should help you breakout of that loop.

1 - Research your options:
- spend timed 30 minutes exploring options,
- see what you find exciting