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
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.
Oct 24, 2023 • 12 tweets • 3 min read
𝗛𝗼𝘄 𝘁𝗼 𝗽𝗮𝗿𝘁𝗶𝘁𝗶𝗼𝗻 𝗱𝗮𝘁𝗮 𝗮𝗰𝗿𝗼𝘀𝘀 𝘀𝗵𝗮𝗿𝗱𝘀 ?
🧵
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.
🧵
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.
Oct 12, 2023 • 28 tweets • 8 min read
This one thread will teach you everything that you need to know about 𝗗𝗡𝗦 ( 𝗗𝗼𝗺𝗮𝗶𝗻 𝗡𝗮𝗺𝗲 𝗦𝘆𝘀𝘁𝗲𝗺 ) 📌
🧵
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.
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
𝟭. 𝗔𝘃𝗮𝗶𝗹𝗮𝗯𝗶𝗹𝗶𝘁𝘆
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.
Oct 3, 2023 • 14 tweets • 4 min read
Learn HTTP cache like you'll never forget.
🧵
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
𝗟𝗲𝗮𝗿𝗻 𝗝𝗪𝗧 𝗹𝗶𝗸𝗲 𝘆𝗼𝘂'𝗹𝗹 𝗻𝗲𝘃𝗲𝗿 𝗳𝗼𝗿𝗴𝗲𝘁.
🧵
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.
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 ?
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.
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.
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❓
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