# Arpit Bhayani - Full Content Index > Every essay, note, and video write-up on arpitbhayani.me, with its URL and description, for AI agents and search crawlers that need the complete corpus rather than a curated summary. ## AI Systems ### Blogs - [What AI First Engineering Orgs Look Like](https://arpitbhayani.me/blogs/ai-first-org): Every process a software team runs was built to manage a scarce resource. For twenty years that resource was engineering time. Waterfall managed it with sequencing. Agile managed it with short cycles and constant renegotiation. Both approaches assume the same thing: writing code is the expensive step, so protect it with process. - [Three Claude Skills I Think Every Org Should Have](https://arpitbhayani.me/blogs/three-skills): A company runs smoothly when people can get stuff done without hunting for information. What actually wears people out day to day is not the hard engineering problem. It is not knowing which ticket to file, which team to bug on Slack, or what invisible step stands between them and getting a simple service live. - [G-Eval, Explained](https://arpitbhayani.me/blogs/g-eval): G-Eval is a reference-free evaluation framework that uses large language models to assess the quality of generated text. This article explains how G-Eval works, including rubric-based prompting, chain-of-thought evaluation, and probability-weighted scoring using token log probabilities. You will also learn its limitations, common implementation patterns, practical best practices, and when not to use it. If you are building LLM applications, chatbots, summarization systems, or AI writing assistants, this guide will help you evaluate outputs more reliably. - [AI Workflows Need Topological Sort](https://arpitbhayani.me/blogs/ai-topological-sort): Every AI workflow is a dependency problem. You have steps that produce outputs, other steps that consume those outputs, and a hard constraint: consumers cannot run before their producers finish. Get the order wrong and you read stale data, call a tool with missing context, or trigger an agent before its inputs are ready. - [Embedding Models Make Or Break Your Ai App](https://arpitbhayani.me/blogs/embedding-models-make-or-break-your-ai-app): Most of us building AI applications spend the bulk of their time on the LLM - picking the right model, tuning the prompt, evaluating output quality. The embedding model gets a passing thought. - [What Matters in Production RAG](https://arpitbhayani.me/blogs/rag-production): Most of us build RAG the same way: follow a tutorial that embeds a handful of PDFs, stores the vectors in a local Chroma instance, and chains everything together with LangChain (if that's still a thing). The demo works. The answer looks reasonable. Then you take it to production and it falls apart in quiet, hard-to-diagnose ways. - [Structure of Every LLM Chat](https://arpitbhayani.me/blogs/structure-of-llm-chat): Role tagging is not cosmetic. It shapes how the model responds, how context is managed across multiple turns, and how application developers constrain and direct model behaviour at a structural level. Understanding this format is the difference between using an LLM and building reliably on top of one. - [How LLMs Really Work](https://arpitbhayani.me/blogs/how-llms-work): If you have used ChatGPT, Gemini, or Claude, you have already formed an intuition about what these systems do. You type something in, and text comes back that feels coherent, knowledgeable, and sometimes eerily human. But the machinery underneath is simultaneously simpler and stranger than most people expect. - [Product Quantization](https://arpitbhayani.me/blogs/product-quantization): Recommendation engines, image retrieval platforms, document matching services, and RAG pipelines all rely on finding the nearest neighbors to a given query vector in high-dimensional space. This is where vector similarity search comes in. - [The Q, K, V Matrices](https://arpitbhayani.me/blogs/qkv-matrices): At the core of the attention mechanism in LLMs are three matrices: Query, Key, and Value. These matrices are how transformers actually pay attention to different parts of the input. In this write-up, we will go through the construction of these matrices from the ground up. - [How LLM Inference Works](https://arpitbhayani.me/blogs/how-llm-inference-works): When you enter a prompt into an LLM, the model converts your text into numbers, processes them, and returns a response one token at a time. In this article, we go through the journey of LLM inference and see how it works. ### Notes - [Reorganizing KV cache memory can make models interactive in real-time](https://arpitbhayani.me/notes/reorganizing-kv-cache-memory-can-make-models-interactive-in-real-time): Yandex research demonstrates that manipulating a model's KV cache, which functions as its active memory, can unlock advanced capabilities such as real-time interactivity. This approach, involving shared memory organization, provides a cost-effective alternative to retraining for achieving dynamic model behaviors. - [Organizing a Model's KV Cache Unlocks New Interactive Abilities](https://arpitbhayani.me/notes/organizing-a-model-s-kv-cache-unlocks-new-interactive-abilities): Yandex research demonstrates that re-organizing a language model's KV cache, which functions as its active memory, can unlock new capabilities like real-time interactivity without requiring retraining. This approach allows multiple model instances to share memory or for a single model to play multiple roles simultaneously. - [Design Multi-Context Processing Tools as Capabilities, Not Endpoints](https://arpitbhayani.me/notes/design-multi-context-processing-tools-as-capabilities-not-endpoints): One anti-pattern I keep seeing: mapping MCP tools 1:1 onto a REST API. - [Effective PII Masking Requires Layered Data Classification Beyond Regex](https://arpitbhayani.me/notes/effective-pii-masking-requires-layered-data-classification-beyond-regex): A common failure mode we are seeing is systems leaking PII, and the root cause is almost always the same... People treat masking as a text-replacement problem, not a data-classification problem. - [Retrieving Correct Code for Agentic SDLCs Presents Three Major Problems](https://arpitbhayani.me/notes/retrieving-correct-code-for-agentic-sdlcs-presents-three-major-problems): Every org is building an agentic SDLC in some capacity, but retrieving the right code is super tricky. Here are three big issues you will run into. - [Schema-Driven Data Modeling Is Essential for Deterministic Agent Memory](https://arpitbhayani.me/notes/schema-driven-data-modeling-is-essential-for-deterministic-agent-memory): The more I dig into agent memory, the more I am convinced (strong sentiment because of recent bias) that the schema is the real deal here. - [Automated Verification Ensures End-to-End Correctness and Human Accountability](https://arpitbhayani.me/notes/automated-verification-ensures-end-to-end-correctness-and-human-accountability): Testing and verification is where we all should and will spend most of our time; things that we dreaded are what we are going to do now :) - [Continuous batching achieves high GPU utilization for large language models](https://arpitbhayani.me/notes/continuous-batching-achieves-high-gpu-utilization-for-large-language-models): A single GPU serving an LLM does not process one request at a time. It processes one step at a time, and a step can belong to any request that happens to be ready. Here's how it goes ... - [Tailor AI Code Generation Tradeoffs Per File Based on Module Risk](https://arpitbhayani.me/notes/tailor-ai-code-generation-tradeoffs-per-file-based-on-module-risk): If you are letting AI agents write large chunks of your codebase, here is something I would recommend - decide your tradeoff per file, not as a blanket policy. - [Robust Plumbing and Harness are Essential for Production-Ready AI Agents](https://arpitbhayani.me/notes/robust-plumbing-and-harness-are-essential-for-production-ready-ai-agents): AI agents will retry. They will always retry. Given how long-running agentic loops are, network drops, timeouts, machines rotate, and rate limits kicking in are just part of the deal. - [GPU Drivers Adopt Database Wound-Wait Mutex to Prevent Deadlocks](https://arpitbhayani.me/notes/gpu-drivers-adopt-database-wound-wait-mutex-to-prevent-deadlocks): GPU drivers have a deadlock problem. A single GPU command buffer can reference multiple shared buffers, and those buffers can be locked in any order; the kernel driver is the one that deals with locking. - [Claude's Text Watermark Uses Secret Keys To Derive Randomness](https://arpitbhayani.me/notes/claude-s-text-watermark-uses-secret-keys-to-derive-randomness): Anthropic just explained how Claude's text watermark works, and the approach is pretty neat. Here is how it works... - [Using Plain Integers in MCP Tool Parameters Cuts Agent Errors](https://arpitbhayani.me/notes/using-plain-integers-in-mcp-tool-parameters-cuts-agent-errors): Fun fact: swapping UUIDs for plain integers in your MCP tool parameters cuts agent errors. - [Dispatch Tools Incrementally and Load Schemas Dynamically to Cut Agent Latency](https://arpitbhayani.me/notes/dispatch-tools-incrementally-and-load-schemas-dynamically-to-cut-agent-latency): I was skimming through Microsoft's SUTRADHARA paper, and here are two best practices for agent latency that you might find helpful... - [Cloudflare increases LLM concurrency through precision reduction without quality loss](https://arpitbhayani.me/notes/cloudflare-increases-llm-concurrency-through-precision-reduction-without-quality-loss): Cloudflare published a blog on how they serve Kimi K2.6 and GLM 5.2 at scale, and the memory math behind it is worth digging into. - [AI-Driven Development Shifts Constraints to Judgment and Saying No](https://arpitbhayani.me/notes/ai-driven-development-shifts-constraints-to-judgment-and-saying-no): AI has brought the cost of development close to zero. That should make building easier. It actually makes it harder. When anything can be built, the constraint has shifted to judgment (from time or resources). - [Monitor AI Agent Apologies To Improve Their Context And Performance](https://arpitbhayani.me/notes/monitor-ai-agent-apologies-to-improve-their-context-and-performance): One of the easiest ways to tell whether the context you gave your agent is actually good enough is to look at the "apology" metric. - [Your Specific LLM Task Requires a Custom Performance Benchmark](https://arpitbhayani.me/notes/your-specific-llm-task-requires-a-custom-performance-benchmark): When a public LLM benchmark says one model is better than another, it is testing broad, difficult reasoning and, more importantly, opinionated tasks. - [How Erasure Coding Achieves S3 Durability with Reduced Storage Costs](https://arpitbhayani.me/notes/how-erasure-coding-achieves-s3-durability-with-reduced-storage-costs): The data we store on S3 is replicated multiple times to make sure it is never lost (even in the event of a disaster). - [AI Makes Premature Optimization Effortless Leading to Over-Engineered Code](https://arpitbhayani.me/notes/ai-makes-premature-optimization-effortless-leading-to-over-engineered-code): AI has made it easier to write optimized code on day 0, but it is creating a new problem... - [Idempotency is a must-have for reliable AI agent operations](https://arpitbhayani.me/notes/idempotency-is-a-must-have-for-reliable-ai-agent-operations): AI agents will retry. They will always retry. We have to be ready for it. Given how long-running agentic loops are, network drops, timeouts, and rate limits kicking in are super common. - [System Design, Not Prompting, Optimizes LLM Token Budget Performance](https://arpitbhayani.me/notes/system-design-not-prompting-optimizes-llm-token-budget-performance): We do not think about token budgets until something breaks - the app stops working, a sentence gets cut off midway, etc. Fun fact: token budgets are more of a system design problem :) - [Tool Calls Enable Internal Agent Logic Decomposition and Testability](https://arpitbhayani.me/notes/tool-calls-enable-internal-agent-logic-decomposition-and-testability): Tool calls are just API wrappers, to be honest, not completely true. - [Agentic Systems Encounter Out of Memory Errors Due to Context Accumulation](https://arpitbhayani.me/notes/agentic-systems-encounter-out-of-memory-errors-due-to-context-accumulation): Interestingly, the most common error in agentic systems is the OOM error :) - [Production AI agents face classic software engineering reliability issues](https://arpitbhayani.me/notes/production-ai-agents-face-classic-software-engineering-reliability-issues): Everyone talks about agent intelligence. Then agents reach production - or face even the slightest bit of load - and suddenly the hard problems are: - [Modern Embeddings Represent Contextual Meaning Better Than Static Word2Vec](https://arpitbhayani.me/notes/modern-embeddings-represent-contextual-meaning-better-than-static-word2vec): The word "bank" means something completely different in "river bank" and "bank account". The classic Word2Vec assigns the same vector. - [System Design Fundamentals Remain Crucial for Robust Long-Running Agentic Applications](https://arpitbhayani.me/notes/system-design-fundamentals-remain-crucial-for-robust-long-running-agentic-applications): System design is not important anymore - if you believe this, just wait until your 2-hour agent run fails at step 95 of 100 :) I hope it does not happen, but it actually might. - [Asking for Help is Good, But Quality Matters](https://arpitbhayani.me/notes/asking-for-help-is-good-but-quality-matters): Before you ping a peer, senior, or open a thread asking for help, put a reasonable amount of effort in first to solve the problem. - [If you are deduplicating documents, semantic similarity is probably the](https://arpitbhayani.me/notes/if-you-are-deduplicating-documents-semantic-similarity-is-probably-the): If you are deduplicating documents, semantic similarity is probably the wrong tool for the job. I am building a tool to manage my second brain, and there I n... - [Yes, when the active node goes down, the passive (backup)](https://arpitbhayani.me/notes/yes-when-the-active-node-goes-down-the-passive-backup): Yes, when the active node goes down, the passive (backup) node takes over - but how exactly? How are they configured? BTW, this is where keepalived comes in.... - [Databases were not designed for the agentic space](https://arpitbhayani.me/notes/databases-were-not-designed-for-the-agentic-space): Databases were not designed for the agentic space. It is not about supported data types and algorithms, but rather about the assumptions on which they were b... - [Wrote an essay on the BM25 algorithm that powers Elasticsearch,](https://arpitbhayani.me/notes/wrote-an-essay-on-the-bm25-algorithm-that-powers-elasticsearch): Wrote an essay on the BM25 algorithm that powers Elasticsearch, Apache Solr, and Apache Lucene. Today, because I had nothing else to do, I went down the rabb... - [Turns out companies are reimagining the entire SDLC around agents](https://arpitbhayani.me/notes/turns-out-companies-are-reimagining-the-entire-sdlc-around-agents): Turns out companies are reimagining the entire SDLC around agents and attempting to move toward a world where engineers might not write a single line of code... - [TDD was ahead of its time](https://arpitbhayani.me/notes/tdd-was-ahead-of-its-time): TDD was ahead of its time. Sure, it was boring, often felt cumbersome, and sometimes even borderline unnecessary when we forced ourselves to do it. But now t... - [Google just released TimesFM (a Time Series Foundation Model) -](https://arpitbhayani.me/notes/google-just-released-timesfm-a-time-series-foundation-model): Google just released TimesFM (a Time Series Foundation Model) - a 200M param model that can forecast time-series data it has never seen before, with no addit... - [Wrote an essay on Product Quantization and how it helps](https://arpitbhayani.me/notes/wrote-an-essay-on-product-quantization-and-how-it-helps): Wrote an essay on Product Quantization and how it helps in vector search by squeezing huge high-dimensional embeddings into tiny codes while still keeping di... - [Wrote an essay on what Q, K, and V matrices](https://arpitbhayani.me/notes/wrote-an-essay-on-what-q-k-and-v-matrices): Wrote an essay on what Q, K, and V matrices are and the roles they play in LLMs. Since I'm on a spree to understand LLMs, I dug deeper into the nuances and p... - [wrote an essay on how LLM inference works](https://arpitbhayani.me/notes/wrote-an-essay-on-how-llm-inference-works): wrote an essay on how LLM inference works. I spent about a week trying to build a clear understanding, and this is my distilled version of it. It covers the ... - [Spent the day going down the rabbit hole of LRU](https://arpitbhayani.me/notes/spent-the-day-going-down-the-rabbit-hole-of-lru): Spent the day going down the rabbit hole of LRU and exploring different variants, each optimized for a certain class of workloads. Here are 5 that I explored... - [Running a distributed system sounds great, until one node starts](https://arpitbhayani.me/notes/running-a-distributed-system-sounds-great-until-one-node-starts): Running a distributed system sounds great, until one node starts doing all the heavy lifting. That's what hot shards are. But why do they occur? Hot shards o... - [Google built QUIC as they got tired of waiting for](https://arpitbhayani.me/notes/google-built-quic-as-they-got-tired-of-waiting-for): Google built QUIC as they got tired of waiting for the internet to catch up :) Let me explain what it is, why it is needed, and how you can see it in action.... - [All databases, in fact, all TCP servers, are susceptible to](https://arpitbhayani.me/notes/all-databases-in-fact-all-tcp-servers-are-susceptible-to): All databases, in fact, all TCP servers, are susceptible to a connection storm. Let's dig deeper to understand what it is and how to handle it. A TCP connect... - [Address matching is a super interesting problem and something I](https://arpitbhayani.me/notes/address-matching-is-a-super-interesting-problem-and-something-i): Address matching is a super interesting problem and something I highly recommend trying to solve from scratch. The core idea is to determine whether two addr... - [When people talk about UDP, we often hear the standard](https://arpitbhayani.me/notes/when-people-talk-about-udp-we-often-hear-the-standard): When people talk about UDP, we often hear the standard textbook thing, but let's dig a level deeper and explore something more practical and interesting. One... - [When building a highly available system, you generally focus on](https://arpitbhayani.me/notes/when-building-a-highly-available-system-you-generally-focus-on): When building a highly available system, you generally focus on one of two strategies 1. reduce mean time to failure, or 2. reduce mean time to repair Depend... - [A few months ago, I was putting together an internal](https://arpitbhayani.me/notes/a-few-months-ago-i-was-putting-together-an-internal): A few months ago, I was putting together an internal doc exploring different ways to handle errors and exceptions. Here are six common approaches that I coul... - [All frontend frameworks are converging](https://arpitbhayani.me/notes/all-frontend-frameworks-are-converging-2): All frontend frameworks are converging. Some time back, I spent some time exploring almost all popular frontend frameworks to pick one for a use case, and I ... - [ElasticSearch is a pretty popular search engine, but what happens](https://arpitbhayani.me/notes/elasticsearch-is-a-pretty-popular-search-engine-but-what-happens): ElasticSearch is a pretty popular search engine, but what happens when we issue an update to a document? It is not as straightforward as you'd think... Elast... - [One project I would highly recommend, if you haven't done](https://arpitbhayani.me/notes/one-project-i-would-highly-recommend-if-you-havent-done): One project I would highly recommend, if you haven't done it already, is to build an HTTP web server from scratch. The server should serve static files, and ... - [I once saw a codebase at a pretty large company](https://arpitbhayani.me/notes/i-once-saw-a-codebase-at-a-pretty-large-company): I once saw a codebase at a pretty large company with 100% test coverage, but the system was still broken. Many big companies obsess over unit tests, and most... - [do one deep research a day](https://arpitbhayani.me/notes/do-one-deep-research-a-day): do one deep research a day. - on any topic you like - on any LLM you prefer I have been digging deeper into Go and databases (ofc), Philosophy and History. L... - [DeepSeek open-sourced their high-performance distributed file system optimized for AI](https://arpitbhayani.me/notes/deepseek-open-sourced-their-high-performance-distributed-file-system-optimized-for-ai): DeepSeek open-sourced their high-performance distributed file system optimized for AI training and inference workloads 🤯 The file system is called 3FS. They ... - [you don't need to watch my videos to become a better engineer.](https://arpitbhayani.me/notes/you-dont-need-to-watch-my-videos-to-become-a): you don't need to watch my videos to become a better engineer. to be honest, it has never been easier to become better. here's what you should do 1. pick an ... - [For the last few days, I have been digging deeper](https://arpitbhayani.me/notes/for-the-last-few-days-i-have-been-digging-deeper): For the last few days, I have been digging deeper into ads engineering, and time and again, I am stumbling on Poisson distribution. Clicks and impressions fo... - [Abstract Thinking Will Define Your Next Decade](https://arpitbhayani.me/notes/abstract-thinking-skill-next-decade): Stop searching for beginner-friendly content, because for hard topics, it doesn't exist. - [Whenever there is a new wave in tech, you will find two camps.](https://arpitbhayani.me/notes/whenever-there-is-a-new-wave-in-tech-you-will): Whenever there is a new wave in tech, you will find two camps. 1. optimists - seeing it as a profound change 2. pessimists - seeing it would collapse or pref... - [LLM Summaries are Ruining Your Learning](https://arpitbhayani.me/notes/do-not-rely-on-summaries): LLMs summarize well, but summaries hinder deep learning. For engineers, relying solely on them creates a surface-level understanding. - [A few weeks back, I spent some time reading about](https://arpitbhayani.me/notes/a-few-weeks-back-i-spent-some-time-reading-about): A few weeks back, I spent some time reading about the internals of MP3 file format, and here is a very high-level overview of it ⚡ The audio is divided into ... - [3 papers to learn how ChatGPT works ⚡](https://arpitbhayani.me/notes/3-papers-to-learn-how-chatgpt-works): 3 papers to learn how ChatGPT works ⚡ - Attention Is All You Need - Language Models are Few-Shot Learners - Improving Language Understanding by Generative Pr... - [Spent this weekend reading about the internals of MP3 file](https://arpitbhayani.me/notes/spent-this-weekend-reading-about-the-internals-of-mp3-file): Spent this weekend reading about the internals of MP3 file format and here is a very high-level overview of it ⚡ The audio is divided into smaller segments b... ### Videos - [Quantization Fundamentals: How LLMs Run Efficiently with Reduced Memory and Fast Arithmetic](https://arpitbhayani.me/videos/quantization-fundamentals-llm-inference): An architectural exploration of quantization in large language models. Learn why integer arithmetic outpaces floating-point operations on modern hardware, how symmetric and asymmetric quantization work, and the mathematical trick behind low-precision matrix multiplication. - [The Engineering Behind Large Language Models: Architecture, Training, and Decoding](https://arpitbhayani.me/videos/engineering-behind-llms-architecture-training-decoding): An architectural breakdown of Large Language Models (LLMs) like ChatGPT, detailing how next-token prediction, Byte Pair Encoding, supervised fine-tuning, and RLHF work under the hood. Learn how decoding strategies like Top-K sampling control randomness and how Retrieval-Augmented Generation eliminates hallucinations. - [Improving Search Relevance with Intent Identification and NLP: Inside Zomato's Architecture](https://arpitbhayani.me/videos/zomato-search-intent-nlp-architecture): Discover how food delivery aggregators like Zomato transition from naive keyword search to intent-aware querying. This deep dive explores how subword tokenization (BPE), Word2Vec embeddings, and BiLSTM-CRF sequence tagging parse multi-entity and conversational queries into targeted Elasticsearch lookups. ## Algorithms & Data Structures ### Blogs - [The Curse of Dimensionality](https://arpitbhayani.me/blogs/curse-of-dimensionality): There is a specific kind of debugging session that haunts ML engineers: the one where your model worked brilliantly on 20 features, so you added 200 more, and now it produces garbage. The training loss looks fine. Accuracy on the training set is great. But generalization has collapsed, inference is slow, and your nearest-neighbor search returns results that are laughably wrong. You did not break anything obvious. You just added more information, which is supposed to help. - [BM25](https://arpitbhayani.me/blogs/bm25): There is a particular kind of respect reserved in engineering for the algorithm that outlives its era. BM25 is one of them. BM25 was born out of information retrieval research in the 1970s and 1980s, polished over decades, and eventually adopted as the default ranking function in Elasticsearch, Solr, and Lucene. - [Bloom Filters](https://arpitbhayani.me/blogs/bloom-filters): A Bloom filter is a probabilistic data structure that answers a very specific question - have I seen this thing before? - while using almost no memory. - [Theta sketches: set algebra over massive streams](https://arpitbhayani.me/blogs/theta-sketches): Most engineers encounter cardinality estimation the same way: they get paged because a COUNT(DISTINCT userid) query is killing the database, and someone suggests HyperLogLog. - [Solving the Knapsack Problem with Evolutionary Algorithms](https://arpitbhayani.me/blogs/genetic-knapsack): Solve the Knapsack problem with a Genetic Algorithm! This guide offers a polynomial-time approximation for this famous optimization challenge. - [Generating Pseudorandom Numbers with LFSR](https://arpitbhayani.me/blogs/pseudorandom-number-generation-lfsr): Explore LFSRs, a simple & efficient pseudorandom number generator widely used in microcontrollers. Learn how they work with code examples. - [Fully Persistent Arrays](https://arpitbhayani.me/blogs/fully-persistent-arrays): Explore Fully Persistent Arrays - Understand how to implement arrays that preserve all previous versions, enabling auditing and historical access. - [How Persistent Data Structures Work](https://arpitbhayani.me/blogs/persistent-data-structures-introduction): Explore persistent data structures - access historical versions, understand partial, full, and confluent persistence, and see real-world applications. - [Count Distinct With Minimal Memory - Flajolet Martin Algorithm](https://arpitbhayani.me/blogs/flajolet-martin): Approximate count-distinct in streams using the Flajolet-Martin algorithm. Dive into its intuition, implementation, and applications. - [Israeli Queues](https://arpitbhayani.me/blogs/israeli-queues): Explore Israeli Queues, a unique priority queue variation where elements join friends already waiting! Learn how they optimize batch processing. - [1D Terrain Generation](https://arpitbhayani.me/blogs/1d-terrain): Explore procedural 1D terrain generation for games using Python. Learn techniques like interpolation and superposition for realistic landscapes. - [MinHash - Fast Jaccard Similarity at Scale](https://arpitbhayani.me/blogs/jaccard-minhash): Learn Jaccard Similarity and MinHash, a technique to efficiently estimate set similarity at scale for tasks like near-duplicate detection. - [Time Series Smoothing for Anomaly Detection](https://arpitbhayani.me/blogs/ts-smoothing): Learn how to optimally smooth time series data using kurtosis to highlight anomalies. Prioritize user attention with this smoothing technique. - [Space-Efficient Counting - Exploring Morris' Algorithm](https://arpitbhayani.me/blogs/morris-counter): Learn about the Morris Algorithm, a probabilistic method for counting large events with minimal memory. Explore its math and implementation. - [Why Slowsort is Hilariously Inefficient](https://arpitbhayani.me/blogs/slowsort): Explore Slowsort, the deterministically worst sorting algorithm! Learn how it works and its "Multiply and Surrender" paradigm. - [Phi Accrual Failure Detection Algorithm](https://arpitbhayani.me/blogs/phi-accrual): Explore Phi Accrual Failure Detection, an adaptive algorithm for detecting failures in distributed systems. Learn how it improves on heartbeats! - [Breaking Repeating-Key XOR Encryption](https://arpitbhayani.me/blogs/decipher-repeated-key-xor): Crack repeating-key XOR ciphers! Learn how to find the key length using Hamming distance and frequency analysis in this crypto challenge. - [ETAOIN SHRDLU - Using Letter Frequency to Decipher the Ciphered](https://arpitbhayani.me/blogs/decipher-single-xor): Crack single-byte XOR ciphers! Learn how to decipher encrypted messages without the key using frequency analysis and Python. - [Fractional Cascading - Speeding Up Multiple Binary Searches](https://arpitbhayani.me/blogs/fractional-cascading): Explore Binary Search variations k-searches, unified search & fractional cascading. Optimize search time in k sorted lists! - [Building Better Ratings with Bayesian Averages](https://arpitbhayani.me/blogs/bayesian-average): Learn how to create a robust rating system using Bayesian Average to rank items effectively. Explore its advantages over arithmetic mean and cumulative ratings, and see how it can be applied using the MovieLens Dataset. - [The Intuition Behind IDF](https://arpitbhayani.me/blogs/idf): Explore Inverse Document Frequency (IDF), a key concept in search & text mining. Learn how it quantifies term rarity and its connection to probability. - [Rule 30 - Generating Random Numbers with Cellular Automata](https://arpitbhayani.me/blogs/rule-30-cellular-automata): Explore Rule 30, a cellular automaton, and its surprising application in pseudorandom number generation. Discover its chaotic patterns! - [Isolation Forest - Fast and Efficient Anomaly Detection](https://arpitbhayani.me/blogs/isolation-forest): Uncover anomalies with Isolation Forest, an unsupervised algorithm. Learn its core principles, tree construction, and scoring for anomaly detection. - [Image Steganography](https://arpitbhayani.me/blogs/image-steganography): Explore image steganography - Hide secret messages within images! Learn techniques, from LSB substitution to JPEG methods. ### Notes - [Bloom Filter Emerged as Key Evidence in OpenAI Copyright Dispute](https://arpitbhayani.me/notes/bloom-filter-emerged-as-key-evidence-in-openai-copyright-dispute): A Bloom filter became key evidence in a multibillion-dollar copyright lawsuit against OpenAI. Did not expect that combination ever to show up... ever. - [Keeping L1 Small in LSM Trees Prevents Excessive Write Amplification](https://arpitbhayani.me/notes/keeping-l1-small-in-lsm-trees-prevents-excessive-write-amplification): Today, in my sys design cohort, we were discussing LSM trees, and an interesting question came up... - [Here is an interesting use case of HyperLogLog you probably](https://arpitbhayani.me/notes/here-is-an-interesting-use-case-of-hyperloglog-you-probably): Here is an interesting use case of HyperLogLog you probably have not seen before - predicting whether adding more RAM to your database will actually help. I ... - [There is a very interesting hashing approach called Robin Hood Hashing](https://arpitbhayani.me/notes/there-is-a-very-interesting-hashing-approach-called-robin-hood-hashing): There is a very interesting hashing approach called Robin Hood Hashing. It is one of those ideas that is both simple and elegant. Hear me out... In standard ... - [Wrote an essay on Bloom filters, but not what you would expect](https://arpitbhayani.me/notes/wrote-an-essay-on-bloom-filters-but-not-what-you-would-expect): Wrote an essay on Bloom filters, but not what you would expect. The essay not only covers what Bloom filters are and how they work, but also the math behind ... - [wrote an essay on terrain generation, the math behind it,](https://arpitbhayani.me/notes/wrote-an-essay-on-terrain-generation-the-math-behind-it): wrote an essay on terrain generation, the math behind it, with some code to generate it. The algorithm is useful in games like Counter-Strike, Age of Empires... - [Fun fact: for a smaller search usecase, using Bloom filters](https://arpitbhayani.me/notes/fun-fact-for-a-smaller-search-usecase-using-bloom-filters): Fun fact: for a smaller search usecase, using Bloom filters to power a full-text search wins over inverted indexes. Here's the counterintuitive insight... An... - [Some time back, I spent some time digging deeper into](https://arpitbhayani.me/notes/some-time-back-i-spent-some-time-digging-deeper-into): Some time back, I spent some time digging deeper into K-D trees and exploring how they fit within spatial databases. K-D trees also find a solid use in ML an... - [PostgreSQL uses lazy pointer swizzling to speed up buffer access,](https://arpitbhayani.me/notes/postgresql-uses-lazy-pointer-swizzling-to-speed-up-buffer-access): PostgreSQL uses lazy pointer swizzling to speed up buffer access, keeping on-disk and in-memory data in sync without costly conversions. Here's how it works.... - [Facebook Messenger moved from NoSQL to SQL for better performance](https://arpitbhayani.me/notes/facebook-messenger-moved-from-nosql-to-sql-for-better-performance): Facebook Messenger moved from NoSQL to SQL for better performance. When FB Messenger launched, it used HBase. However, over time, the CPU started to exhaust ... - [db nugget: uuids bloat indexes](https://arpitbhayani.me/notes/db-nugget-uuids-bloat-indexes): db nugget: uuids bloat indexes. companies that operate at scale often avoid them for transactional use cases. moreover, uuids cause inserts to occur in rando... - [Bloom Filters are more than what you learn from 5-minute](https://arpitbhayani.me/notes/bloom-filters-are-more-than-what-you-learn-from-5-minute): Bloom Filters are more than what you learn from 5-minute videos; let me tell you about an interesting variant of them called Prefix Bloom Filters. Here it go... - [if you find some time, do read about robin hood hashing](https://arpitbhayani.me/notes/if-you-find-some-time-do-read-about-robin-hood-hashing): if you find some time, do read about robin hood hashing. pretty interesting twist in collision resolution. it minimizes variance in key distribution while ha... - [Most databases use B+ Trees to hold the data, but](https://arpitbhayani.me/notes/most-databases-use-b-trees-to-hold-the-data-but-2): Most databases use B+ Trees to hold the data, but they suffer from a major limitation B-trees are designed to keep data sorted and organized, which makes the... - [I always wondered how SQL databases executed the JOINs](https://arpitbhayani.me/notes/i-always-wondered-how-sql-databases-executed-the-joins): I always wondered how SQL databases executed the JOINs. Always knew the theory, but today I spent some time digging into MySQL's code to understand the nuanc... - [Terrain generation in video games is a super interesting problem](https://arpitbhayani.me/notes/terrain-generation-in-video-games-is-a-super-interesting-problem): Terrain generation in video games is a super interesting problem. In 2020, I was getting bored and had nothing to do. So, spent one entire week digging into ... - [Today, I spent some time digging deeper into K-D trees](https://arpitbhayani.me/notes/today-i-spent-some-time-digging-deeper-into-k-d-trees): Today, I spent some time digging deeper into K-D trees and exploring how they fit within spatial databases. K-D trees also find a solid use in ML and geo-pro... - [Trees are not just limited and useful to solving your](https://arpitbhayani.me/notes/trees-are-not-just-limited-and-useful-to-solving-your): Trees are not just limited and useful to solving your LeetCode questions, but they form the crux of most databases. Every single variant of Tree is designed ... - [It is not space vs time, but space vs time vs correctness](https://arpitbhayani.me/notes/it-is-not-space-vs-time-but-space-vs-time-vs-correctness): It is not space vs time, but space vs time vs correctness. If you want to improve on space and time, be okay with giving up on correctness. Bloom filters and... - [While exploring PostgreSQL internals, I stumbled upon an interesting internal](https://arpitbhayani.me/notes/while-exploring-postgresql-internals-i-stumbled-upon-an-interesting-internal): While exploring PostgreSQL internals, I stumbled upon an interesting internal detail about how it stores long rows ⚡ PostgreSQL stores data in B-Trees and re... - [You can understand Bloom Filters through a 5-minute video but](https://arpitbhayani.me/notes/you-can-understand-bloom-filters-through-a-5-minute-video-but): You can understand Bloom Filters through a 5-minute video but it will be on a very surface level ⚡ Nothing beats the joy of diving deep and understanding it ... - [Why do most Bloom Filters use MurmurHash over SHA or MD5](https://arpitbhayani.me/notes/why-do-most-bloom-filters-use-murmurhash-over-sha-or-md5): Why do most Bloom Filters use MurmurHash over SHA or MD5? ⚡ All bloom filter operations (get, put) require the key to be passed through the hash function(s) ... - [Spent Sunday tinkering with maths and created this beautiful wallpaper ⚡](https://arpitbhayani.me/notes/spent-sunday-tinkering-with-maths-and-created-this-beautiful-wallpaper): Spent Sunday tinkering with maths and created this beautiful wallpaper ⚡ I wanted to deep dive into visual mathematics and understand how we can create \"art... - [Most databases use B+ Trees to hold the data, but](https://arpitbhayani.me/notes/most-databases-use-b-trees-to-hold-the-data-but): Most databases use B+ Trees to hold the data, but it suffers from a major limitation ⚡ B-trees are designed to keep data sorted and organized, which makes th... - [Why do most Bloom Filter implementations use MurmurHash over SHA or MD5](https://arpitbhayani.me/notes/why-do-most-bloom-filter-implementations-use-murmurhash-over-sha-or-md5): Why do most Bloom Filter implementations use MurmurHash over SHA or MD5? ⚡ All bloom filter operations (get, put) require the key to be passed through the ha... - [The dynamic programming solution of the 0/1 Knapsack Problem has](https://arpitbhayani.me/notes/the-dynamic-programming-solution-of-the-01-knapsack-problem-has): The dynamic programming solution of the 0/1 Knapsack Problem has a pseudo-polynomial time runtime complexity, but there is a way to generate high-quality sol... - [Ever wondered how random numbers are generated algorithmically](https://arpitbhayani.me/notes/ever-wondered-how-random-numbers-are-generated-algorithmically): Ever wondered how random numbers are generated algorithmically? Here's one of the fastest algorithms to do it. Essay #73: Pseudo-random Number Generation usi... ### Videos - [HyperLogLog: Efficient Cardinality Estimation with Probabilistic Data Structures](https://arpitbhayani.me/videos/hyperloglog-efficient-cardinality-estimation): Explore HyperLogLog, a probabilistic data structure used by systems like Redis to estimate the number of unique elements in a large stream with remarkable memory efficiency. This article delves into the underlying Flajolet-Martin algorithm, explaining how it leverages hashing and the properties of rightmost set bits to provide accurate approximations while consuming a tiny, fixed amount of memory, independent of the dataset size. - [Inverted Index: The Core Data Structure Behind Search Engines](https://arpitbhayani.me/videos/inverted-index-the-core-data-structure-behind-search-engines): Explore the inverted index, the fundamental data structure powering modern search engines. This document details its components, construction process including tokenization, normalization, and linguistic processing, and advanced features like term frequency, position, and offset storage. Learn how optimizations such as sorted posting lists, compression, and tiered indexing enable efficient query processing and high-performance search at scale. - [Bloom Filters from First Principles: Architecture, Trade-Offs, and Internals](https://arpitbhayani.me/videos/bloom-filters-from-first-principles): An in-depth exploration of Bloom filters from first principles. Learn why traditional sets hit memory walls at scale, how bit arrays and non-cryptographic hashing enable space-efficient membership testing, and how to navigate false positive trade-offs and resizing limitations in production. - [Implementing Bloom Filters from Scratch: Internals, Memory Optimization, and False Positive Dynamics](https://arpitbhayani.me/videos/implementing-bloom-filters-scratch-internals-optimizations): A hands-on exploration of building Bloom filters from scratch in Go, examining why standard boolean arrays waste memory, how non-cryptographic hashing like MurmurHash outperforms cryptographic hashes for probabilistic lookups, and how filter sizing impacts empirical false positive rates. - [Implementing Hash Maps with Hash Tables: Internals, Memory Management, and Collision Strategies](https://arpitbhayani.me/videos/implementing-hash-maps-with-hash-tables): An architectural deep dive into implementing generic, robust hash maps on top of hash tables using separate chaining and open addressing. Explores core mechanisms including cached hash keys, memory lifecycle management via destructors, and trade-offs between in-place updates, recency-biased re-insertion, and write-optimized duplicate chaining. - [Implementing Hash Sets with Hash Tables: Separate Chaining vs. Open Addressing](https://arpitbhayani.me/videos/implementing-hash-sets-with-hash-tables): An architectural deep-dive into implementing generic hash sets using hash tables with separate chaining and open addressing. Learn the critical engineering trade-offs around two-step hashing, cached hash codes, generic comparator/destructor function pointers, and tombstone lifecycle management. - [Implementing Hash Table Resizing: Separate Chaining and Open Addressing](https://arpitbhayani.me/videos/implementing-hash-table-resizing): Learn the internal mechanics and implementation strategies for resizing hash tables. This guide explores load factor triggers for growing and shrinking, pointer reallocation trade-offs in separate chaining, and managing soft deletions with dual counters in open addressing. - [Why Dynamic Arrays and Hash Tables Double in Size: Amortized Analysis, Bitwise Modulo, and Shrinking](https://arpitbhayani.me/videos/why-hash-tables-and-dynamic-arrays-double-in-size): An architectural deep-dive into why hash tables and dynamic arrays double their capacity when resizing. Explore the mathematical proof behind amortized O(1) insertions, the bitwise trick replacing expensive modulo arithmetic, and hysteresis strategies to prevent resizing thrash during deletions. - [Hash Table Performance: Load Factors, Collision Resolution, and CPU Cache Locality](https://arpitbhayani.me/videos/hash-table-performance-load-factor-cache-locality): An in-depth analysis of hash table performance mechanics, contrasting separate chaining and open addressing across variable load factors. It explores the critical hardware-level impact of CPU cache lines, memory access patterns, and unrolled chained allocations. - [Double Hashing: Collision Resolution in Hash Tables](https://arpitbhayani.me/videos/double-hashing-hash-table-collision-resolution): Double hashing is an open addressing conflict resolution technique that uses a secondary hash function to calculate key-dependent probe intervals. By varying step sizes per key, it effectively eliminates primary and secondary clustering while ensuring uniform distribution across the hash table. - [Quadratic Probing for Collision Resolution in Hash Tables](https://arpitbhayani.me/videos/quadratic-probing-hash-tables): An in-depth guide to quadratic probing as an open addressing collision resolution strategy in hash tables. Learn how non-linear probe sequences mitigate primary clustering while balancing CPU cache locality and memory access trade-offs. - [Linear Probing for Conflict Resolution in Hash Tables](https://arpitbhayani.me/videos/linear-probing-conflict-resolution-hash-tables): An architectural deep dive into linear probing for open addressing hash tables. Learn how linear probing works, why CPU cache locality gives it near-constant-time average performance, and how primary clustering and poor hash functions introduce performance bottlenecks. - [Hash Table Collision Resolution with Open Addressing and Probing](https://arpitbhayani.me/videos/hash-table-collision-resolution-open-addressing): An architectural exploration of open addressing for resolving hash table collisions without auxiliary data structures. Learn how deterministic probing functions operate, how lookup and insertion paths change, and why soft deletes with tombstones are essential for search correctness. - [Conflict Resolution in Hash Tables with Chaining](https://arpitbhayani.me/videos/conflict-resolution-in-hash-tables-with-chaining): An in-depth exploration of collision resolution in hash tables using chaining. This guide covers linked list implementation strategies, pointer mechanics, operational complexities, and advanced optimizations using self-balancing binary search trees. - [Internal Structure of a Hash Table: The Two-Step Hashing Architecture](https://arpitbhayani.me/videos/internal-structure-of-a-hash-table): Explore the foundational mechanics of hash tables, from language runtime symbol tables to internal bucket provisioning. Learn why real-world implementations rely on a two-step hashing pipeline to achieve amortized O(1) performance while avoiding multi-gigabyte memory allocations. - [The Worst Sorting Algorithm: Deconstructing Slowsort and the 'Multiply and Surrender' Paradigm](https://arpitbhayani.me/videos/worst-sorting-algorithm-slowsort): A deep dive into Slowsort, an intentionally inefficient, deterministic sorting algorithm built on the humorous 'multiply and surrender' paradigm. Understand its recursive mechanics, step-by-step execution, and why its recurrence relation leads to super-polynomial time complexity. - [Recursive Fractal Generation: Live Coding the Sierpinski Triangle in p5.js](https://arpitbhayani.me/videos/sierpinski-triangle-p5js-recursion): Learn how to construct the self-similar Sierpinski Triangle fractal using recursive decomposition and p5.js. This guide walks through triangle midpoint geometry, recursive branching logic, base cases, and visual rendering abstractions in JavaScript. - [Understanding and Visualizing the Flood Fill Algorithm in Python](https://arpitbhayani.me/videos/flood-fill-algorithm-visualization-python): An in-depth guide to the classical 2D Flood Fill algorithm used in computer graphics paint bucket tools. Learn the underlying recursive depth-first search mechanics, implementation details with terminal visualization in Python, and practical performance considerations. - [Sum of Digits Using Recursion in Python](https://arpitbhayani.me/videos/sum-of-digits-using-recursion-in-python): Learn how to compute the sum of digits of a number recursively using arithmetic operators like modulo and floor division. This guide breaks down the recurrence relation, execution stack unwinding, and time-space trade-offs. - [Summation of a List Using Divide and Conquer in Python](https://arpitbhayani.me/videos/summation-of-a-list-using-divide-and-conquer): Learn how to formulate array summation using a divide-and-conquer recursive strategy rather than linear recursion. Understand the recurrence relation, recursion tree structure, and Python implementation trade-offs including slice overheads. - [Summation of a List of Numbers Using Recursion in Python](https://arpitbhayani.me/videos/summation-of-a-list-using-recursion-in-python): A foundational guide to decomposing iterative algorithms into recursive structures using list summation as a case study. Learn how to formulate recurrence relations, choose appropriate base conditions, and analyze call stack overhead versus iterative paradigms. ## Career Growth ### Blogs - [Slop Debt](https://arpitbhayani.me/blogs/slop-debt): Tech debt has rules. You cut a corner to ship on time, you write a comment that says TODO fix this, and six months later someone pays it down. It is annoying but it is bounded. A senior engineer can look at a codebase with tech debt and draw a map of where the bodies are buried. - [Why Half Your Skills Expire Every Few Years](https://arpitbhayani.me/blogs/half-life): That is the half-life of knowledge in computer science and software engineering - the time it takes for half of what you know to be replaced by better tools, approaches, or understanding. For an engineering degree earned in 1930, the half-life was roughly 35 years. By 1960, it had dropped to about a decade. - [How to Write Effective OKRs](https://arpitbhayani.me/blogs/okr): Craft effective engineering OKRs with this practical guide. Learn best practices, avoid common pitfalls, and drive team alignment. - [When to Change Jobs - The 3P Framework](https://arpitbhayani.me/blogs/3p): Is it time for a career change? Use the 3P formula (Paisa, Power, Position) to evaluate your job and unlock your career growth potential. - [How to Remain Unblocked](https://arpitbhayani.me/blogs/keep-yourself-unblocked): Stuck as a software engineer? Learn practical strategies to get unblocked, improve problem-solving, and boost your productivity. - [Habits that Make a Great Programmer](https://arpitbhayani.me/blogs/better-programmer): 8 rituals to level up your programming skills! Learn how to code better, think faster, and build complex systems with these actionable tips. ### Notes - [Choose a Depth, Not a Duration, To Navigate Rabbit Holes](https://arpitbhayani.me/notes/choose-a-depth-not-a-duration-to-navigate-rabbit-holes): I think it is a good thing when you find almost everything interesting. Curiosity that keeps pulling you deeper into a topic is not a bug, but a feature. - [Self-editing agents face Ship of Theseus task drift](https://arpitbhayani.me/notes/self-editing-agents-face-ship-of-theseus-task-drift): If you are building self-improving agents that rewrite their own skill files or prompts, then you are prone to the classic Ship of Theseus problem. - [Fast Stores Can Mask Per-Item State Check Performance Issues](https://arpitbhayani.me/notes/fast-stores-can-mask-per-item-state-check-performance-issues): The classic version of N plus one query shows up in ORMs: one query to fetch a list, then one more query per row to fetch each row's related data. - [Visual Prototypes Offer Superior Product Specification Over Design Documents](https://arpitbhayani.me/notes/visual-prototypes-offer-superior-product-specification-over-design-documents): If you have an idea for a product, do not start with a design doc. Build a quick visual prototype and share it with the team and stakeholders instead. - [Employ Social Proof to Ensure Your Professional Ideas Are Heard](https://arpitbhayani.me/notes/employ-social-proof-to-ensure-your-professional-ideas-are-heard): If your design, engineering decision, or product suggestion is not getting heard, try saying, "I went through blogs from a few companies and spoke with a few people..." instead of, "I think we should do this." - [Building AI for Augmentation Creates Simpler and More Practical Systems](https://arpitbhayani.me/notes/building-ai-for-augmentation-creates-simpler-and-more-practical-systems): When you set out to build an AI or agentic system, think about augmentation, not replacement. Once you internalize that, the systems you build look very different and, to be honest, simpler and more practical. - [Companies Hire Senior Engineers to Re-Solve Familiar Problems Efficiently](https://arpitbhayani.me/notes/companies-hire-senior-engineers-to-re-solve-familiar-problems-efficiently): When I was at Amazon, a new Principal Engineer joined us and, within a few weeks, came up with a problem statement and a pretty robust design that solves it. - [Direct Your Effort Towards Genuine Impact and Clear Personal Goals](https://arpitbhayani.me/notes/direct-your-effort-towards-genuine-impact-and-clear-personal-goals): Hustle culture optimizes for input (work), not output (impact). - [An Ideal Career Concludes With Five Dimensions Equally Balanced](https://arpitbhayani.me/notes/an-ideal-career-concludes-with-five-dimensions-equally-balanced): Burnout hits hard when stress outweighs the rewards. When this happens, even simple tasks feel impossible. This is a signal that something is off - workload, environment, or priorities. - [Struggling While Learning Is Proof You Are Doing It Right](https://arpitbhayani.me/notes/struggling-while-learning-is-proof-you-are-doing-it-right): It is natural to feel overwhelmed (and borderline stupid) when you are learning something difficult and new. To be honest, this is an indication that you are on the right path. - [Optimizations Are Trades Made Within Constraints With No Free Lunch](https://arpitbhayani.me/notes/optimizations-are-trades-made-within-constraints-with-no-free-lunch): Never look at optimization in isolation. It only makes sense in the context of constraints. Every optimization is a trade. There is no free lunch. - [Effort and Intensity, Not Time, Determine Skill Acquisition](https://arpitbhayani.me/notes/effort-and-intensity-not-time-determine-skill-acquisition): It is very common for someone to ask, "How much time will it take for me to learn X or become like Y?" Here is my take - stop measuring how long something takes to learn and start measuring what it takes to get there. - [Leverage Curiosity or Fear to Boost Your Productivity Levels](https://arpitbhayani.me/notes/leverage-curiosity-or-fear-to-boost-your-productivity-levels): Productivity is driven either by curiosity or by fear. - [Resist Rewarding Shortcuts That Undermine First Principles Thinking](https://arpitbhayani.me/notes/resist-rewarding-shortcuts-that-undermine-first-principles-thinking): Do not reward your brain for a "jugaad" you came up with. - [Owning Up to Mistakes Accelerates Learning and Builds Professional Trust](https://arpitbhayani.me/notes/owning-up-to-mistakes-accelerates-learning-and-builds-professional-trust): Back in 2015-16, I once accidentally deleted the "entire production" at Practo. Slight exaggeration, but here's what happened... - [Higher Compensation Limits Job Options But Demonstrable Impact Creates Opportunities](https://arpitbhayani.me/notes/higher-compensation-limits-job-options-but-demonstrable-impact-creates-opportunities): Many senior engineers and leaders fear that higher pay comes with limited options to switch later, and here's my take on it... - [Overcome Feeling Stuck By Prioritizing and Taking Action](https://arpitbhayani.me/notes/overcome-feeling-stuck-by-prioritizing-and-taking-action): I have seen people purchase many books, bookmark endless links, and save a ton of papers, and yet end up feeling stuck and doing nothing. - [Always Make Your Skills Visible To Secure Deserved Opportunities](https://arpitbhayani.me/notes/always-make-your-skills-visible-to-secure-deserved-opportunities): Be visibly competent. - [Improving Engineer Skills In Listening, Communication, And Empathy](https://arpitbhayani.me/notes/improving-engineer-skills-in-listening-communication-and-empathy): Of course, soft skills matter, but which ones? In my opinion, every engineer should get better at these two: active listening and clear communication. - [Leverage Self-Doubt to Drive Learning and Deeper Exploration](https://arpitbhayani.me/notes/leverage-self-doubt-to-drive-learning-and-deeper-exploration): Doubt yourself every day. Imposter Syndrome is real and essential. - [Designing Systems for Failure Ensures Graceful Error Handling and Quick Recovery](https://arpitbhayani.me/notes/designing-systems-for-failure-ensures-graceful-error-handling-and-quick-recovery): How to design great systems? The answer is simple: design for failure. Great systems are not just built for happy paths, but they are designed to handle errors gracefully. - [Sound Confident and Trust Yourself Because Everything Is Figureoutable](https://arpitbhayani.me/notes/sound-confident-and-trust-yourself-because-everything-is-figureoutable): pro tip: get good at sounding confident even when you know nothing. ask questions when essential, and trust yourself to figure the rest out. - [Cultivate Strong Relationships and Empathy to Prioritize Your Tasks](https://arpitbhayani.me/notes/cultivate-strong-relationships-and-empathy-to-prioritize-your-tasks): Working with people is hard, but making them prioritize your work is even harder. Hence, one of the key skills you have to build is getting things done by others. - [Artificial Intelligence Now Writes and Runs My API Tests](https://arpitbhayani.me/notes/artificial-intelligence-now-writes-and-runs-my-api-tests): The way I test APIs looks so different now :) I make Claude write and run tests. I do not think I, or anyone, will ever write cURL or equivalent commands or use a tool in the near future. - [Make code reviews your P0 task to unblock teammates quickly](https://arpitbhayani.me/notes/make-code-reviews-your-p0-task-to-unblock-teammates-quickly): If someone is waiting on you for a code review, that has to be your P0 task. - [Simplify Tasks by Thinking Backwards from Your Desired Outcome](https://arpitbhayani.me/notes/simplify-tasks-by-thinking-backwards-from-your-desired-outcome): Like how it is easier to solve a maze backwards, try to think backwards when given a task or when you have a goal to achieve. Things become much simpler. - [Four Strategies to Build Strong Mental Models for Better Learning](https://arpitbhayani.me/notes/four-strategies-to-build-strong-mental-models-for-better-learning): When you encounter something new, and it does not 'click', in most cases, it happens because you likely do not have a mental model to process it. - [Professional Composure Shifts Workplace Dynamics When Confronting Arrogance](https://arpitbhayani.me/notes/professional-composure-shifts-workplace-dynamics-when-confronting-arrogance): We have all dealt with that colleague who dominates the room, dismisses ideas, and acts like the smartest person there. That's arrogance, but it does not have to ruin your day (I used to get affected a lot)... - [Crashing immediately on startup prevents late-run fixable issues](https://arpitbhayani.me/notes/crashing-immediately-on-startup-prevents-late-run-fixable-issues): If your code depends on a database, an external service, or a specific set of permissions -- verify those conditions the moment the process boots up. If something is missing or misconfigured, crash immediately. - [Clear Goals and Visible Outputs Energize Work and Prevent Burnout](https://arpitbhayani.me/notes/clear-goals-and-visible-outputs-energize-work-and-prevent-burnout): You feel burned out when you are putting in a ton of effort in many directions without a clear goal in mind. - [It Depends Must Be Followed By Explanation](https://arpitbhayani.me/notes/it-depends-must-be-followed-by-explanation): "It depends" is what most senior engineers say when asked almost anything. Yes, it is a real answer, but, according to me, it should be followed by an explanation. - [Asking for Advice Rather Than Feedback Is More Effective](https://arpitbhayani.me/notes/asking-for-advice-rather-than-feedback-is-more-effective): Ask for advice, not feedback. - [Giving More Talks is the Only Way to Improve](https://arpitbhayani.me/notes/giving-more-talks-is-the-only-way-to-improve): If you want to get better at giving talks, there is only one way: give more talks. - [Forming a Career Thesis](https://arpitbhayani.me/notes/forming-a-career-thesis): Nobody knows what things will look like 4 years from now, and there isn't a single right answer. It is uncertain for everyone. But what I strongly believe is ... - [Inbox Zero Builds Trust Through Reliability](https://arpitbhayani.me/notes/inbox-zero-builds-trust-through-reliability): I follow Inbox Zero, and for me, it is genuinely a way to build trust with the people I work with. Here's how... - [Cultivating Curiosity When Your Beliefs Are Challenged](https://arpitbhayani.me/notes/cultivating-curiosity-when-your-beliefs-are-challenged): When someone says something that challenges your beliefs, we often tend to push back or dismiss it. But what if instead, you got curious? - [Do not keep looking for beginner-friendly content, because for harder topics, there is none.](https://arpitbhayani.me/notes/do-not-keep-looking-for-beginner-friendly-content-because-for): Do not keep looking for beginner-friendly content, because for harder topics, there is none. Also, they often optimize for feeling smart rather than becoming... - [Fundamentals Still Matter, Despite AI Handling Implementation](https://arpitbhayani.me/notes/fundamentals-still-matter-despite-ai-handling-implementation): "Do fundamentals still matter?" The moral high ground says - they do, and I agree. But the motivation loop that made people great at fundamentals is broken. - [The Value of Spiky Teams in the Tech Industry](https://arpitbhayani.me/notes/the-value-of-spiky-teams-in-the-tech-industry): I feel the tech industry will have spiky teams in the future, i.e., teams with candidates who are 5/5 in some areas rather than 3/5 across everything. - [Boredom as a signal to find a harder problem](https://arpitbhayani.me/notes/boredom-as-a-signal-to-find-a-harder-problem): Boredom is a signal telling you to find a harder problem. - [Clarity is the difference between a good design doc](https://arpitbhayani.me/notes/clarity-is-the-difference-between-a-good-design-doc): The difference between a good design doc and a great one is usually clarity. - [Don't Use Chat For Critical Decision Documentation](https://arpitbhayani.me/notes/don-t-use-chat-for-critical-decision-documentation): Never capture a critical decision on chat. - [Software Engineering Becomes Project Management Without Innovation](https://arpitbhayani.me/notes/software-engineering-becomes-project-management-without-innovation): Software engineering reduces to just project management at places where there is no innovation. - [Wrote a deep dive on how databases actually execute JOINs](https://arpitbhayani.me/notes/wrote-a-deep-dive-on-how-databases-actually-execute-joins): Wrote a deep dive on how databases actually execute JOINs. This goes back to something I worked on during my master's, when we were asked to build a SQL data... - [Today, I was going through a GitHub blog from 2017,](https://arpitbhayani.me/notes/today-i-was-going-through-a-github-blog-from-2017): Today, I was going through a GitHub blog from 2017, and in it, they shared how they suggest topics for a repository. Here's how it works... The pipeline read... - [In 2022, I started exploring database internals out of pure](https://arpitbhayani.me/notes/in-2022-i-started-exploring-database-internals-out-of-pure): In 2022, I started exploring database internals out of pure curiosity, and now ~70% of my posts revolve around them :) This is how I dig deeper and try to ma... - [Venting Can Hurt Your Reputation at Work](https://arpitbhayani.me/notes/venting-can-hurt-your-reputation-at-work): We all vent at work. That is normal. Tough sprints, messy decisions, frustrating meetings - it happens, and letting off steam is okay and, in fact, healthy. - [The Wisdom of Choosing What You Can Ignore](https://arpitbhayani.me/notes/the-wisdom-of-choosing-what-you-can-ignore): Enjoy not knowing. - [Intentionally Go Deep Based on Curiosity and Career](https://arpitbhayani.me/notes/intentionally-go-deep-based-on-curiosity-and-career): Every engineer I know has asked this at some point: "How deep should I actually go?" According to me, the decision to go deep down the rabbit hole comes down to two things: - [Toxic productivity and the need for sustainable rest](https://arpitbhayani.me/notes/toxic-productivity-and-the-need-for-sustainable-rest): Here's something that doesn't get talked about enough - there's a version of productivity that doesn't actually serve you. It feels like ambition or discipline, but underneath it is something different and toxic. - [Delusional People Win by Building at Speed of Thought](https://arpitbhayani.me/notes/delusional-people-win-by-building-at-speed-of-thought): Delusional people win when building happens at the speed of thought. If you are delusional, you are going to build something that nobody else is willing to build. That is the point. - [Curiosity Alone Does Very Little Unless Applied](https://arpitbhayani.me/notes/curiosity-alone-does-very-little-unless-applied): Curiosity by itself does very little unless it is put to use. - [Thinking Is a Habit, Not an Innate Talent](https://arpitbhayani.me/notes/thinking-is-a-habit-not-an-innate-talent): Thinking is not a talent you have; it is a habit you build. - [Software Knowledge Decay Requires Weekly Learning Investment](https://arpitbhayani.me/notes/software-knowledge-decay-requires-weekly-learning-investment): The half-life of software and cs engineering knowledge is ~7 years. - [We all have a negativity bias.](https://arpitbhayani.me/notes/we-all-have-a-negativity-bias): We all have a negativity bias. We tend to focus more on what we lack than on what we have. This is why impostor syndrome is natural - we see both our strengt... - [If you are looking for a New Year's resolution, here's a good one.](https://arpitbhayani.me/notes/if-you-are-looking-for-a-new-years-resolution-heres): If you are looking for a New Year's resolution, here's a good one. Watch all the videos on my YouTube channel. They will change your perspective on system de... - [If there was one sci-fi book you should read this year, it has to be Project Hail Mary.](https://arpitbhayani.me/notes/if-there-was-one-sci-fi-book-you-should-read): If there was one sci-fi book you should read this year, it has to be Project Hail Mary. It is the story of an astronaut who wakes up in space and remembers n... - [Bureaucracy takes over when innovation runs out.](https://arpitbhayani.me/notes/bureaucracy-takes-over-when-innovation-runs-out): Bureaucracy takes over when innovation runs out. When there is a real problem to solve and room to do something new, engineers and leaders do not have time f... - [I never understood the need for a granular planning of projects.](https://arpitbhayani.me/notes/i-never-understood-the-need-for-a-granular-planning-of): I never understood the need for a granular planning of projects. You know something needs to be done, you make your rough estimates, and then you run with it... - [Recently, I finished reading 'The Book of Clarity' by Paras Chopra!](https://arpitbhayani.me/notes/recently-i-finished-reading-the-book-of-clarity-by-paras): Recently, I finished reading 'The Book of Clarity' by Paras Chopra! I would highly recommend this book if you are starting up. It is a quick gist of all the ... - [As engineers, you will always be tempted to go down the rabbit hole while reading anything dense, be it a paper, blog, or book](https://arpitbhayani.me/notes/as-engineers-you-will-always-be-tempted-to-go-down): As engineers, you will always be tempted to go down the rabbit hole while reading anything dense, be it a paper, blog, or book. Comprehending a few sections ... - [A simple check I use: if I imagine myself a year from now, will I wish I had stopped doing this sooner?](https://arpitbhayani.me/notes/a-simple-check-i-use-if-i-imagine-myself-a): A simple check I use: if I imagine myself a year from now, will I wish I had stopped doing this sooner? If the answer shows up immediately, that's a sign. Ma... - [Risk is part of building meaningful things.](https://arpitbhayani.me/notes/risk-is-part-of-building-meaningful-things): Risk is part of building meaningful things. - [If you think you've made a bad career decision, fix it.](https://arpitbhayani.me/notes/if-you-think-youve-made-a-bad-career-decision-fix): If you think you've made a bad career decision, fix it. Switch teams, orgs, or even domains if needed. Time is finite and precious - spend it on work that tr... - [The best plan A has a great plan B standing behind it.](https://arpitbhayani.me/notes/the-best-plan-a-has-a-great-plan-b-standing): The best plan A has a great plan B standing behind it. - [It's not about how many times someone succeeds, but how costly it is for them to fail.](https://arpitbhayani.me/notes/its-not-about-how-many-times-someone-succeeds-but-how): It's not about how many times someone succeeds, but how costly it is for them to fail. - [Complete the course, playlist, or roadmap you've already started before jumping to the next shiny new resource.](https://arpitbhayani.me/notes/complete-the-course-playlist-or-roadmap-youve-already-started-before): Complete the course, playlist, or roadmap you've already started before jumping to the next shiny new resource. Completing one will have far more impact than... - [When Emotions Spill Over at Work](https://arpitbhayani.me/notes/emotions-at-work): Emotional outbursts are natural. I've been there too, and I've seen teams struggle because of it. We all have moments when the pressure gets too much, and emotions spill out. - [Meetings With No Agenda Are a Waste of Time](https://arpitbhayani.me/notes/meetings-with-no-agenda-are-a-waste-of-time): We've all been in meetings where no one really knows why they're there or what's about to happen. Always attach an agenda doc or at least a clear description when you schedule a meeting. - [Growth Isn't About Doing Everything](https://arpitbhayani.me/notes/growth-is-not-about-doing-everything): I follow a simple flow of questions that helps me stay focused, improve consistently, and make incremental impact at workplace. I'm never running around like a headless chicken. Here are the questions I ask myself, and answer honestly, like really true to its core - [If you really want to learn or achieve something, you will find a way.](https://arpitbhayani.me/notes/if-you-really-want-to-learn-or-achieve-something-you): If you really want to learn or achieve something, you will find a way. If not, you will likely find an excuse. - 'don't have the time.' - 'job keeps me occup... - [Career Longevity Beats Constant Job Hopping](https://arpitbhayani.me/notes/career-longevity-vs-job-hopping): Frequent job switches can be great for short-term financial gains. I believed that early in my career as well, but here’s what I’ve learnt over the years. - [Should You Do a Master's My Honest Take](https://arpitbhayani.me/notes/masters): If you're aiming for research, go for a top school and squeeze every drop of value. If you want to switch domains or countries but can't break in otherwise (via job switches), a master's can help bridge that gap. But, doing it just because it feels like the “next step” is usually not worth it. - [Most people fall into a hollow productivity trap and think they are actually productive.](https://arpitbhayani.me/notes/most-people-fall-into-a-hollow-productivity-trap-and-think): Most people fall into a hollow productivity trap and think they are actually productive. And no, I am not talking about just being busy. Hollow productivity ... - [My research paper just got published 🎉, and we were](https://arpitbhayani.me/notes/my-research-paper-just-got-published-and-we-were): My research paper just got published 🎉, and we were able to improve the cache-hit ratio for nginx workloads by 146%. Last week, Aayush and I were brainstormi... - [How can you not know this?](https://arpitbhayani.me/notes/how-can-you-not-know-this): 'How can you not know this?' ... is the worst thing you can say Junior engineers or those slightly unfamiliar with the domain may have relatively trivial dou... - [Empathy Makes Great Engineers Unstoppable](https://arpitbhayani.me/notes/empathy-makes-great-engineers-unstoppable): Remember, your job is to solve a problem, not just write code. You are not a code monkey who just hammers the keyboard. You are on a journey to build something that millions use, and for that, you have to - [ULIDs are great, but they are not the ultimate ID](https://arpitbhayani.me/notes/ulids-are-great-but-they-are-not-the-ultimate-id): ULIDs are great, but they are not the ultimate ID generation solution, in fact, no algorithm or approach is ideal. Remember, the only truth of computer scien... - [You are only as good as the last problem you solved.](https://arpitbhayani.me/notes/you-are-only-as-good-as-the-last-problem-you): You are only as good as the last problem you solved. Solving one hard problem years ago and doing nothing since is just living in the past; you make a real i... - [Good Mentors Build People, Not Just Skills](https://arpitbhayani.me/notes/good-mentors-build-people): Mentoring someone is one of the most satisfying ways to share what you've learned and see someone grow because of it, but doing it well is what makes the difference. - [Why You Should Always Have Back-Burner Projects](https://arpitbhayani.me/notes/always-have-back-burner-projects): If you have more than 5 years of experience, always keep a few small projects ready on the back burner. These are ideas you can pick up and run with at any time. - [productivity hack: do not sign in to YouTube or social accounts on office machines, and notice how much time you save and how focused you become.](https://arpitbhayani.me/notes/productivity-hack-do-not-sign-in-to-youtube-or-social): productivity hack: do not sign in to YouTube or social accounts on office machines, and notice how much time you save and how focused you become. - [Before You Push Back, Know What You're Standing On](https://arpitbhayani.me/notes/before-you-push-back-know-what-youre-standing-on): When participating in conversations, meetings, or discussions, we're often very confident in what we're saying and the points we're putting forward. But pause for a moment and ask yourself - do you truly know, or are you assuming, vaguely remembering, or guessing with confidence? - [Writing a Design Document Improves Project Ideas](https://arpitbhayani.me/notes/writing-a-design-document-improves-project-ideas): if you think you have a great project idea, try writing a design doc for it; you will either - [Be the One They Can Count On](https://arpitbhayani.me/notes/be-the-one-they-can-count-on): Dependable always beats the brilliant; if people can't count on you, nothing else matters. - [How Much Are People Willing to Bet on You](https://arpitbhayani.me/notes/how-much-people-bet-on-you): If you are known for owning outcomes and driving results, leadership will trust you with higher-stakes work because the most important projects go to those who get things done. - [Everyone tells you to dig deeper, and](https://arpitbhayani.me/notes/everyone-tells-you-to-dig-deeper-and): Everyone tells you to dig deeper, and It's great that you want to. But there's no point digging into places that no one cares about. Every time you go one le... - [Curiosity-driven development is the best approach to software](https://arpitbhayani.me/notes/curiosity-driven-development-is-the-best-approach-to-software): nothing beats curiosity-driven development. - [How to Get Leadership to Say Yes to Your Project](https://arpitbhayani.me/notes/how-to-get-leadership-to-say-yes-to-your-project): A few years back, I proposed a "brilliant" idea to my leadership, and it got rejected. That day, I learnt what turns an idea into a funded project. - [Don't Let Your Best Ideas Die in Silence](https://arpitbhayani.me/notes/dont-let-your-best-ideas-die-in-silence): Say you have an idea, something that could change your company's or product's trajectory and fast-track your career growth. What do you do? - [Retention is the worst way to measure understanding.](https://arpitbhayani.me/notes/retention-is-the-worst-way-to-measure-understanding): Retention is the worst way to measure understanding. Whenever you are reading a new concept, do not optimize to remember and retain it word by word; instead,... - [Be the Person Everyone Wants to Work With](https://arpitbhayani.me/notes/be-someone-others-want-to-work-with): Beyond a point, your reputation determines how high you will go in the career ladder. And it takes months, sometimes years, to build one that truly matters. - [The XY Problem and How to Avoid It](https://arpitbhayani.me/notes/dont-fall-for-xy-problem-ask-right-questions): We often focus on the wrong problem when asking for help. Instead of describing what we actually want to achieve, we end up asking about a side issue, i.e., instead of asking about X, we end up asking about Y. Let me explain... - [You Won't Be Promoted Unless You Ask](https://arpitbhayani.me/notes/promotions-are-proactive-not-reactive): Chasing promotions is important, but it shouldn't consume all your energy. Even if it's your main focus, that's okay. Just make sure you're also growing, doing work you're proud of, and finding peace in what you do. - [It's Not Enough to be Right; Learn to be Heard](https://arpitbhayani.me/notes/not-enough-to-be-right-learn-to-be-heard): Once you're in the system and thinking deeply, you'll start to notice inefficiencies and gaps. You might see decisions being made that feel wrong. But instead of putting your point across bluntly, it's important to raise it thoughtfully. - [Phone on silent mode + thrown in another room.](https://arpitbhayani.me/notes/phone-on-silent-mode-thrown-in-another-room): Phone on silent mode + thrown in another room. I've been doing this for months before posting today. I only check my phone three or four times a day - no not... - [A good question to ask yourself: a year from now, what will you regret about something you're doing today?](https://arpitbhayani.me/notes/a-good-question-to-ask-yourself-a-year-from-now): A good question to ask yourself: a year from now, what will you regret about something you're doing today? If the answer is clear, stop doing it today. Time ... - [No One Ships Great Software Alone](https://arpitbhayani.me/notes/no-one-ships-alone): The best engineers ask for help early and often. We all have blind spots - technical, architectural, and just plain human. - [If you're only learning while preparing for interviews, something's fundamentally off.](https://arpitbhayani.me/notes/if-youre-only-learning-while-preparing-for-interviews-somethings-fundamentally): If you're only learning while preparing for interviews, something's fundamentally off. We work in such a fascinating domain, explore it out of curiosity, and... - [Don't waste time finding the best resource, because the best resource is mythical 💥](https://arpitbhayani.me/notes/dont-waste-time-finding-the-best-resource-because-the-best): Don't waste time finding the best resource, because the best resource is mythical 💥 When you are an absolute beginner and eager to learn, get your hands dirt... - [You Don't Win by Proving Others Wrong](https://arpitbhayani.me/notes/not-every-mistake-needs-a-correction): Don't be a nitpicker! Learn when to let small mistakes slide and build a positive team culture. Kindness drives progress, not constant correction. - [Setting Up Engineering Teams for Quantifiable Impact](https://arpitbhayani.me/notes/setting-up-engineering-teams-for-quantifiable-impact): All good engineering leaders I know always set their teams up for success; and do this by ensuring their people - [Appreciate Generously; It Costs Nothing, But Builds Everything](https://arpitbhayani.me/notes/build-influence-at-work): If there's one underrated superpower at work, it's giving credit - generously, and often. When your teammate goes out of their way to help, contributes meaningfully, or quietly ships something excellent, take a moment to recognize it, publicly. - [If some event is important, it will reach your ears, maybe eventually, but it will.](https://arpitbhayani.me/notes/if-some-event-is-important-it-will-reach-your-ears): If some event is important, it will reach your ears, maybe eventually, but it will. You don't need to keep up with everything all the time. Your time and ene... - [Not all books are worth your time to complete.](https://arpitbhayani.me/notes/not-all-books-are-worth-your-time-to-complete): Not all books are worth your time to complete. Not all books are textbooks that you read end to end. Not all books are meant to be read in one sitting. Not a... - [Your Soft Skills Aren't Soft at All](https://arpitbhayani.me/notes/your-soft-skills-arent-soft-at-all): Of course, soft skills matter, but which ones? In my opinion, every engineer should be better at these two: active listening and clear communication. - [Before you form an opinion, experience it](https://arpitbhayani.me/notes/experience-before-forming-opinion): Don't just listen, experience! Form opinions based on firsthand understanding. Real impact in work and life demands seeing the full picture. - [Why You Need Both Curiosity and Action to Thrive](https://arpitbhayani.me/notes/curiosity-and-high-bias-for-action): Unlock your potential! Learn how curiosity and action combine to drive impact, avoid stagnation, and achieve real results in your career. - [A Daily Worklog Changed Everything](https://arpitbhayani.me/notes/worklog): A worklog is just a set of things you did grouped by the day. I have been doing this for the last 12 years, and it has been extremely helpful. - [How We Handle Mistakes Defines Us](https://arpitbhayani.me/notes/mistakes-and-growth): Instead of sweeping failures under the rug, own them. When we try to hide our mistakes, we miss out on growth opportunities. Owning up to what went wrong is the first step toward becoming a better engineer. - [Own Your Mistakes](https://arpitbhayani.me/notes/own-it-instead-of-sweeping-it-aside): Learn to own your failures as an engineer. Reflect, take responsibility, and grow from mistakes to build a stronger career. - [Don't Wait. Step Up.](https://arpitbhayani.me/notes/dont-wait-step-up): We all encounter issues and blockers, and it's inevitable, but how well we respond to them says a lot about our effectiveness and efficiency. So, when you face a problem - [Temporary Fixes Are Permanent](https://arpitbhayani.me/notes/temporary-fix-is-permanent): Temporary fixes can become permanent problems. Invest in quality code now to save yourself (or others) headaches later. Ship it right! - [When I interview engineers about estimating database size, they get](https://arpitbhayani.me/notes/when-i-interview-engineers-about-estimating-database-size-they-get): When I interview engineers about estimating database size, they get the table size right but wrongly assume the index is a fixed fraction - say 10% - of the ... - [The more you learn, the easier it gets.](https://arpitbhayani.me/notes/the-more-you-learn-the-easier-it-gets): The more you learn, the easier it gets. The hardest part of anything is the beginning, when everything feels unfamiliar and complex. But learning compounds. ... - [spent some time digging deeper into AVX2 - a SIMD](https://arpitbhayani.me/notes/spent-some-time-digging-deeper-into-avx2---a-simd): spent some time digging deeper into AVX2 - a SIMD instructions set that allows cpu to process multiple data elements in parallel within a single instruction.... - [disagreements without data are just opinions.](https://arpitbhayani.me/notes/disagreements-without-data-are-just-opinions): disagreements without data are just opinions. - [Why Interviews Are Biased And What Sets You Apart](https://arpitbhayani.me/notes/interview-bias-and-what-sets-you-apart): Interviews are unfair and will remain so, no matter how hard we try they can never evaluate people 100% objectively with clear measurables; and the intuition and gut feel of the interviewer will always add a small bias. - [math is more beautiful when you can visualize it](https://arpitbhayani.me/notes/math-is-more-beautiful-when-you-can-visualize-it): math is more beautiful when you can visualize it. implemented gradient-boosted decision trees after a long time. Seeing the curve fitting the non-linear data... - [Saying 'This isn't my problem' is actually the problem](https://arpitbhayani.me/notes/saying-this-isnt-my-problem-is-a-problem): You must show a high bias for action at work, take ownership, and make an impact. Here are some actions that you can apply right away at work to earn some brownie points - [Never Lose a Battle due to Miscommunication](https://arpitbhayani.me/notes/miscommunication): At your workplace, keep people informed. Driving a project or working on an individual item, you should always keep the people informed about - progress, clarity, and timeline. - [want to stay relevant?](https://arpitbhayani.me/notes/want-to-stay-relevant): want to stay relevant? learn how to learn. - [Lead Projects That Land, Execution Over Everything](https://arpitbhayani.me/notes/lead-projects-that-land): If you are leading a project, your only responsibility is to ensure it is delivered, whatever it takes. Here are a few pointers that I have followed - [Most engineers get stuck at the senior level (L5) and find it difficult to move up to the staff (L6).](https://arpitbhayani.me/notes/most-engineers-get-stuck-at-the-senior-level-l5-and): Most engineers get stuck at the senior level (L5) and find it difficult to move up to the staff (L6). Last week, I teamed up with Gregor Ojstersek and wrote ... - [When working on a new project, we engineers almost always start with the most fascinating part.](https://arpitbhayani.me/notes/when-working-on-a-new-project-we-engineers-almost-always): When working on a new project, we engineers almost always start with the most fascinating part. But, while it's exciting for us, it's not always what's best ... - [Life is a gradient descent.](https://arpitbhayani.me/notes/life-is-a-gradient-descent): Life is a gradient descent. With all the ups and downs, tracing a direct path to global optima is nearly impossible. So, you have to keep finding the local o... - [If you're capable of performing at the L+1 level, start doing so - do not wait to be promoted or compensated for it first](https://arpitbhayani.me/notes/if-youre-capable-of-performing-at-the-l1-level-start): If you're capable of performing at the L+1 level, start doing so - do not wait to be promoted or compensated for it first. You are promoted, because you have... - [Clout chasers share and sell comforting lies, but those who care about your growth will tell you uncomfortable truths.](https://arpitbhayani.me/notes/clout-chasers-share-and-sell-comforting-lies-but-those-who): Clout chasers share and sell comforting lies, but those who care about your growth will tell you uncomfortable truths. - [We Engineers Suck at Task Estimation](https://arpitbhayani.me/notes/we-engineers-suck-at-task-estimation): We engineers are terrible at estimating timelines. Here's a neat trick - [Shiny Obect Syndrome in Tech](https://arpitbhayani.me/notes/shiny-object-syndrome-in-tech): With the tech moving and evolving so fast, every few years, evaluate the work you are doing vs what the world is doing. Do not let the gap widen. - [Why are managers even needed if they are not coding?](https://arpitbhayani.me/notes/why-are-managers-even-needed-if-they-are-not-coding): Why are managers even needed if they are not coding? are they supposed to code? why are they paid so much? And more importantly, should you become a manager ... - [at least once in your career, take a step back, and](https://arpitbhayani.me/notes/at-least-once-in-your-career-take-a-step-back): at least once in your career, take a step back, and - find an audacious problem worth solving - join a team with passion and grit - find a leader who is chas... - [Not every project is exciting and is a chance to learn new skills or tackle fascinating challenges, and that's okay.](https://arpitbhayani.me/notes/not-every-project-is-exciting-and-is-a-chance-to): Not every project is exciting and is a chance to learn new skills or tackle fascinating challenges, and that's okay. Some of the most impactful work in your ... - [Everything eventually becomes boring, so make the most of it while it still interests you.](https://arpitbhayani.me/notes/everything-eventually-becomes-boring-so-make-the-most-of-it): Everything eventually becomes boring, so make the most of it while it still interests you. - [Sometimes a complete rewrite is the only option](https://arpitbhayani.me/notes/sometimes-a-complete-rewrite-is-the-only-option): Sometimes a complete rewrite is the only option. But this does not mean you keep rewriting the entire codebases to adopt the new fancy language or framework.... - [Leave your job with grace and gratitude.](https://arpitbhayani.me/notes/leave-your-job-with-grace-and-gratitude): Leave your job with grace and gratitude. It is quite natural to feel a dip in motivation toward the end, but how you exit reflects your professionalism. Ther... - [the world has moved beyond your ability to remember.](https://arpitbhayani.me/notes/the-world-has-moved-beyond-your-ability-to-remember): the world has moved beyond your ability to remember. - [if for 3 months straight you dread waking up on Monday, it is time to](https://arpitbhayani.me/notes/if-for-3-months-straight-you-dread-waking-up-on): if for 3 months straight you dread waking up on Monday, it is time to - re-evaluate the company you are working for - re-evaluate the work you have been doin... - [Never believe that there is just one solution to a problem.](https://arpitbhayani.me/notes/never-believe-that-there-is-just-one-solution-to-a): Never believe that there is just one solution to a problem. - [Build a habit of reading 100 pages in one sitting.](https://arpitbhayani.me/notes/build-a-habit-of-reading-100-pages-in-one-sitting): Build a habit of reading 100 pages in one sitting. This one skill can help you become a top 0.1% in your domain. Be it learning or working, getting into the ... - [While exploring deadlock management in databases, I stumbled upon an](https://arpitbhayani.me/notes/while-exploring-deadlock-management-in-databases-i-stumbled-upon-an): While exploring deadlock management in databases, I stumbled upon an interesting aspect involving descending indexes and slow-function implementations. Let's... - [Next time a Java "expert" asks me to write extensible,](https://arpitbhayani.me/notes/next-time-a-java-expert-asks-me-to-write-extensible): Next time a Java \"expert\" asks me to write extensible, abstracted, and verbose code; I am going to show him/her this snippet and have some fun 😅 Look how m... - [Code reviews are essential, and here's how I review code](https://arpitbhayani.me/notes/code-reviews-are-essential-and-heres-how-i-review-code): Code reviews are essential, and here's how I review code written in an unfamiliar language or an unfamiliar codebase 1. Check for code readability 2. Check f... - [It is easy to build complex systems and come up](https://arpitbhayani.me/notes/it-is-easy-to-build-complex-systems-and-come-up): It is easy to build complex systems and come up with complex solutions, but a good engineer will always find a simpler solution to any kind of problem. So, w... - [One coding project that I recommend every engineer to build](https://arpitbhayani.me/notes/one-coding-project-that-i-recommend-every-engineer-to-build): One coding project that I recommend every engineer to build at least once is to write your own JSON parser that converts the given string into a language-nat... - [No company can give you the most exciting, challenging, and impactful project around the year, so the ups and downs in the kind of work you'd get are expected.](https://arpitbhayani.me/notes/no-company-can-give-you-the-most-exciting-challenging-and): No company can give you the most exciting, challenging, and impactful project around the year, so the ups and downs in the kind of work you'd get are expecte... - [Good engineers are never scared to compete.](https://arpitbhayani.me/notes/good-engineers-are-never-scared-to-compete): Good engineers are never scared to compete. Most good engineers I met were highly competitive but in a good way. When they saw a better code, they absorbed i... - [When you join a new org or switch teams in the same, it is quite an unsettling and borderline anxious experience.](https://arpitbhayani.me/notes/when-you-join-a-new-org-or-switch-teams-in): When you join a new org or switch teams in the same, it is quite an unsettling and borderline anxious experience. Here are a few things that I did to ramp up... - [Back your disagreement with data.](https://arpitbhayani.me/notes/back-your-disagreement-with-data): Back your disagreement with data. Whenever you disagree, base your reasoning on hard data and references. Disagreement based solely on a hunch is ineffective... - [It is a common misconception that projects and initiatives are only decided at the top and then percolated down to the engineers for execution.](https://arpitbhayani.me/notes/it-is-a-common-misconception-that-projects-and-initiatives-are): It is a common misconception that projects and initiatives are only decided at the top and then percolated down to the engineers for execution. In reality, l... - [be blunt in asking questions.](https://arpitbhayani.me/notes/be-blunt-in-asking-questions): be blunt in asking questions. it shows your curiosity and genuine interest in knowing the details; more importantly, do not devalue it by saying 'hey, it mig... - [Writing a good, concise, yet detailed self-review is essential to pitch yourself for a good appraisal, a bonus, and even a promotion](https://arpitbhayani.me/notes/writing-a-good-concise-yet-detailed-self-review-is-essential): Writing a good, concise, yet detailed self-review is essential to pitch yourself for a good appraisal, a bonus, and even a promotion. Here are some pointers ... - [I felt like an imposter for the first few months at Google.](https://arpitbhayani.me/notes/i-felt-like-an-imposter-for-the-first-few-months): I felt like an imposter for the first few months at Google. Whenever we switch to a new company or join a new team, the first few months are always scary and... - [Not every time you will get the most exciting and impactful project at work.](https://arpitbhayani.me/notes/not-every-time-you-will-get-the-most-exciting-and): Not every time you will get the most exciting and impactful project at work. This is one of the hard-hitting truths of the domain we work in. Here's how you ... - [Every engineer should work in SRE for at least ~2 years.](https://arpitbhayani.me/notes/every-engineer-should-work-in-sre-for-at-least-2): Every engineer should work in SRE for at least ~2 years. It gives you an unfair advantage as it helps you first-hand experience - infrastructure - database t... - [Not everything needs to be dumbed down.](https://arpitbhayani.me/notes/not-everything-needs-to-be-dumbed-down): Not everything needs to be dumbed down. Some concepts cannot, do not, and should not have a “simple” explanation and should be covered with all their nuances... - [becoming a better engineer is a simple 4-step process](https://arpitbhayani.me/notes/becoming-a-better-engineer-is-a-simple-4-step-process): becoming a better engineer is a simple 4-step process 1. never be content with just know how to use it 2. go deeper and explore the internals 3. code a lot, ... - [Not everything in the real world needs a syllabus.](https://arpitbhayani.me/notes/not-everything-in-the-real-world-needs-a-syllabus): Not everything in the real world needs a syllabus. Throughout our life, we have been conditioned to find a syllabus and stick to it. Going out of the track i... - [Don't Wait, Learn - The Best Resource is Mythical](https://arpitbhayani.me/notes/best-resource-is-mythical): Stop searching for the perfect resource! Focus on consistent learning, critical thinking, and adapting to new information for continuous growth. - [if you want to become a better engineer, just understand and remember](https://arpitbhayani.me/notes/if-you-want-to-become-a-better-engineer-just-understand-and-remember): if you want to become a better engineer, just understand and remember a → b ≠ ~a → ~b not understanding this is the root of all misinformation, confusion, an... - [No question is stupid if you know how to put it across.](https://arpitbhayani.me/notes/no-question-is-stupid-if-you-know-how-to-put): No question is stupid if you know how to put it across. Unfortunately, most people don't how to put forth a critical question in a way that it gets heard and... - [It's not about what you know, but about how you think.](https://arpitbhayani.me/notes/its-not-about-what-you-know-but-about-how-you): It's not about what you know, but about how you think. I speak with many engineers (both senior and junior) daily and one question I get asked a lot is 'How ... - [The Unexpected Benefit of Reading Random Engineering Articles](https://arpitbhayani.me/notes/know-a-lot): Learn how a broad knowledge base, built through consistent learning, can make you a better engineer. Discover the power of cross-pollination and continuous growth! - [Roadmaps Are Limiting Your Growth](https://arpitbhayani.me/notes/out-of-syllabus): Don't let roadmaps limit your growth! Explore beyond the plan to deepen your understanding, boost adaptability, and truly excel as an engineer. - [Never Bad-Mouth Your Past Employers](https://arpitbhayani.me/notes/never-bad-mouth-your-ex-exployer): Don't bad-mouth ex-employers in job interviews! Learn why it hurts your chances and how to discuss past roles professionally and positively. - [Show You're a Culture Fit](https://arpitbhayani.me/notes/culture-fit): Ace your tech interview! Learn how to demonstrate culture fit alongside your skills to land your dream engineering role. - [I recently posted a short/reel video talking about why you](https://arpitbhayani.me/notes/i-recently-posted-a-shortreel-video-talking-about-why-you): I recently posted a short/reel video talking about why you should never remain stuck to a single language and framework. I received an excellent comment from... - [Every company is chaotic.](https://arpitbhayani.me/notes/every-company-is-chaotic): Every company is chaotic. Learn to navigate the chaos. It is an opportunity served on a platter. The one who spots it and grabs it, gets a quick acceleration. - [ULIDs are great, but are they the ultimate ID generation solution](https://arpitbhayani.me/notes/ulids-are-great-but-are-they-the-ultimate-id-generation-solution): ULIDs are great, but are they the ultimate ID generation solution? ⚡ Remember, the only truth of computer science is that - you get some, you lose some. You ... - [Questions to Ask Your Interviewer](https://arpitbhayani.me/notes/questions-for-interviewers): Ace your interview! Discover 7 smart questions to ask the interviewer & gain valuable insights into the company culture and role. - [Go is pretty awesome at managing memory and there is](https://arpitbhayani.me/notes/go-is-pretty-awesome-at-managing-memory-and-there-is): Go is pretty awesome at managing memory and there is no better resource to understand it than its reference page; it is pretty dense ⚡ The document goes in-d... - [One of the unsettling trends I observed at big tech and FAANGs is that people are more interested in critiquing ideas than in understanding them 🤦‍♂️](https://arpitbhayani.me/notes/one-of-the-unsettling-trends-i-observed-at-big-tech): One of the unsettling trends I observed at big tech and FAANGs is that people are more interested in critiquing ideas than in understanding them 🤦‍♂️ BigTech... - [How to Build Trust Through Collaboration](https://arpitbhayani.me/notes/collaboration-communication): Build trust & collaborate effectively! 3 simple rules I used leading engineering teams to foster ownership, execution & better teamwork. - [Do This, Once You Are Out of the Interview Cycle](https://arpitbhayani.me/notes/out-of-vicious-interview-cycle): Break free from the interview cycle! Explore your engineering passions & boost your skills. Find fulfillment and unlock new opportunities. - [Stop Pitching Ideas, Start Pitching Projects](https://arpitbhayani.me/notes/pitch-projects-not-ideas): Stop pitching ideas, start pitching projects! Learn how to get your engineering proposals approved by focusing on execution and planning. - [One really interesting blog I read today was about how](https://arpitbhayani.me/notes/one-really-interesting-blog-i-read-today-was-about-how): One really interesting blog I read today was about how Instagram built and scaled its recommendation system ⚡ They talked about how they leverage interests a... - [Read Those Design Docs, Even the Ones That Seem Irrelevant](https://arpitbhayani.me/notes/read-design-docs): Learn how reading design documents can make you a better engineer. Discover the benefits and practical insights hidden within your company's internal documentation. - [A good codebase is always the one that makes it](https://arpitbhayani.me/notes/a-good-codebase-is-always-the-one-that-makes-it): A good codebase is always the one that makes it lightning fast for anyone to set up, read, understand, and contribute to it. It should not take a week to jus... - [The Best Engineering Lessons Happen During Outages](https://arpitbhayani.me/notes/read-rca-docs): Embrace on-call & RCAs! Level up your engineering skills by learning from production outages & real-world system failures. YouTube playlist included! - [Great Engineers Start Broad](https://arpitbhayani.me/notes/start-generalist): Become a generalist engineer early in your career to build a strong foundation, then specialize later for expertise and impact. Learn how! - [Functions in your code should be no longer than five lines](https://arpitbhayani.me/notes/functions-in-your-code-should-be-no-longer-than-five-lines): Functions in your code should be no longer than five lines ... 🤦‍♂️ This has to be the stupidest practice I have seen many codebases follow. This just fills ... - [You are not hired to just ship features ...](https://arpitbhayani.me/notes/you-are-not-hired-to-just-ship-features): You are not hired to just ship features ... ⚡ but rather ship features that matter. All great engineers I know understand the worth of their work and the bus... - [One of the most interesting projects that I did in](https://arpitbhayani.me/notes/one-of-the-most-interesting-projects-that-i-did-in): One of the most interesting projects that I did in college was to build a search engine from scratch on top of Wikipedia's data ⚡ The best part was to create... - [Once I was reviewing a code and I found that](https://arpitbhayani.me/notes/once-i-was-reviewing-a-code-and-i-found-that): Once I was reviewing a code and I found that at multiple places the joins were avoided in favor of multiple selects ⚡ Upon asking, I got the response - joins... - [I once saw a FAANG codebase with 100% test coverage](https://arpitbhayani.me/notes/i-once-saw-a-faang-codebase-with-100-test-coverage): I once saw a FAANG codebase with 100% test coverage but the system was still broken ⚡ Many big companies obsess over unit tests and most of them chase the va... - [Engineers Should Align Work With Business Priorities](https://arpitbhayani.me/notes/engineers-should-align-work-with-business-priorities): A good engineer always thinks like a product manager ⚡ - [LeetCode has induced instant gratification and made building boring ⚡](https://arpitbhayani.me/notes/leetcode-has-induced-instant-gratification-and-made-building-boring): LeetCode has induced instant gratification and made building boring ⚡ Why most engineers today are not thrilled by building something ground up, like their d... - [It is not worth optimizing your code further ⚡](https://arpitbhayani.me/notes/it-is-not-worth-optimizing-your-code-further): It is not worth optimizing your code further ⚡ We all love optimizing the code we write and making sure it is not wasting any CPU cycles, having memory leaks... - [Do not keep looking for beginner-friendly content ⚡](https://arpitbhayani.me/notes/do-not-keep-looking-for-beginner-friendly-content): Do not keep looking for beginner-friendly content ⚡ Build a habit of reading, watching, and absorbing detailed pieces of information and concepts, because th... - [Programming languages are evolving, and evolving for good ⚡](https://arpitbhayani.me/notes/programming-languages-are-evolving-and-evolving-for-good): Programming languages are evolving, and evolving for good ⚡ Earlier programming languages were classified as OOP, imperative, or functional; and we were stuc... - [Title Inflation](https://arpitbhayani.me/notes/title-inflation): Don't let inflated titles fool you! Focus on building real skills & impact for lasting career growth in software engineering. - [What makes Goroutines highly efficient](https://arpitbhayani.me/notes/what-makes-goroutines-highly-efficient): What makes Goroutines highly efficient? ⚡ Goroutines are not OS-level threads but are threads that are managed by the Go runtime as user-level threads. These... - [Documentation is important, but most companies do it wrong ⚡](https://arpitbhayani.me/notes/documentation-is-important-but-most-companies-do-it-wrong): Documentation is important, but most companies do it wrong ⚡ Either they make you document everything, or there is no documentation at all. In companies wher... - [How do updates work under the hood in Elasticsearch](https://arpitbhayani.me/notes/how-do-updates-work-under-the-hood-in-elasticsearch): How do updates work under the hood in Elasticsearch? ⚡ Elasticsearch uses Lucene to power the full-text search and lookups, and because Lucene stores data in... - [You can always further optimize your code, but stop when it has been optimized and made efficient enough.](https://arpitbhayani.me/notes/you-can-always-further-optimize-your-code-but-stop-when): You can always further optimize your code, but stop when it has been optimized and made efficient enough. - [A very convenient keyword in Go is `defer` which allows](https://arpitbhayani.me/notes/a-very-convenient-keyword-in-go-is-defer-which-allows): A very convenient keyword in Go is `defer` which allows you to defer the execution of a function until the surrounding function returns. I was curious to kno... - [At Work, Find Your Own Projects](https://arpitbhayani.me/notes/find-your-own-project): Level up your engineering career! Learn how to generate innovative project ideas and become a proactive problem-solver. - [Don't be limited by someone else's curation.](https://arpitbhayani.me/notes/dont-be-limited-by-someone-elses-curation): Don't be limited by someone else's curation. - [This afternoon, I got curious about image formats and started](https://arpitbhayani.me/notes/this-afternoon-i-got-curious-about-image-formats-and-started): This afternoon, I got curious about image formats and started exploring the difference between JPEG and PNG, here's something that you will find fascinating ... - [early career - you are paid for your speed of execution](https://arpitbhayani.me/notes/early-career-you-are-paid-for-your-speed-of-execution): early career - you are paid for your speed of execution later stages - you are paid for your ability to prevent blunders During your early stages, you are al... - [Chandrayaan-3 piqued my interest in exploring the actual algorithms that](https://arpitbhayani.me/notes/chandrayaan-3-piqued-my-interest-in-exploring-the-actual-algorithms-that): Chandrayaan-3 piqued my interest in exploring the actual algorithms that power multi-million dollars space mission ⚡ Space missions involve the transmission ... - [Interfaces in Go are costly](https://arpitbhayani.me/notes/interfaces-in-go-are-costly): Interfaces in Go are costly ... let's understand why ⚡ Go, although being a strongly typed language, allows defining methods that accept generic interface ty... - [What are zero-cost abstractions and why do they matter](https://arpitbhayani.me/notes/what-are-zero-cost-abstractions-and-why-do-they-matter): What are zero-cost abstractions and why do they matter? ⚡ When a programming language, like Rust, provides zero-cost abstraction it simply means that high-le... - [Frontend is the worst place to hardcode the errors ⚡](https://arpitbhayani.me/notes/frontend-is-the-worst-place-to-hardcode-the-errors): Frontend is the worst place to hardcode the errors ⚡ Hardcoding of error messages on the front end, although common, is an anti-pattern. The idea flow for er... - [All frontend frameworks are converging ⚡](https://arpitbhayani.me/notes/all-frontend-frameworks-are-converging): All frontend frameworks are converging ⚡ I spent the last couple of days exploring almost all popular frontend frameworks to pick one for a use case and I re... - [I have seen a lot of good engineers getting stuck in tutorial hell, and here's how to get out of it ⚡](https://arpitbhayani.me/notes/i-have-seen-a-lot-of-good-engineers-getting-stuck): I have seen a lot of good engineers getting stuck in tutorial hell, and here's how to get out of it ⚡ Being stuck in a tutorial hell is when you are constant... - [Do not limit yourself to becoming just an API integrator ⚡](https://arpitbhayani.me/notes/do-not-limit-yourself-to-becoming-just-an-api-integrator): Do not limit yourself to becoming just an API integrator ⚡ Even though that is what we do for most of our work, but try to look beyond it, and go deeper and ... - [Go handles errors and exceptions better than Java ⚡](https://arpitbhayani.me/notes/go-handles-errors-and-exceptions-better-than-java): Go handles errors and exceptions better than Java ⚡ Java throws exceptions, while Go is more subtle and treats errors as first-class citizens requiring you t... - [Spent Sunday afternoon prototyping probabilistic counting ⚡](https://arpitbhayani.me/notes/spent-sunday-afternoon-prototyping-probabilistic-counting): Spent Sunday afternoon prototyping probabilistic counting ⚡ Whenever I am reading a paper I always look for something that I can quickly code and build a dee... - [How do you get better at writing and structuring a large codebase?](https://arpitbhayani.me/notes/how-do-you-get-better-at-writing-and-structuring-a): How do you get better at writing and structuring a large codebase? ⚡ More than reading popular books on Design Patterns, two things that helped me write and ... - [If you want to know how payment systems are implemented,](https://arpitbhayani.me/notes/if-you-want-to-know-how-payment-systems-are-implemented): If you want to know how payment systems are implemented, just look at the API documentation of one of the payment gateways ⚡ The available APIs and their sig... - [Why do I read papers](https://arpitbhayani.me/notes/why-do-i-read-papers): Why do I read papers? Because I get to know that I know so little ⚡ While I was reading the paper titled SIEVE, I stumbled upon the list of Cache Eviction al... - [Comments make the code easier to read, but most of](https://arpitbhayani.me/notes/comments-make-the-code-easier-to-read-but-most-of): Comments make the code easier to read, but most of the comments are quite obvious 🤦‍♂️ Ex: the function \"fetch_url\" - fetches the URL. Here are a few point... - [Makefiles are boring but extremely useful ⚡](https://arpitbhayani.me/notes/makefiles-are-boring-but-extremely-useful): Makefiles are boring but extremely useful ⚡ No matter which language, build tool, or framework I am using, Makefiles just work. Although they are very heavil... - [Showing extreme ownership is the easiest way to climb up the ladder faster.](https://arpitbhayani.me/notes/showing-extreme-ownership-is-the-easiest-way-to-climb-up): Showing extreme ownership is the easiest way to climb up the ladder faster. - [Finding a mentor is hard, but it definitely should not be a blocker.](https://arpitbhayani.me/notes/finding-a-mentor-is-hard-but-it-definitely-should-not): Finding a mentor is hard, but it definitely should not be a blocker. - [Designing systems requires a deep understanding of the problem statement and it is better to never write your first line of code unless you understand the context, input, expected output, and potential outcome well; because;](https://arpitbhayani.me/notes/designing-systems-requires-a-deep-understanding-of-the-problem-statement): Designing systems requires a deep understanding of the problem statement and it is better to never write your first line of code unless you understand the co... - [6 Simple Strategies to Cracking Any Tech Interview](https://arpitbhayani.me/notes/six-pointers-to-crack-coding-and-design-interviews): Ace your next tech interview! Learn 6 key strategies - clear communication, smart solutions, and asking the right questions. - [Optimization is a zero-sum game ⚡](https://arpitbhayani.me/notes/optimization-is-a-zero-sum-game): Optimization is a zero-sum game ⚡ When designing any system or writing any code, you always deal with trade-offs. It is space vs time when we code, it is rea... - [Some internal tools at cloud companies like AWS, GCP, and](https://arpitbhayani.me/notes/some-internal-tools-at-cloud-companies-like-aws-gcp-and): Some internal tools at cloud companies like AWS, GCP, and Azure are some of the most highly available systems ever designed ⚡ Tools like internal ticketing s... - [Error and exception handling is an integral part of programming,](https://arpitbhayani.me/notes/error-and-exception-handling-is-an-integral-part-of-programming): Error and exception handling is an integral part of programming, here are 6 different ways to handle error ⚡ 1. throw a general exception with a detailed err... - [We can optimize for anything, and the context determines what we choose to optimize ⚡](https://arpitbhayani.me/notes/we-can-optimize-for-anything-and-the-context-determines-what): We can optimize for anything, and the context determines what we choose to optimize ⚡ Every time we pick something to optimize, we lose something somewhere. ... - [Writing efficient code or queries almost always takes a backseat ⚡](https://arpitbhayani.me/notes/writing-efficient-code-or-queries-almost-always-takes-a-backseat): Writing efficient code or queries almost always takes a backseat ⚡ To get the desired performance, it is almost always cheaper to spend money on hardware ver... - [The coolest thing about Google's Spanner Database is its clock](https://arpitbhayani.me/notes/the-coolest-thing-about-googles-spanner-database-is-its-clock): The coolest thing about Google's Spanner Database is its clock synchronization system - TrueTime ⚡ Distributed systems are infamous for losing consistency du... - [Following roadmaps is like being spoon-fed ⚡](https://arpitbhayani.me/notes/following-roadmaps-is-like-being-spoon-fed): Following roadmaps is like being spoon-fed ⚡ I believe roadmaps curb curiosity and serendipity. A concept that you might have stumbled upon, which could have... - [One paper that sparked my interest in the big data](https://arpitbhayani.me/notes/one-paper-that-sparked-my-interest-in-the-big-data): One paper that sparked my interest in the big data domain was about remote shuffle service ⚡ I always considered Apache Spark as a black box to process massi... - [Pre-signed URLs are great, but should we add an extra](https://arpitbhayani.me/notes/pre-signed-urls-are-great-but-should-we-add-an-extra): Pre-signed URLs are great, but should we add an extra layer of auth? ⚡ Recently, I stumbled upon this question on Duggup, and here's the summary of my detail... - [How do libraries like OpenCV and ImageMagick written in C,](https://arpitbhayani.me/notes/how-do-libraries-like-opencv-and-imagemagick-written-in-c): How do libraries like OpenCV and ImageMagick written in C, work in Go? ⚡ Some of the world's most popular libraries are written in C for their performance an... - [How to benchmark your Go code](https://arpitbhayani.me/notes/how-to-benchmark-your-go-code): How to benchmark your Go code? ⚡ Go comes with a built-in benchmarking framework that gives you the ability to benchmark any code and it reports some interes... - [Pointers are a great way to pass large objects across](https://arpitbhayani.me/notes/pointers-are-a-great-way-to-pass-large-objects-across): Pointers are a great way to pass large objects across functions, but does it really benefit? ⚡ To build a deeper understanding, I did a benchmark of pass by ... - [I am kicking off 30 days of Go challenge on Duggup ⚡](https://arpitbhayani.me/notes/i-am-kicking-off-30-days-of-go-challenge-on-duggup): I am kicking off 30 days of Go challenge on Duggup ⚡ Every day, I will post one interesting nugget about Golang for 30 days straight and cover some deep nuan... - [Before you ship your next big feature, just put it](https://arpitbhayani.me/notes/before-you-ship-your-next-big-feature-just-put-it): Before you ship your next big feature, just put it behind a \"flag\" ⚡ You ship with confidence when you know you have a rollback plan and this simple flag i... - [Your day job should not be your sole source of learning ⚡](https://arpitbhayani.me/notes/your-day-job-should-not-be-your-sole-source-of): Your day job should not be your sole source of learning ⚡ - keep learning on the side - keep diving deep into tough topics - keep exploring things that inter... - [Your job isn't to write code; your job is to help your company succeed.](https://arpitbhayani.me/notes/your-job-isnt-to-write-code-your-job-is-to): Your job isn't to write code; your job is to help your company succeed. Hence, look beyond outputs, and focus on outcomes ⚡ The prerequisite to making a subs... - [Building a career in software engineering is not just about coding ⚡](https://arpitbhayani.me/notes/building-a-career-in-software-engineering-is-not-just-about): Building a career in software engineering is not just about coding ⚡ As you spend more time working in the industry, you will learn and build the following a... - [Senior engineers always juggle the following 3 hats ⚡](https://arpitbhayani.me/notes/senior-engineers-always-juggle-the-following-3-hats): Senior engineers always juggle the following 3 hats ⚡ Hat 1: Product Owner - identify and understand the functional requirements - asks clarifying questions ... - [While going through the release notes of Python 3](https://arpitbhayani.me/notes/while-going-through-the-release-notes-of-python-3): While going through the release notes of Python 3.12, I stumbled upon something interesting ... sub-interpreters ⚡ Python subinterpreters are separate, isola... - [Golang is beautiful and here's an example of its well-designed](https://arpitbhayani.me/notes/golang-is-beautiful-and-heres-an-example-of-its-well-designed): Golang is beautiful and here's an example of its well-designed method interface ⚡ To shuffle an array (slice) there is an inbuilt function named `Shuffle`. C... - [Netflix gave up on strict data consistency and guarantees to](https://arpitbhayani.me/notes/netflix-gave-up-on-strict-data-consistency-and-guarantees-to): Netflix gave up on strict data consistency and guarantees to horizontally scale their API Gateways ⚡ The details covered in the blog are not just specific to... - [Picking the right primary key is one of the most](https://arpitbhayani.me/notes/picking-the-right-primary-key-is-one-of-the-most): Picking the right primary key is one of the most important design decisions of your schema; because an optimal key helps you avoid multiple unnecessary secon... - [To have a stellar career, drive impact, but how?](https://arpitbhayani.me/notes/to-have-a-stellar-career-drive-impact-but-how): To have a stellar career, drive impact, but how? ⚡ Here are five pointers that I focussed on throughout and that helped me accelerate my career, hope they he... - [Just built a SQL connection pool in Go from scratch ⚡](https://arpitbhayani.me/notes/just-built-a-sql-connection-pool-in-go-from-scratch): Just built a SQL connection pool in Go from scratch ⚡ The connection pool seems overwhelming at first, but when you start implementing you realize it is just... - [Why do Go routines take up just 2KB space while](https://arpitbhayani.me/notes/why-do-go-routines-take-up-just-2kb-space-while): Why do Go routines take up just 2KB space while threads take up 1MB? ⚡ The core reason for this efficiency is because goroutines are stackless. Whenever a re... - [Clarity is not what you know you want to do, but it is what you know you want to avoid ⚡](https://arpitbhayani.me/notes/clarity-is-not-what-you-know-you-want-to-do): Clarity is not what you know you want to do, but it is what you know you want to avoid ⚡ There are new tools, languages, frameworks, and even domains turning... - [Spend first 3 years of your career doing these to accelerate your growth ⚡️](https://arpitbhayani.me/notes/spend-first-3-years-of-your-career-doing-these-to): Spend first 3 years of your career doing these to accelerate your growth ⚡️ - become proficient in at least one stack - understand infrastructure and archite... - [Recently, I was going through the source code of Python](https://arpitbhayani.me/notes/recently-i-was-going-through-the-source-code-of-python): Recently, I was going through the source code of Python and found something really interesting ⚡ Python caches small integers to keep its runtime efficient 🤯... - [Since 2016, I have built countless production-grade services in Go,](https://arpitbhayani.me/notes/since-2016-i-have-built-countless-production-grade-services-in-go): Since 2016, I have built countless production-grade services in Go, how do I unlearn? ⚡ Rust is the new hot language out there and everyone seems to be learn... - [Something that always gets us confused](https://arpitbhayani.me/notes/something-that-always-gets-us-confused): Something that always gets us confused. Concurrency vs. Parallelism. Let's debunk it once and for all ⚡ Concurrency: When two or more tasks run during the ov... - [Want to have a thriving career?](https://arpitbhayani.me/notes/want-to-have-a-thriving-career): Want to have a thriving career? Here's my take on it ⚡ Early career - you are paid to get shit done. In later stages - you get paid for your expertise. Durin... - [Look how messy the implementation of Concurrent HashMap 🙃](https://arpitbhayani.me/notes/look-how-messy-the-implementation-of-concurrent-hashmap): Look how messy the implementation of Concurrent HashMap 🙃 Next time a Java \"expert\" asks me to write extensible, abstracted, and verbose code; I am going t... - [Dropbox migrated systems that handle tens of millions of open](https://arpitbhayani.me/notes/dropbox-migrated-systems-that-handle-tens-of-millions-of-open): Dropbox migrated systems that handle tens of millions of open connections, millions of requests per second, and terabits of bandwidth to Enovy ⚡ Envoy and Ng... - [How important is a rate limiter for a system like S3](https://arpitbhayani.me/notes/how-important-is-a-rate-limiter-for-a-system-like-s3): How important is a rate limiter for a system like S3? ⚡ S3 stores data on commodity magnetic hard disks - a classic performance vs cost tradeoff. Given that ... - [Can you see random numbers generated, visually](https://arpitbhayani.me/notes/can-you-see-random-numbers-generated-visually): Can you see random numbers generated, visually? let me show you something that will blow your mind 🤯 I spent some time diving deeper into a domain called Cel... - [A lot of engineers believe RPC is the same as gRPC 🤦‍♂️](https://arpitbhayani.me/notes/a-lot-of-engineers-believe-rpc-is-the-same-as-grpc): A lot of engineers believe RPC is the same as gRPC 🤦‍♂️ RPC stands for Remote Procedure Call and any technique that lets you invoke a function on a remote ma... - [Delivering significant impact is a pre-requisite to having a stellar career; a few pointers](https://arpitbhayani.me/notes/delivering-significant-impact-is-a-pre-requisite-to-having-a): ⚡ Delivering significant impact is a pre-requisite to having a stellar career; a few pointers - focus on outcomes rather than outputs - know what you are wor... - [I have trust issues 🙈](https://arpitbhayani.me/notes/i-have-trust-issues): I have trust issues 🙈 - [How do I manage my time and juggle between work, family, youtube, cohort, and side projects?](https://arpitbhayani.me/notes/how-do-i-manage-my-time-and-juggle-between-work): How do I manage my time and juggle between work, family, youtube, cohort, and side projects? I just do not waste time watching - vlogs, - controversial takes... - [What makes you irreplaceable?](https://arpitbhayani.me/notes/what-makes-you-irreplaceable): What makes you irreplaceable? You do not become irreplaceable just because you built a complex system; you become irreplaceable because you find simple solut... - [Here is a 4-step process I follow to learn new technologies, tools, and frameworks ⚡](https://arpitbhayani.me/notes/here-is-a-4-step-process-i-follow-to-learn): Here is a 4-step process I follow to learn new technologies, tools, and frameworks ⚡ 1. I implement 'Hello world' of, literally, every new thing I am learnin... - [Staying in the comfort zone is the worst we can do to our careers and hence I ensure I switch to an unfamiliar domain that makes me feel like an idiot](https://arpitbhayani.me/notes/staying-in-the-comfort-zone-is-the-worst-we-can): Staying in the comfort zone is the worst we can do to our careers and hence I ensure I switch to an unfamiliar domain that makes me feel like an idiot. Here'... - [Reading books is extremely important for Software Engineers.](https://arpitbhayani.me/notes/reading-books-is-extremely-important-for-software-engineers): Reading books is extremely important for Software Engineers. I read at least one book every 3 months and if you want to follow along ... just go through my p... - [How do I learn new technologies, tools, and frameworks?](https://arpitbhayani.me/notes/how-do-i-learn-new-technologies-tools-and-frameworks): How do I learn new technologies, tools, and frameworks? 1. I implement 'Hello worlds' for most of the things I am learning 2. With experience, you need not i... - [Interview Driven Learning will take you nowhere.](https://arpitbhayani.me/notes/interview-driven-learning-will-take-you-nowhere): Interview Driven Learning will take you nowhere. It will compel you to mug up the 'answers'. The real world is ambiguous with no cheat sheets and no standard... - [Was reading the official spec for GIF image format](https://arpitbhayani.me/notes/was-reading-the-official-spec-for-gif-image-format): Was reading the official spec for GIF image format. It is such a superbly written spec that it makes ZERO assumptions. In a snippet highlighted we can see th... - [I wish people watch more engineering content than laptop unboxing, goodies unboxing, and office tours.](https://arpitbhayani.me/notes/i-wish-people-watch-more-engineering-content-than-laptop-unboxing): I wish people watch more engineering content than laptop unboxing, goodies unboxing, and office tours. They will have a higher chance of cracking FAANG. - [I am very bad at investing money, and hence I have focussed more building skills and increasing my net earning capacity instead.](https://arpitbhayani.me/notes/i-am-very-bad-at-investing-money-and-hence-i): I am very bad at investing money, and hence I have focussed more building skills and increasing my net earning capacity instead. It has paid me a much higher... - [How much DSA does a senior engineer use?](https://arpitbhayani.me/notes/how-much-dsa-does-a-senior-engineer-use): How much DSA does a senior engineer use? Here's my take on it. Recently spoke with Nishant Chahar at length about it. Here's the agenda: - How much DSA is us... - [Essay : Conflict Resolution in Multi-Master setup](https://arpitbhayani.me/notes/essay-conflict-resolution-in-multi-master-setup): Essay #68: Conflict Resolution in Multi-Master setup What happens when two users update the same document at the same time in a multi-master setup? Exactly, ... - [I read ~3 books 📚 a month, and here's what has worked for me 👇](https://arpitbhayani.me/notes/i-read-3-books-a-month-and-heres-what-has): I read ~3 books 📚 a month, and here's what has worked for me 👇 - [ 2 days ] I am very choosy with my book selection - [ 30 mins ] I skim the entire book once... - [Do not restrict yourself to a particular domain; you should know a bit of everything - be it backend, frontend, infra, or design.](https://arpitbhayani.me/notes/do-not-restrict-yourself-to-a-particular-domain-you-should): Do not restrict yourself to a particular domain; you should know a bit of everything - be it backend, frontend, infra, or design. This way, you avoid being d... - [Essay : Everything you need to know about handling node](https://arpitbhayani.me/notes/essay-everything-you-need-to-know-about-handling-node): Essay #63: Everything you need to know about handling node outages in Master Replica setup. This essay talks about the worse - nodes going down - impact, rec... - [10x Engineer DNA](https://arpitbhayani.me/notes/10x-engineer): Unlock 10x engineer potential - Simplify complex problems, own your work, and prioritize business impact. Learn key traits for career growth. ### Videos - [Accelerating Career Growth: Learning, Mindset, and Navigating the Tech Landscape](https://arpitbhayani.me/videos/accelerating-career-growth-learning-mindset-navigating-tech-landscape): This article delves into essential strategies for career acceleration in software engineering, covering how to effectively learn, overcome imposter syndrome, and navigate career breaks. It emphasizes critical thinking, hands-on implementation, and adapting to the rapidly evolving tech job market, including the impact of AI. - [Writing Code That Matters: Prioritizing Impactful Engineering Work](https://arpitbhayani.me/videos/writing-code-that-matters): This article explores the critical importance of writing code that genuinely solves problems, whether they are business challenges, engineering hurdles, or customer pain points. It provides actionable advice for engineers to question project priorities and ensure their efforts contribute to meaningful outcomes, ultimately taking ownership of their career trajectory and impact. - [The Transformative Power of Diverse Programming Languages](https://arpitbhayani.me/videos/the-transformative-power-of-diverse-programming-languages): Learning new programming languages should fundamentally shift your perspective, not just add syntax. This article explores why embracing diverse paradigms, exemplified by languages like C for low-level understanding, Rust for ownership, and Solidity for blockchain, is crucial for adapting to the rapidly evolving software industry and expanding your engineering mindset. - [A Software Engineer's Guide to Technical Writing](https://arpitbhayani.me/videos/software-engineers-guide-to-technical-writing): Discover how establishing a consistent technical writing habit accelerates engineering depth, refines articulation, and clarifies complex mental models. This guide outlines an actionable framework for planning 52 weekly topics, managing digital real estate, and avoiding common pitfalls like LLM-generated fluff. - [A Systematic Framework for Learning a New Programming Language](https://arpitbhayani.me/videos/how-to-learn-a-new-programming-language): Learning a new programming language can be overwhelming due to unfamiliar syntax, paradigms, and idioms. This guide breaks down a practical 4-step framework—project-based scoping, hands-on iteration, avoiding algorithmic cognitive overload, and reading production open-source code—to build true proficiency efficiently. - [A Strategic Framework for Choosing Which Technologies to Learn](https://arpitbhayani.me/videos/how-to-decide-which-technology-to-learn): With new languages, frameworks, and infrastructure tools emerging rapidly, software engineers face constant decision fatigue. This guide provides a strategic decision framework based on career seniority, the 4x improvement threshold, and foundational transferability to maximize your learning return on investment. - [Five Critical Anti-Patterns Every Software Developer Must Avoid](https://arpitbhayani.me/videos/five-anti-patterns-software-developers-must-avoid): Writing working code is only the bare minimum of professional software engineering. This guide breaks down the five critical anti-patterns developers must avoid—from premature scale and cargo-cult design patterns to unnecessary reinvention and technology bias. - [A Systematic Framework for Reading, Understanding, and Retaining Research Papers](https://arpitbhayani.me/videos/how-to-read-research-papers-framework): A comprehensive, battle-tested three-pass framework for software engineers to discover, dissect, and permanently retain complex computer science research papers. Learn how to overcome the illusion of explanatory depth through mental scaffolding, granular analysis, and pedagogical note-taking. - [Will AI Replace Programmers? Automation, Job Hierarchies, and the Future of Software Engineering](https://arpitbhayani.me/videos/will-ai-replace-programmers-future-of-software-engineering): An analytical breakdown of how artificial intelligence impacts software engineering careers through historical patterns of technological automation. It explores the Job Hierarchy Pyramid, the shift from syntax writing to system correctness, and strategies for engineers to remain indispensable. - [A Pragmatic Framework to Learn Better and Faster as a Software Engineer](https://arpitbhayani.me/videos/how-to-learn-better-and-faster-as-a-software-engineer): Continuous skill acquisition is vital for software engineers in an evolving technological landscape. This guide details a five-pillar mental model to capture intrinsic curiosity, overcome friction through rapid jump-starting, prioritize foundational implementations, and leverage parallel time-boxed learning. - [Mastering Non-Technical Engineering Competencies: Communication, Problem-Solving, and Career Mindset](https://arpitbhayani.me/videos/mastering-non-technical-engineering-competencies-communication-problem-solving-career-mindset): An in-depth guide on the critical soft skills and behavioral frameworks that separate average software engineers from high-impact technical leaders. Explores problem-solving mentalities, stakeholder communication, the mechanics of 30-second pitching, and the 'for what' principle of time prioritization. - [How to Get Promoted to Staff Engineer at FAANG](https://arpitbhayani.me/videos/how-to-become-a-staff-engineer-at-faang): Transitioning from Senior to Staff Engineer represents one of the steepest barriers in an individual contributor's career. Learn the five foundational pillars required to demonstrate Staff-level scope, from driving 3x project complexity to cultivating cross-organizational influence and quantifiable business impact. - [Software Engineering Career Acceleration: Reading Research Papers, Navigating Promotions, and the 3P Framework](https://arpitbhayani.me/videos/career-growth-acceleration-software-engineering-qna-01): An actionable guide to accelerating your software engineering career, covering a systematic 4-pass method for reading dense systems research papers, managing upward visibility and 1-on-1s, and applying the 3P decision framework (Paisa, Power, Position) for strategic job moves. - [Architecting a Second Brain: Developer Productivity and Knowledge Management](https://arpitbhayani.me/videos/architecting-a-second-brain-developer-productivity): An architectural breakdown of building a local-first, low-latency Second Brain tailored for software engineers. Learn why plain Markdown files and Obsidian outperform cloud-hosted alternatives like Notion, and how to automate ingestion from books, research papers, and handwritten notes. ## Databases ### Videos - [Bitcask Explained: A Log-Structured, Fast Key-Value Store](https://arpitbhayani.me/videos/bitcask-explained-log-structured-fast-key-value-store): Explore Bitcask, an embedded, log-structured key-value store renowned for its speed and minimal disk I/O. This deep dive covers its architecture, data file format, read/write/delete operations, and the crucial merge/compaction process, highlighting its performance benefits and key limitation: the entire key space must fit in RAM. - [Implementing Redis-Style Transactions in a Custom Database (DiceDB)](https://arpitbhayani.me/videos/implementing-redis-style-transactions-custom-database-dicedb): This article explores the unique transaction model of Redis, which leverages MULTI, EXEC, and DISCARD commands for queuing and atomic execution without traditional rollbacks. We deep dive into implementing this simplified yet powerful transaction mechanism within a custom database, DiceDB, focusing on per-client state management and the implications of a single-threaded architecture. Learn how to build robust transaction capabilities by understanding Redis's approach to consistency and simplicity. - [Graceful Shutdown in Databases: Signal Handling and Concurrency (Redis Internals & Go Implementation)](https://arpitbhayani.me/videos/graceful-shutdown-databases-signal-handling-concurrency-redis-go): This article explores how databases like Redis implement graceful shutdown using operating system signals. It details the importance of handling signals for data integrity and resource cleanup, examines various signal types, and provides a deep dive into implementing a robust graceful shutdown mechanism in Go, including critical concurrency considerations and the use of atomic operations. - [Redis Persistence: Understanding and Implementing Append Only Files (AOF)](https://arpitbhayani.me/videos/redis-persistence-understanding-and-implementing-append-only-files-aof): Redis offers robust data persistence through two primary mechanisms: RDB snapshots and Append Only Files (AOF). This article provides an in-depth exploration of AOF, detailing its commit log approach, high durability, and the critical role of the `BG REWRITE AOF` command in managing file size. It also contrasts AOF with RDB, highlighting their respective trade-offs in terms of data loss, performance, and storage efficiency, culminating in a practical implementation walkthrough. - [Redis Wire Protocol: A Deep Dive into RESP and its Data Types](https://arpitbhayani.me/videos/redis-wire-protocol-resp-data-types): This article explores the Redis Serialization Protocol (RESP), the fundamental wire protocol enabling communication between Redis clients and servers. We delve into RESP's design principles, its various data types—simple strings, integers, bulk strings, arrays, and errors—and understand how each is encoded. The discussion highlights RESP's advantages, such as simplicity, performance, binary safety, and the critical role of prefix-length encoding for efficient network communication in distributed systems. - [How OpenAI Scales PostgreSQL to Power 800 Million ChatGPT Users](https://arpitbhayani.me/videos/how-openai-scales-postgresql-800-million-chatgpt-users): OpenAI manages 800 million ChatGPT users with a single PostgreSQL primary and 50 read replicas. This article dissects their innovative scaling strategies, including write optimization, query tuning, high availability measures, connection pooling with PgBouncer, intelligent caching, and advanced cascading replication techniques, demonstrating how "low-hanging fruit" optimizations can achieve massive scale. - [How MySQL's Midpoint Insertion Strategy Prevents Cache Pollution](https://arpitbhayani.me/videos/mysql-midpoint-insertion-strategy-cache-pollution): This article explores MySQL's InnoDB buffer pool and its unique midpoint insertion strategy. It details how this approach, which divides the buffer pool into young and old sublists, effectively prevents cache pollution during full table scans, a common pitfall of traditional LRU caching, thereby maintaining database performance. - [How Amazon Aurora Achieves Durability with Quorum Writes and Segmented Storage](https://arpitbhayani.me/videos/amazon-aurora-durability-quorum-writes-segmented-storage): This article explores Amazon Aurora's advanced durability mechanisms, focusing on its quorum-based write model and segmented storage architecture. It details how Aurora uses six-way replication and specific quorum configurations to achieve A+1 failure tolerance, ensuring data safety even during major outages. The piece also highlights the role of 10GB segments in enabling rapid data repair and operational simplicity. - [Understanding Storage-Compute Separation in Cloud-Native Databases: An Amazon Aurora Deep Dive (Part 1)](https://arpitbhayani.me/videos/understanding-storage-compute-separation-cloud-native-databases-amazon-aurora-deep-dive-part-1): Amazon Aurora rethinks traditional database architecture for the cloud, emphasizing resiliency and scalability. This article delves into the core concept of storage-compute separation, exploring its benefits like cost efficiency and simplified operations, alongside critical trade-offs such as network bottlenecks and increased transactional costs. It also introduces how Aurora leverages redo logs to overcome these challenges, offering superior performance and operational advantages. - [Understanding Reactive Databases: The DiceDB Approach to Real-time Data](https://arpitbhayani.me/videos/understanding-reactive-databases-the-dicedb-approach-to-real-time-data): Reactive databases fundamentally shift from client-initiated polling to server-pushed updates, ideal for high-interest queries like leaderboards. This paradigm eliminates redundant computation and network traffic, enabling truly real-time applications. DiceDB demonstrates this by allowing clients to subscribe to query results, receiving proactive updates only when the underlying data changes, significantly boosting efficiency. - [DiceDB 1.0: A Fast, Reactive, In-Memory Database for Modern Applications](https://arpitbhayani.me/videos/dicedb-1-0-fast-reactive-in-memory-database-modern-applications): DiceDB 1.0 is an open-source, in-memory database designed for modern hardware, offering high throughput and low latency. Its key innovation is reactivity, pushing real-time data updates to clients without complex polling. This enables developers to build low-latency, real-time applications with significantly reduced complexity. - [Amazon DynamoDB - Paper Explained: Deep Dive into its Architecture and Design Principles](https://arpitbhayani.me/videos/amazon-dynamodb-paper-explained-architecture-design): This article dissects the Amazon DynamoDB paper, exploring its core design goals, workload patterns, and the intricate architecture that enables consistent, low-latency performance at immense scale. It covers data partitioning, replication, leader-follower consensus, write/read paths, and the roles of critical microservices like the Metadata Service, MemDS, and Auto-Admin. - [DragonflyDB's DashTables: A Deep Dive into High-Performance Data Storage](https://arpitbhayani.me/videos/dragonflydb-dashtables-deep-dive-high-performance-data-storage): Explore how DragonflyDB's innovative DashTables achieve 4-15 times faster performance and significantly lower memory overhead compared to Redis's traditional hash tables. This article details the architectural differences, segment-based design, and optimized rehashing mechanisms that make DashTables a superior choice for in-memory key-value stores. - [DragonflyDB's B+ Tree Implementation for Sorted Sets: A Deep Dive into Memory and Throughput Gains](https://arpitbhayani.me/videos/dragonflydb-b-plus-tree-sorted-set-vs-redis-skiplist): Explore how DragonflyDB achieves 25x throughput and 40% memory improvement over Redis for Sorted Sets by using B+ Trees instead of Skip Lists. This article details the architectural differences, memory overhead calculations, and performance benchmarks of both implementations. - [When Your Database ID Hits MAX_INT: Understanding and Solving Auto-Increment Limits](https://arpitbhayani.me/videos/when-database-id-hits-max-int): This article explores the critical issue of database auto-incrementing IDs reaching their maximum integer limit, particularly focusing on MySQL's unique 'duplicate key error' behavior. It details why this occurs and outlines the expensive but necessary solution of altering the column's data type to a larger integer like BIGINT, highlighting the significant operational challenges involved. - [DragonflyDB Architecture: Multi-threading, Shared-Nothing, and High Throughput for 6.43M Ops/Sec](https://arpitbhayani.me/videos/dragonflydb-architecture-multi-threading-shared-nothing-high-throughput): Explore the core architecture of DragonflyDB, a high-performance, multi-threaded drop-in replacement for Redis that achieves 6.43 million operations per second. This deep dive covers its fiber-based concurrency model, the innovative shared-nothing architecture that eliminates data contention, and the message bus mechanism for efficient inter-thread communication, showcasing how it maximizes underlying hardware utilization. - [Database Join Algorithms: How Nested Loop, Sort-Merge, and Hash Joins Work Internally](https://arpitbhayani.me/videos/database-join-algorithms-nested-loop-sort-merge-hash): Explore the internal execution mechanics of relational joins across transactional databases, data warehouses, and distributed engines like Apache Spark. Learn how nested loop, sort-merge, and hash joins function, their memory and computational trade-offs, and how query optimizers choose between them. - [Choosing the Right String Column Data Type: CHAR vs VARCHAR vs TEXT](https://arpitbhayani.me/videos/char-vs-varchar-vs-text-database-string-types): A comprehensive guide to understanding string data types in relational databases like PostgreSQL and MySQL. Explore the internal mechanics of CHAR, VARCHAR, and TEXT, debunk common storage misconceptions like off-page overflow storage, and learn how to make the right architectural choice based on indexing, constraints, and I/O efficiency. - [Time-Series Compression: Delta Encoding and Variable-Length Integers Explained](https://arpitbhayani.me/videos/time-series-compression-delta-encoding-varint): Discover how modern time-series databases like Facebook Gorilla, MongoDB, and Redshift compress metric streams by up to 8x. Learn the mechanics of delta encoding, continuation-bit variable-length integers (Varint), and delta-of-delta compression. - [DATETIME vs TIMESTAMP in Databases: Storage Internals, Timezones, and Trade-Offs](https://arpitbhayani.me/videos/datetime-vs-timestamp-databases): An in-depth architectural comparison between DATETIME and TIMESTAMP database data types. Learn how disk encoding, fractional precision, timezone translation, and the Year 2038 problem dictate the right storage choice for your applications. - [Demystifying Phantom Reads: Anatomy of a Database Concurrency Bug](https://arpitbhayani.me/videos/understanding-phantom-reads-problem): Explore the mechanics of database phantom reads under the Read Committed isolation level through a real-world hands-on example. Learn why concurrent inserts cause aggregate inconsistencies and discover how to eliminate them using Repeatable Read and next-key locking. - [How Instagram Efficiently Serves Hashtags Ordered by Count](https://arpitbhayani.me/videos/how-instagram-efficiently-serves-hashtags-ordered-by-count): Learn how Instagram leverages PostgreSQL partial indexes to efficiently search and serve hashtags ordered by media count. By exploiting the long-tail distribution of hashtag popularity, they reduced sorted rows by over 98% without relying on external search engines. - [Dissecting the GitHub MySQL Master Failover Outage](https://arpitbhayani.me/videos/dissecting-github-mysql-master-failover-outage): An architectural post-mortem of GitHub's 5-hour MySQL failover incident. Learn why database planned maintenance windows exist, how a novel mysqld crash created data divergence during a 6-second window, and how binlog coordinates were used to reconcile state and rebuild read capacity. - [Post-Mortem: How a Single MySQL Index Broke GitHub](https://arpitbhayani.me/videos/how-a-single-mysql-index-broke-github): An in-depth analysis of GitHub's 60-minute outage caused by flipping a composite database index order. Learn how index sorting nuances in MySQL, ORM abstraction blind spots, and query plan regressions can trigger cascading failures across distributed systems. - [What Happens When an Auto-Increment ID Hits Its Max Value: Dissecting the GitHub Outage](https://arpitbhayani.me/videos/what-happens-when-id-column-reaches-max-value-github-outage): An in-depth post-mortem of GitHub's 2020 outage caused by an auto-increment integer reaching its 32-bit limit in MySQL. Learn why MySQL throws duplicate key errors upon integer overflow and explore zero-downtime hot-swap remediation strategies for multi-billion-row tables. - [Designing a Scalable Udemy-Style Taxonomy Hierarchy in SQL](https://arpitbhayani.me/videos/designing-scalable-udemy-taxonomy-hierarchy-sql): Learn how to model and query a multi-level taxonomy hierarchy like Udemy's categories, sub-categories, and topics using a single relational database table. Discover the indexing strategies, self-joins, and window functions needed to achieve high performance even at scale. - [Generating 5 Million Hierarchical Rows in Under 100 Seconds Using Pure SQL](https://arpitbhayani.me/videos/generating-5-million-rows-under-100-seconds-sql): Learn how to rapidly generate over 5 million rows of hierarchical relational test data in under 85 seconds using pure MySQL. By leveraging Cartesian product joins and INSERT INTO SELECT streaming, you eliminate network round-trips and application-layer serialization bottlenecks. ## Developer Tools ### Videos - [Deckrun: A Modern Presentation Utility for Markdown and Self-contained HTML](https://arpitbhayani.me/videos/deckrun-markdown-html-presentation-utility): Deckrun is an open-source presentation utility that allows users to create and deliver presentations using Markdown and self-contained HTML. It features a powerful editor with themes, font customization, and export options (Markdown, PDF, HTML), alongside interactive presentation tools like a laser pointer and pen. This tool offers a lightweight and flexible alternative to traditional presentation software, catering to technical speakers and developers. ## Distributed Systems ### Blogs - [Temporal Primer - Building Long-Running Systems](https://arpitbhayani.me/blogs/temporal-primer): If you have ever taped together a cron job, message queue, a database table for state, and a retry loop - only to watch the whole thing break during a network blip at 2am - you already understand the problem Temporal solves. The fix you built was a workflow engine. Temporal is workflow engine done right. - [Your Monolith Is Already A Distributed System](https://arpitbhayani.me/blogs/monolith-is-distributed-system): You have a monolith, and you are proud of it. One repo, one deployment, one database - no Kubernetes, no service mesh. You have watched teams burn months “extracting microservices” and come out slower than when they started. You stayed sensible. You kept the monolith. - [Databases Were Not Designed For This](https://arpitbhayani.me/blogs/defensive-databases): There is an implicit contract at the foundation of every database architecture decision you have ever made. You probably never wrote it down. Nobody does. It just… existed. - [JOIN Algorithms](https://arpitbhayani.me/blogs/join-algorithms): When you write a SQL query with a JOIN clause, you probably do not think much about what happens next. You just expect the database to return the right rows. But this simple keyword forces your database to make one of the most consequential decisions a query planner makes: which join algorithm should it use? - [Multi-Paxos - Consensus in Distributed Databases](https://arpitbhayani.me/blogs/multi-paxos): Distributed databases face an interesting challenge: how do you ensure that multiple servers scattered across different machines, data centers, or even continents agree on the order and outcome of database transactions? This is where consensus algorithms come into play. - [MySQL Replication Internals](https://arpitbhayani.me/blogs/mysql-replication-internals): MySQL replication enables data synchronization across databases, powering read scaling and even some complex distributed architectures. At the core lies the binary log (binlog), which is the authoritative record of all data modifications on a source server. - [Clock Synchronization Is a Nightmare](https://arpitbhayani.me/blogs/clock-sync-nightmare): Time seems simple. But we engineers lose sleep over something as basic as keeping clocks in sync. Here’s why… - [When You Increase Kafka Partitions](https://arpitbhayani.me/blogs/kafka-partitions): Partitions sit right in the middle of how Kafka works. They define ordering, parallelism, and how far it can scale. But what actually happens when you need more of them? How does Kafka grow that number, what happens to the data you already have, and which guarantees stay intact after the change? - [Heartbeats in Distributed Systems](https://arpitbhayani.me/blogs/heartbeats-in-distributed-systems): In distributed systems, one of the fundamental challenges is knowing whether a node or service is alive and functioning properly. Unlike monolithic applications, where everything runs in a single process, distributed systems span multiple machines, networks, and data centers. This becomes even glaring when the nodes are geographically separated. This is where heartbeat mechanisms come into play. - [How Writes Work in Apache Cassandra](https://arpitbhayani.me/blogs/cassandra-writes): Apache Cassandra is a distributed database designed for high availability and horizontal scalability. This write-up explores the complete write path in Cassandra, from the moment a client sends a write request to how data gets replicated across nodes in the cluster. - [Redis Replication Internals](https://arpitbhayani.me/blogs/redis-replication): One of the most fundamental design decisions in Redis replication is that it's push-based rather than pull-based. This means the master (or primary) actively sends data to replicas, rather than replicas polling the master for updates. - [How Does a CDN Handle Content Replication](https://arpitbhayani.me/blogs/cdn-content-replication): Content Delivery Networks (CDNs) content replication is far more nuanced than most engineers realize. Let's dive deep into how CDNs actually replicate, distribute, and manage content across their global networks. - [Why Distributed Systems Need Consensus Algorithms Like Raft](https://arpitbhayani.me/blogs/why-consensus): Everything we interact with today is a "distributed system". From microservices to cloud-native applications, from databases to message queues. We are constantly building systems that span multiple machines. But there comes a fundamental challenge - how do we ensure that all independent nodes agree on shared state? - [Why Do Databases Deadlock and How Do They Resolve It](https://arpitbhayani.me/blogs/database-deadlocks): Database deadlocks are one of the most challenging concurrency issues encountered in production systems. Understanding why they occur and how databases handle them is important in building robust applications. - [Why Eventual Consistency is Preferred in Distributed Systems](https://arpitbhayani.me/blogs/eventual-consistency): While strong consistency might seem like the obvious choice - given it keeps the data perfectly synchronized at all times - the reality is that eventual consistency has become the preferred approach for most large-scale distributed systems. But why so... - [Paper Notes - SQL Has Problems. We Can Fix Them Pipe Syntax In SQL](https://arpitbhayani.me/blogs/sql-has-problems-we-can-fix-them-pipe-syntax-in-sql): Explore GoogleSQL's new pipe syntax for SQL - Improves readability, extensibility, and debugging with operators like ASSERT and LOG. - [Paper Notes - WTF - The Who to Follow Service at Twitter](https://arpitbhayani.me/blogs/wtf-the-who-to-follow-service-at-twitter): Explore Twitter's recommendation system - in-memory graph processing with Cassovary, random walks, and SALSA for user suggestions. - [Turn System Design Interviews into Discussions](https://arpitbhayani.me/blogs/structure-your-design-interviews): Ace your system design interview! Learn a structured 5-step approach to tackle open-ended questions and showcase your engineering skills. - [Local vs Global Indexes in Partitioned Databases](https://arpitbhayani.me/blogs/how-indexes-work-on-partitioned-and-sharded-data): Explore indexing strategies for partitioned databases, focusing on local and global secondary indexes. Optimize query performance on non-partitioned attributes. - [Partitioning Data - Range, Hash, and When to Use Them](https://arpitbhayani.me/blogs/some-data-partitioning-strategies-for-distributed-data-stores): Partitioning - Learn how to scale your database reads and writes by horizontally partitioning your data. Explore range-based vs hash-based approaches. - [Partitioning Strategies for Distributed Databases](https://arpitbhayani.me/blogs/data-partitioning): Learn database partitioning! Scale reads/writes & improve availability by splitting your database. Explore horizontal/vertical strategies. - [Leaderless Replication](https://arpitbhayani.me/blogs/leaderless-replication): Explore leaderless replication - a fault-tolerant, strongly consistent data replication strategy. Learn how it works and its benefits. - [Multi-Master Conflicts - How to Handle Them](https://arpitbhayani.me/blogs/conflict-resolution): Explore conflict resolution strategies in multi-master databases. Learn to handle conflicts with unique IDs, database precedence, & custom logic. - [Multi-Master Replication - Why Conflicts Happen](https://arpitbhayani.me/blogs/conflict-detection): Understand conflicts in multi-master databases - Learn how to detect and resolve data inconsistencies for reliable systems. - [Multi-Master Replication - Scaling Writes Across Geographies](https://arpitbhayani.me/blogs/multi-master-replication): Explore Multi-Master replication - its benefits like load sharing and high availability, use cases, and key challenges to consider. - [Monotonic Reads - How Asynchronous Replication Creates Wormholes](https://arpitbhayani.me/blogs/monotonic-reads): Explore how asynchronous database replication creates "wormholes" in data consistency and how to fix it with monotonic reads. - [Read-Your-Writes Consistency](https://arpitbhayani.me/blogs/read-your-write-consistency): Explore read-your-writes consistency in distributed systems. Learn how to solve replication lag with strategies like synchronous replication. - [What Happens When a Master or Replica Fails](https://arpitbhayani.me/blogs/handling-outages-master-replica): Explore Master-Replica architecture - handling node outages, replica recovery, and master failover strategies for robust systems. - [Replication Formats - Statement vs Row-based](https://arpitbhayani.me/blogs/replication-formats): Explore Master-Replica replication - Understand statement-based vs. row-based formats, advantages, and disadvantages for distributed systems. - [Replication Strategies - Synchronous, Asynchronous, and Semi-Synchronous](https://arpitbhayani.me/blogs/replication-strategies): Explore synchronous, asynchronous, and semi-synchronous data replication strategies in distributed systems. Understand their trade-offs and implications. - [Master-Replica Replication](https://arpitbhayani.me/blogs/master-replica-replication): Explore the Master-Replica architecture - how it scales reads, handles writes, and recovers from failures. Examples included! - [Decoding Durability - The D in ACID](https://arpitbhayani.me/blogs/durability): Explore database durability, the "D" in ACID. Learn how databases ensure data survives failures & the role of transaction logs. - [Decoding Isolation - The I in ACID](https://arpitbhayani.me/blogs/isolation): Dive into database isolation! Understand its importance in maintaining data integrity during concurrent transactions with real-world examples. - [Decoding Atomicity - The A in ACID](https://arpitbhayani.me/blogs/atomicity): Understand Atomicity (the "A" in ACID) in databases, file systems, and hardware. Learn how it ensures data integrity and prevents partial updates. - [Decoding Consistency - The C in ACID](https://arpitbhayani.me/blogs/consistency): Understand database consistency (the "C" in ACID) and its importance. Learn how databases maintain data correctness through rules and constraints. - [Architectural Patterns for Distributed Systems](https://arpitbhayani.me/blogs/architectures-in-distributed-systems): Explore common architectures in distributed systems, including client-server, 3-tier, n-tier, and peer-to-peer. Understand their characteristics and when to use each one for optimal system design. - [Fallacies of Distributed Computing Every Engineer Should Know](https://arpitbhayani.me/blogs/mistaken-beliefs-of-distributed-systems): Learn about the 8 common fallacies of distributed computing that can lead to critical system design flaws. Understand the realities of network reliability, latency, bandwidth, security, topology, administration, transport costs, and network homogeneity for building robust and scalable distributed systems. - [Modeling Udemy's Categories in a Relational Database](https://arpitbhayani.me/blogs/taxonomy-on-sql): Model Udemy's taxonomy on a relational database. Learn efficient SQL queries, indexing, and design for optimal performance. - [The 2Q Algorithm - Addressing LRU's Sub-Optimality](https://arpitbhayani.me/blogs/2q-cache): Explore the 2Q cache eviction algorithm, an improvement over LRU, used in databases like Postgres. Learn how it optimizes performance! - [Implementing LFU in O(1)](https://arpitbhayani.me/blogs/lfu): Explore constant time LFU cache implementation using hash tables and doubly-linked lists. Learn how to achieve O(1) complexity! - [Bitcask - A Log-Structured fast KV store](https://arpitbhayani.me/blogs/bitcask): Bitcask was introduced as the backend for a distributed database named Riak in which each node used to run one instance of Bitcask to hold the data that it was responsible for. In this essay, we take a detailed look into Bitcask, its design, and find the secret sauce that makes it so performant. - [The RUM Conjecture - Storage System Trade-offs](https://arpitbhayani.me/blogs/rum): Explore the RUM Conjecture - How Read, Update, and Memory overheads impact storage system design and performance trade-offs. - [Consistent Hashing - What It Is and How to Implement It](https://arpitbhayani.me/blogs/consistent-hashing): Consistent hashing is a hashing technique that performs really well when operated in a dynamic environment where the distributed system scales up and scales down frequently. - [Copy-On-Write - When to Use It, When to Avoid It](https://arpitbhayani.me/blogs/copy-on-write): Explore Copy-on-Write (CoW) - Boost performance, manage resources, and enable versioning. Learn how it works with examples and trade-offs. - [How MySQL Avoids Performance Hits from Table Scans](https://arpitbhayani.me/blogs/midpoint-insertion-caching-strategy): Explore MySQL InnoDB's buffer pool and its midpoint insertion strategy for efficient cache management and scan resistance. - [Sliding Window Rate Limiting - Design and Implementation](https://arpitbhayani.me/blogs/sliding-window-ratelimiter): A rate limiter restricts the intended or unintended excessive usage of a system by regulating the number of requests made to/from it by discarding the surplus ones. - [Analyzing MongoDB Pagination Performance Differences](https://arpitbhayani.me/blogs/benchmark-and-compare-pagination-approach-in-mongodb): Benchmark of MongoDB pagination strategies! See which method (_id vs skip/limit) performs best for large datasets. Find the code on GitHub. - [MongoDB Pagination - Skip is Slow](https://arpitbhayani.me/blogs/mongodb-cursor-skip-is-slow): Is MongoDB `skip` slow? Understand when & why `skip` impacts pagination performance. Learn efficient alternatives for large datasets. - [MongoDB Pagination - Two Approaches You Need to Know](https://arpitbhayani.me/blogs/fast-and-efficient-pagination-in-mongodb): Learn how to efficiently paginate MongoDB data using `skip/limit` and `_id`-based methods. Improve performance for batch processing & UI display. ### Notes - [Cloudflare Implements Cache Transcoding to Optimize Cache Storage with Zstandard](https://arpitbhayani.me/notes/cloudflare-implements-cache-transcoding-to-optimize-cache-storage-with-zstandard): Cloudflare employs Cache Transcoding, compressing text assets like HTML and CSS with Zstandard before caching them. This method significantly reduces storage and costs by accepting a small, repeated decode cost for frequently read cached data. - [How S3 Enables Stateless Write-Ahead Logs Despite Latency Trade-offs](https://arpitbhayani.me/notes/how-s3-enables-stateless-write-ahead-logs-despite-latency-trade-offs): Everybody is building their write-ahead log on S3 now. Turbopuffer, Chroma, and WarpStream are all doing versions of the same trick. Here's what they are doing and how... - [AWS Route 53 Shuffle Sharding Uses Randomness To Reduce Failure Impact](https://arpitbhayani.me/notes/aws-route-53-shuffle-sharding-uses-randomness-to-reduce-failure-impact): AWS Route 53 uses a technique called shuffle sharding to keep one bad shard from affecting 1/N customers. Here's how it works... - [Systematically Evaluate Design Alternatives and Prune Suboptimal Trade-offs](https://arpitbhayani.me/notes/systematically-evaluate-design-alternatives-and-prune-suboptimal-trade-offs): Apply the framework of opposites to come up with alternatives. For example - push vs pull, strong vs eventual, sync vs async, dense vs sparse. - [Bottlenecks in infrastructure never disappear they just move](https://arpitbhayani.me/notes/bottlenecks-in-infrastructure-never-disappear-they-just-move): Fun fact: You never get rid of a bottleneck. It just moves from one part of your infrastructure to another. - [Starting From Scratch Unlocks Radical Innovation By Challenging Assumptions](https://arpitbhayani.me/notes/starting-from-scratch-unlocks-radical-innovation-by-challenging-assumptions): If you want to fundamentally challenge an assumption and innovate, try building things from scratch. - [Cloudflare's Meerkat Service Uses QuePaxa to Avoid Leader Problems](https://arpitbhayani.me/notes/cloudflare-s-meerkat-service-uses-quepaxa-to-avoid-leader-problems): Cloudflare has been building Meerkat, their new global consensus service, built on a protocol called QuePaxa instead of the usual Raft or Paxos. - [Improve MySQL Master Failover Monitoring Using Replica Consensus](https://arpitbhayani.me/notes/improve-mysql-master-failover-monitoring-using-replica-consensus): Imagine you want to monitor whether your MySQL master is down so that you can do a failover and promote a replica. - [Predictability Is The Most Valuable Quality For Robust System Design](https://arpitbhayani.me/notes/predictability-is-the-most-valuable-quality-for-robust-system-design): One of the most underrated qualities in system design is predictability, and it often matters more than raw performance. - [Spatial Join Operations Power Location-Based Services Like Uber and DoorDash](https://arpitbhayani.me/notes/spatial-join-operations-power-location-based-services-like-uber-and-doordash): One of the core operations behind Uber's driver matching is a spatial join. Let me explain... - [RocksDB's Sequence Numbers Simplify Database Snapshots and Concurrency](https://arpitbhayani.me/notes/rocksdb-s-sequence-numbers-simplify-database-snapshots-and-concurrency): Here's something interesting about RocksDB - it leverages 'sequence numbers' to make sure readers do not block writers. Let's dig deeper... - [PostgreSQL Uses Histograms and MCVs to Estimate Rows](https://arpitbhayani.me/notes/postgresql-uses-histograms-and-mcvs-to-estimate-rows): PostgreSQL (and other relational databases) needs to estimate how many rows a query will return because it directly impacts which execution plan it chooses. - [Separating Compute From Storage Enables Serverless Database Pay-Per-Use](https://arpitbhayani.me/notes/separating-compute-from-storage-enables-serverless-database-pay-per-use): Most databases treat compute and storage as one unit. Serverless databases break them apart, and that is exactly what makes pay-per-use pricing possible. Here is how your serverless databases really work... - [Platforms Offer Compounding Returns When Built and Adopted Effectively](https://arpitbhayani.me/notes/platforms-offer-compounding-returns-when-built-and-adopted-effectively): Platform is always an investment. - [How Four Key Traits Foster Decades of Sustained Growth](https://arpitbhayani.me/notes/how-four-key-traits-foster-decades-of-sustained-growth): Four traits that help you grow and compound over decades - [Handle Consecutive 401 Errors with Circuit Breakers to Prevent Outages](https://arpitbhayani.me/notes/handle-consecutive-401-errors-with-circuit-breakers-to-prevent-outages): GitHub went down for ~70 minutes yesterday. Interestingly, the root cause was not a database (the usual suspect), but an auth was returning 401s. - [Successful Big Migrations Require a Plank-by-Plank Replacement Strategy](https://arpitbhayani.me/notes/successful-big-migrations-require-a-plank-by-plank-replacement-strategy): Every migration you will ever do is a Ship of Theseus problem. The ancient Greeks had a paradox: if you replace every plank of a ship one by one, is it still the same ship? - [New Hires Should Build Trust and Gather Context Before Suggesting Changes](https://arpitbhayani.me/notes/new-hires-should-build-trust-and-gather-context-before-suggesting-changes): When you join a new organization, it is quite natural to feel a strong urge to fix things. Let me ruffle some feathers here... - [Structured Pessimism Improves System Reliability Through Proactive Questioning](https://arpitbhayani.me/notes/structured-pessimism-improves-system-reliability-through-proactive-questioning): One of the best mental models around for building reliable systems is to be a pessimist. Not in the "nothing will ever work" sense, but in the structured sense of asking hard questions before something goes wrong. - [Key Considerations for Building Predictably Horizontally Scalable Systems](https://arpitbhayani.me/notes/key-considerations-for-building-predictably-horizontally-scalable-systems): We all build horizontally scalable systems, but scaling is not as simple as saying "just add more machines" or "I will configure an autoscaling group". - [Approximating Least Recently Used Cache Eviction Using Two Random Choices](https://arpitbhayani.me/notes/approximating-least-recently-used-cache-eviction-using-two-random-choices): Here's something interesting about cache eviction - instead of tracking the exact LRU (Least Recently Used) item, we can just pick two random items and evict the older one. - [Distributed System Failures Often Stem From Unintended Omissions In Design](https://arpitbhayani.me/notes/distributed-system-failures-often-stem-from-unintended-omissions-in-design): Distributed systems are not just defined by what we put into them. They are equally defined by what we leave out. Let me give you 4 examples... - [Design Systems For Reversibility To Boost Confidence And Speed](https://arpitbhayani.me/notes/design-systems-for-reversibility-to-boost-confidence-and-speed): Always build reversible systems. When you make an architectural decision that is hard to undo, you are essentially betting that you got it right. - [Pushdown optimization in pg_clickhouse improves data querying efficiency](https://arpitbhayani.me/notes/pushdown-optimization-in-pg-clickhouse-improves-data-querying-efficiency): Recently, ClickHouse published an update to pgclickhouse, and the optimizations they did had one common theme - pushdown. Here's what it is... - [Relational databases often suffice where graph databases are overengineering](https://arpitbhayani.me/notes/relational-databases-often-suffice-where-graph-databases-are-overengineering): Most graph databases could have just been simple SQL queries, often giving better efficiency and performance. - [Build Intuition for Distributed Systems by Asking Why and How](https://arpitbhayani.me/notes/build-intuition-for-distributed-systems-by-asking-why-and-how): If you are trying to understand distributed systems, focus less on what and more on why, when, and how. Answering what a system does is usually the easy part. The harder one is why it behaves the way it does. - [Update Heavy PostgreSQL Workloads Require Autovacuum Tuning](https://arpitbhayani.me/notes/update-heavy-postgresql-workloads-require-autovacuum-tuning): You would hate PostgreSQL if you have an update-heavy use case because every update writes a brand new tuple, and the old one does not go away. - [Correctness and Consistency are Different Things](https://arpitbhayani.me/notes/correctness-and-consistency-are-different-things): aren't correctness and consistency the same thing? They are not, and here's my clarification. - [Partially Synchronous Systems Achieve Balance in Distributed Systems](https://arpitbhayani.me/notes/partially-synchronous-systems-achieve-balance-in-distributed-systems): We all have heard of synchronous and asynchronous systems, but let us talk about an interesting hybrid that gets far less attention - partially synchronous systems. - [Happened-before relationship brings order to distributed systems](https://arpitbhayani.me/notes/happened-before-relationship-brings-order-to-distributed-systems): Distributed systems do not have a 'shared clock', so it becomes very difficult for two nodes to agree on what "now" means. To be honest, this is what makes distributed systems so interesting. - [Debugging Distributed Systems Requires Global and Local Views](https://arpitbhayani.me/notes/debugging-distributed-systems-requires-global-and-local-views): Distributed systems (or even entangled microservices) are difficult to debug, and to be honest, you almost always learn something new doing it. Some classic examples: - [Simpler Solutions Beat Complexity in System Architecture](https://arpitbhayani.me/notes/simpler-solutions-beat-complexity-in-system-architecture): If the simpler solution can handle your current and expected load, go ahead and ship it. Complexity should be a last resort, not a design preference. - [Consistency, Availability, Freshness Trade-offs in Real-time Systems](https://arpitbhayani.me/notes/consistency-availability-freshness-trade-offs-in-real-time-systems): We all know the CAP theorem, but there is another trio that competes in streaming and real-time data systems, and it does not get nearly as much attention. The triad is - [TF-IDF is one of the most widely used ways to](https://arpitbhayani.me/notes/tf-idf-is-one-of-the-most-widely-used-ways-to): TF-IDF is one of the most widely used ways to quantify document relevance in search engines. While many memorize the formula, the intuition behind why it wor... - [When a network split creates a split-brain scenario, most systems](https://arpitbhayani.me/notes/when-a-network-split-creates-a-split-brain-scenario-most-systems): When a network split creates a split-brain scenario, most systems try to resolve it automatically through consensus protocols. Vitess takes a different path.... - [Counting things seems simple, but at scale, how you count](https://arpitbhayani.me/notes/counting-things-seems-simple-but-at-scale-how-you-count): Counting things seems simple, but at scale, how you count becomes an architecture decision. Here's a quick write-up on the need for columnar systems... Not c... - [There are two ways to build real-time collaboration - either](https://arpitbhayani.me/notes/there-are-two-ways-to-build-real-time-collaboration---either): There are two ways to build real-time collaboration - either everything goes through a central server, or you go for a P2P mesh. Assume a collaborative canva... - [Canva had to migrate millions of media asset metadata records](https://arpitbhayani.me/notes/canva-had-to-migrate-millions-of-media-asset-metadata-records): Canva had to migrate millions of media asset metadata records from MySQL to DynamoDB without dual writes or reading the binlog. What they did was super lazy ... - [One way to avoid getting overwhelmed when you are designing](https://arpitbhayani.me/notes/one-way-to-avoid-getting-overwhelmed-when-you-are-designing): One way to avoid getting overwhelmed when you are designing a system is to approach it with a structure/mental model. Here's a simple one I follow... Think o... - [When your regular work feels mundane, you can and should](https://arpitbhayani.me/notes/when-your-regular-work-feels-mundane-you-can-and-should): When your regular work feels mundane, you can and should solve a different kind of problem. Sometimes, I switch to simulating something from the real world..... - [The "SQL doesn’t scale" argument is a lazy and absurd generalization](https://arpitbhayani.me/notes/the-sql-doesnt-scale-argument-is-a-lazy-and-absurd-generalization): The \"SQL doesn’t scale\" argument is a lazy and absurd generalization. The real question isn't whether SQL or NoSQL scales; it’s whether a database meets yo... - [We know database replication is either sync or async, but](https://arpitbhayani.me/notes/we-know-database-replication-is-either-sync-or-async-but): We know database replication is either sync or async, but there is a third mode that MySQL supports - semi-sync replication, and it is a clever middle ground... - [I wanted to read engineering blogs on my Kindle, so](https://arpitbhayani.me/notes/i-wanted-to-read-engineering-blogs-on-my-kindle-so): I wanted to read engineering blogs on my Kindle, so I vibe-coded it :) It's called PageStack - give it a list of URLs, and it turns them into an EPUB that yo... - [No matter how many blogs, books, or papers you read,](https://arpitbhayani.me/notes/no-matter-how-many-blogs-books-or-papers-you-read): No matter how many blogs, books, or papers you read, prototyping is still the fastest way to understand anything. Here's my workflow - - keep a GitHub repo c... - [Say you are building a news aggregator (like Google News](https://arpitbhayani.me/notes/say-you-are-building-a-news-aggregator-like-google-news): Say you are building a news aggregator (like Google News). One of the biggest problems you'll face is de-duplicating articles across millions of documents. N... - [Deleting a large number of rows (say, a million) in](https://arpitbhayani.me/notes/deleting-a-large-number-of-rows-say-a-million-in): Deleting a large number of rows (say, a million) in a single query feels efficient. It is not. It can crush your database. When we run a large DELETE in one ... - [Here's something counterintuitive about B+ trees - inserting keys in](https://arpitbhayani.me/notes/heres-something-counterintuitive-about-b-trees---inserting-keys-in): Here's something counterintuitive about B+ trees - inserting keys in sorted order is fast, but it comes with an interesting hidden cost... When you insert ke... - [Most systems detect node or master failures using simple polling,](https://arpitbhayani.me/notes/most-systems-detect-node-or-master-failures-using-simple-polling): Most systems detect node or master failures using simple polling, and while this approach sounds straightforward, it has an interesting reliability issue... ... - [Renaming of a file is an atomic operation, and this](https://arpitbhayani.me/notes/renaming-of-a-file-is-an-atomic-operation-and-this): Renaming of a file is an atomic operation, and this is one guarantee that makes so many database implementations simpler. Here's one practical example, let's... - [Rows in PostgreSQL are immutable and stored on the 'heap](https://arpitbhayani.me/notes/rows-in-postgresql-are-immutable-and-stored-on-the-heap): Rows in PostgreSQL are immutable and stored on the 'heap'. Every row has a hidden identifier called CTID that points to its physical location on disk. CTID i... - [Read replicas are great for scaling reads, but what if](https://arpitbhayani.me/notes/read-replicas-are-great-for-scaling-reads-but-what-if): Read replicas are great for scaling reads, but what if your read replicas need to be elastic... This is where you put read replicas behind a proxy like HAPro... - [GitHub stores millions of repositories the same way they exist](https://arpitbhayani.me/notes/github-stores-millions-of-repositories-the-same-way-they-exist): GitHub stores millions of repositories the same way they exist on our local machine - literally as git repositories. Nothing very special. Instead of one cop... - [I just wrote and published an essay on Multi-Paxos and](https://arpitbhayani.me/notes/i-just-wrote-and-published-an-essay-on-multi-paxos-and): I just wrote and published an essay on Multi-Paxos and how it helps distributed databases achieve consensus. This week, I dug deeper into Paxos (something I ... - [Paxos has to be one of the trickiest, but also](https://arpitbhayani.me/notes/paxos-has-to-be-one-of-the-trickiest-but-also): Paxos has to be one of the trickiest, but also the most important, algorithms in distributed systems. Whenever you need consensus in a distributed setup, you... - [Uber open-sourced their M3 metrics platform, and while skimming through](https://arpitbhayani.me/notes/uber-open-sourced-their-m3-metrics-platform-and-while-skimming-through): Uber open-sourced their M3 metrics platform, and while skimming through how it works, I found an approach called LTTB downsampling. Here's what it is all abo... - [Here's something interesting about LIKE in SQL - it is](https://arpitbhayani.me/notes/heres-something-interesting-about-like-in-sql---it-is): Here's something interesting about LIKE in SQL - it is prone to injection and exploitation. It is unlike SQL injection, but still pretty dangerous. Hear me o... - [If protobuf is already a compact binary format, should we](https://arpitbhayani.me/notes/if-protobuf-is-already-a-compact-binary-format-should-we): If protobuf is already a compact binary format, should we even bother compressing it further with Snappy? Here's what Uber's M3 actually does... Uber's M3 in... - [Time series databases are extremely good at compression, and most](https://arpitbhayani.me/notes/time-series-databases-are-extremely-good-at-compression-and-most): Time series databases are extremely good at compression, and most use an interesting trick called Delta of Delta compression. Here's how it works... In time ... - [Wrote an essay on how MySQL binlog replication actually works](https://arpitbhayani.me/notes/wrote-an-essay-on-how-mysql-binlog-replication-actually-works): Wrote an essay on how MySQL binlog replication actually works under the hood. This week, I went deep into binary log formats, event structures, threading mod... - [I was exploring MySQL internals and found something clever called](https://arpitbhayani.me/notes/i-was-exploring-mysql-internals-and-found-something-clever-called): I was exploring MySQL internals and found something clever called the change buffer - it is an interesting optimization to avoid random disk I/O on index upd... - [Looks like filesystems are the next big thing in AI](https://arpitbhayani.me/notes/looks-like-filesystems-are-the-next-big-thing-in-ai): Looks like filesystems are the next big thing in AI :) Everybody is playing with it. This is happening because models are trained heavily on coding tasks ins... - [Most of us assume that stored procedures are cached globally,](https://arpitbhayani.me/notes/most-of-us-assume-that-stored-procedures-are-cached-globally): Most of us assume that stored procedures are cached globally, but this is not the case with both MySQL and PostgreSQL 🤯 Here's how it works... Both MySQL and... - [Redis heavily uses Circular Buffers in its replication implementation to](https://arpitbhayani.me/notes/redis-heavily-uses-circular-buffers-in-its-replication-implementation-to): Redis heavily uses Circular Buffers in its replication implementation to maintain a backlog. Here's something neat about how Redis handles temporary disconne... - [everybody loves it when a database just works](https://arpitbhayani.me/notes/everybody-loves-it-when-a-database-just-works): everybody loves it when a database just works. even if some features are implemented inefficiently, it does not matter. people almost always prefer a databas... - [ORMs are an anti-pattern once you start operating at scale](https://arpitbhayani.me/notes/orms-are-an-anti-pattern-once-you-start-operating-at-scale): ORMs are an anti-pattern once you start operating at scale. At scale, most move away from them as the abstraction that bridges the database and programming l... - [PostgreSQL lets you clone a 6GB database in 212 milliseconds](https://arpitbhayani.me/notes/postgresql-lets-you-clone-a-6gb-database-in-212-milliseconds): PostgreSQL lets you clone a 6GB database in 212 milliseconds instead of 67 seconds. Here's how... Cloning databases comes in handy in a few situations: - tes... - [Here's something as simple as a distributed build system (using](https://arpitbhayani.me/notes/heres-something-as-simple-as-a-distributed-build-system-using): Here's something as simple as a distributed build system (using Make) can fail because of a ~5-minute clock skew. Here's how... Consider a distributed make s... - [Wrote an essay on why time is such a hard](https://arpitbhayani.me/notes/wrote-an-essay-on-why-time-is-such-a-hard): Wrote an essay on why time is such a hard problem in distributed systems. This week, I went down the rabbit hole of clock drift, NTP, PTP, logical clocks, ve... - [Go 1.26 is not out yet, but the release notes](https://arpitbhayani.me/notes/go-126-is-not-out-yet-but-the-release-notes): Go 1.26 is not out yet, but the release notes draft is already up. There are a bunch of changes, but two of them that I find super interesting are 1. `new` c... - [Wrote an essay on what Kafka does when we add](https://arpitbhayani.me/notes/wrote-an-essay-on-what-kafka-does-when-we-add): Wrote an essay on what Kafka does when we add new partitions to a topic and the design trade-offs it makes. Last weekend, I went down the rabbit hole to unde... - [Imagine you are streaming changes from Postgres to Elasticsearch in Go](https://arpitbhayani.me/notes/imagine-you-are-streaming-changes-from-postgres-to-elasticsearch-in-go): Imagine you are streaming changes from Postgres to Elasticsearch in Go. Everything works fine in dev. Then traffic ramps up, and suddenly your service can't ... - [Documentation is important, but most do it for the sake](https://arpitbhayani.me/notes/documentation-is-important-but-most-do-it-for-the-sake): Documentation is important, but most do it for the sake of it and, in the process, often fail to document what's important. Either companies make you documen... - [Cloudflare had another outage, lasting 25 mins, on 5th Dec,](https://arpitbhayani.me/notes/cloudflare-had-another-outage-lasting-25-mins-on-5th-dec): Cloudflare had another outage, lasting 25 mins, on 5th Dec, and this happened while they were patching their servers for a React vulnerability. Here's what e... - [Py 3.11 is more performant than Py 3.12+ on AWS Lambda](https://arpitbhayani.me/notes/py-311-is-more-performant-than-py-312-on-aws-lambda): Py 3.11 is more performant than Py 3.12+ on AWS Lambda! And if you go by the benchmarks, then you should never run Node.js :) But of course, that considers o... - [Google just tested the largest Kubernetes cluster with 130,000 nodes](https://arpitbhayani.me/notes/google-just-tested-the-largest-kubernetes-cluster-with-130000-nodes): Google just tested the largest Kubernetes cluster with 130,000 nodes 🤯, and all this because AI is pushing the boundaries! The GKE setup was able to scale to... - [Rule number 1 of multitenancy: never assume all tenants are good actors](https://arpitbhayani.me/notes/rule-number-1-of-multitenancy-never-assume-all-tenants-are-good-actors): Rule number 1 of multitenancy: never assume all tenants are good actors. Your design must always assume that some tenants will try to abuse the platform. Eve... - [Range-based partitioning is like an amoeba](https://arpitbhayani.me/notes/range-based-partitioning-is-like-an-amoeba): Range-based partitioning is like an amoeba. You split when a partition gets hot, you merge when things cool down, and you move the partition across nodes (an... - [Wrote an essay on Blocking Queues, covering the intuition, implementation,](https://arpitbhayani.me/notes/wrote-an-essay-on-blocking-queues-covering-the-intuition-implementation): Wrote an essay on Blocking Queues, covering the intuition, implementation, patterns like worker pools, pipelines, and delay queues, plus real-world use cases... - [Google quantum computers are now solving optimization problems that even](https://arpitbhayani.me/notes/google-quantum-computers-are-now-solving-optimization-problems-that-even): Google quantum computers are now solving optimization problems that even our most powerful supercomputers can't crack. Their new algorithm, called Decoded Qu... - [Wrote an essay on Heartbeats in Distributed Systems, capturing both](https://arpitbhayani.me/notes/wrote-an-essay-on-heartbeats-in-distributed-systems-capturing-both): Wrote an essay on Heartbeats in Distributed Systems, capturing both the theoretical and practical aspects, including how Cassandra implements them. Give it a... - [If you are building or using a distributed database where](https://arpitbhayani.me/notes/if-you-are-building-or-using-a-distributed-database-where): If you are building or using a distributed database where multiple nodes can accept writes on the same entities, you should know a bit about CRDTs... In trad... - [SQLite 3.51 is out, and here are two things that](https://arpitbhayani.me/notes/sqlite-351-is-out-and-here-are-two-things-that): SQLite 3.51 is out, and here are two things that you would find interesting... 3.51 introduces two new JSON functions - jsonb_each() and jsonb_tree(). These ... - [Cloudflare shared some data on Internet connections at scale, and](https://arpitbhayani.me/notes/cloudflare-shared-some-data-on-internet-connections-at-scale-and): Cloudflare shared some data on Internet connections at scale, and the numbers are really interesting... Half of all TCP connections consist of just 12 packet... - [I am on a spree to explore PostgreSQL internals, and](https://arpitbhayani.me/notes/i-am-on-a-spree-to-explore-postgresql-internals-and-2): I am on a spree to explore PostgreSQL internals, and today, let me talk about how PG handles JSONB data with GIN (Generalized Inverted Index) indexes. When I... - [LinkedIn leverages Apache Beam to power their Notification Platform](https://arpitbhayani.me/notes/linkedin-leverages-apache-beam-to-power-their-notification-platform): LinkedIn leverages Apache Beam to power their Notification Platform. They built a fully managed stream processing platform on top of Apache Beam to process 4... - [Active-active setups are fascinating](https://arpitbhayani.me/notes/active-active-setups-are-fascinating): Active-active setups are fascinating. They are used when we can't afford downtime under heavy write loads spanning multiple sites. The idea is simple: multip... - [wrote an essay on how writes work in apache cassandra](https://arpitbhayani.me/notes/wrote-an-essay-on-how-writes-work-in-apache-cassandra): wrote an essay on how writes work in apache cassandra. - [Here's an interesting fact about Redis - while replications on](https://arpitbhayani.me/notes/heres-an-interesting-fact-about-redis---while-replications-on): Here's an interesting fact about Redis - while replications on most databases are pull-based, Redis has chosen a push-based approach. Here's why and how behi... - [how does a cdn handle content replication](https://arpitbhayani.me/notes/how-does-a-cdn-handle-content-replication): how does a cdn handle content replication? just published a detailed write-up on cdn and content replication. it's a no-fluff piece covering all the key deta... - [Fun Fact - When you commit a transaction in PostgreSQL,](https://arpitbhayani.me/notes/fun-fact---when-you-commit-a-transaction-in-postgresql): Fun Fact - When you commit a transaction in PostgreSQL, the database doesn't immediately write your actual data pages to disk. Instead, it follows this seque... - [grpc wouldn't be possible without http/2, but why](https://arpitbhayani.me/notes/grpc-wouldnt-be-possible-without-http2-but-why): grpc wouldn't be possible without http/2, but why? http/2 brings binary framing, multiplexing, and header compression. this makes grpc faster, leaner, and gr... - [The strength of a good system is not its complexity,](https://arpitbhayani.me/notes/the-strength-of-a-good-system-is-not-its-complexity): The strength of a good system is not its complexity, but its simplicity. - [Today I learned that we can do joins in Elasticsearch](https://arpitbhayani.me/notes/today-i-learned-that-we-can-do-joins-in-elasticsearch): Today I learned that we can do joins in Elasticsearch called lookup joins 🤯 In Elasticsearch, ES|QL has LOOKUP JOIN, which allows us to join different indice... - [There is never only one way to design something, and](https://arpitbhayani.me/notes/there-is-never-only-one-way-to-design-something-and): There is never only one way to design something, and the same applies to your database's primary index. Let me explain... Databases typically use two main st... - [I was going through the internals of MySQL, and I](https://arpitbhayani.me/notes/i-was-going-through-the-internals-of-mysql-and-i): I was going through the internals of MySQL, and I found something interesting called the doublewrite buffer, which is a smart hack to avoid data corruption; ... - [Yes, CDN improves latencies by caching things closer to the](https://arpitbhayani.me/notes/yes-cdn-improves-latencies-by-caching-things-closer-to-the): Yes, CDN improves latencies by caching things closer to the users, but here's an interesting optimization they do to optimize on latencies... TCP suffers fro... - [why the private network addresses 192.168](https://arpitbhayani.me/notes/why-the-private-network-addresses-192168): why the private network addresses 192.168.*.*? because a company used it in some early documentation, people literally copied the same while setting up their... - [When I joined Google, I worked on building a Remote](https://arpitbhayani.me/notes/when-i-joined-google-i-worked-on-building-a-remote): When I joined Google, I worked on building a Remote Shuffle Service for Dataproc and this is still the most challenging project I led... Here's a quick gist ... - [For every complex problem, there is often a simpler solution](https://arpitbhayani.me/notes/for-every-complex-problem-there-is-often-a-simpler-solution): For every complex problem, there is often a simpler solution that works 90% of the time and takes only 10% of the effort. Prioritize that. I'll give you an e... - [db nugget (4): Picking the wrong database bites you hard in production](https://arpitbhayani.me/notes/db-nugget-4-picking-the-wrong-database-bites-you-hard-in-production): db nugget (4): Picking the wrong database bites you hard in production. Here are some deeper questions I ask before deciding on a database, beyond just the b... - [db nugget (3): in-mem databases do not always lose data upon restart](https://arpitbhayani.me/notes/db-nugget-3-in-mem-databases-do-not-always-lose-data-upon-restart): db nugget (3): in-mem databases do not always lose data upon restart. almost all major in-mem databases have a tunable parameter that allows the database to ... - [db nugget (2): if you want your database to be](https://arpitbhayani.me/notes/db-nugget-2-if-you-want-your-database-to-be): db nugget (2): if you want your database to be fast, make sure you have enough memory to hold all the indexes. disk access is 100,000x slower than memory, an... - [research is addictive; just thinking about one problem in one](https://arpitbhayani.me/notes/research-is-addictive-just-thinking-about-one-problem-in-one): research is addictive; just thinking about one problem in one domain for a long time gives you a real kick. over the past few months, as I have been explorin... - [Randomness improves algorithms](https://arpitbhayani.me/notes/randomness-improves-algorithms): Randomness improves algorithms... hear me out... One of the domains that I am interested in is Approximate Algorithms (you can find a bunch of essays by me o... - [Your MySQL index isn’t slow; it's fragmented :) Databases like](https://arpitbhayani.me/notes/your-mysql-index-isnt-slow-its-fragmented-databases-like): Your MySQL index isn’t slow; it's fragmented :) Databases like MySQL that hold data in B+ trees suffer from index fragmentation, and this severely impacts th... - [Should two microservices share a database](https://arpitbhayani.me/notes/should-two-microservices-share-a-database): Should two microservices share a database? There is no hard rule that says two services cannot share a database. Again, there are risks involved in doing so,... - [When you need high availability, all you really need to](https://arpitbhayani.me/notes/when-you-need-high-availability-all-you-really-need-to): When you need high availability, all you really need to think about is redundancy. Let me explain... If you want to make your database highly available for r... - [Timing Attacks are really interesting, and they can be leveraged](https://arpitbhayani.me/notes/timing-attacks-are-really-interesting-and-they-can-be-leveraged): Timing Attacks are really interesting, and they can be leveraged to break your password ... just hear me out. Of course, passwords are not stored as plain te... - [How far can you go vibecoding](https://arpitbhayani.me/notes/how-far-can-you-go-vibecoding): How far can you go vibecoding? I just built LevelCache, an ephemeral cache built on top of LevelDB with TTL support - all vibecoded :) It's a C library, so i... - [Sometime back, I was going through PostgreSQL internals and found](https://arpitbhayani.me/notes/sometime-back-i-was-going-through-postgresql-internals-and-found): Sometime back, I was going through PostgreSQL internals and found something interesting about the `create database` command ... When we create a new database... - [High fork times can lead to master unavailability in Redis/Valkey,](https://arpitbhayani.me/notes/high-fork-times-can-lead-to-master-unavailability-in-redisvalkey): High fork times can lead to master unavailability in Redis/Valkey, which is due to the large page table that needs to be copied during a fork. Even though th... - [Sure, horizontal scaling is great for handling large loads and](https://arpitbhayani.me/notes/sure-horizontal-scaling-is-great-for-handling-large-loads-and): Sure, horizontal scaling is great for handling large loads and provides fault tolerance, but it comes with its own set of challenges. Let's talk about them t... - [Fun fact - Yes, most databases use B+ trees to](https://arpitbhayani.me/notes/fun-fact---yes-most-databases-use-b-trees-to): Fun fact - Yes, most databases use B+ trees to hold data, but these trees are not actually very deep; most of them are hardly 3 to 4 levels deep. A page size... - [Amazon just made Aurora DSQL generally available](https://arpitbhayani.me/notes/amazon-just-made-aurora-dsql-generally-available): Amazon just made Aurora DSQL generally available! In case you don't know, Aurora DSQL is a distributed sql database operating in multi-region offering strong... - [Most people get this wrong about the master-replica setup](https://arpitbhayani.me/notes/most-people-get-this-wrong-about-the-master-replica-setup): Most people get this wrong about the master-replica setup. It is a common misconception, spread through popular books, people, and courses, that in a master-... - [Is CDN a reverse proxy, just like a load balancer](https://arpitbhayani.me/notes/is-cdn-a-reverse-proxy-just-like-a-load-balancer): Is CDN a reverse proxy, just like a load balancer or an API gateway? Yes. While LB and API gateway fit the classic definition of a Reverse Proxy, CDN is also... - [Optimization is a zero-sum game](https://arpitbhayani.me/notes/optimization-is-a-zero-sum-game-2): Optimization is a zero-sum game. When designing systems or writing code, you're always making trade-offs. You're balancing space vs. time complexity in algor... - [was reading a paper and came across this really good insight](https://arpitbhayani.me/notes/was-reading-a-paper-and-came-across-this-really-good-insight): was reading a paper and came across this really good insight. it talks about how page-level caching would not work well in LSM-based databases. makes complet... - [While reading a paper, I came across the term multi-socket](https://arpitbhayani.me/notes/while-reading-a-paper-i-came-across-the-term-multi-socket): While reading a paper, I came across the term multi-socket architecture - an extreme case of vertical scaling. Here's a quick note about it. This architectur... - [If you are into distributed systems, please spend some time](https://arpitbhayani.me/notes/if-you-are-into-distributed-systems-please-spend-some-time): If you are into distributed systems, please spend some time reading about Vector Clocks and Hybrid Logical Clocks. They are extremely important to track caus... - [Common misconception - CDNs can *only* cache images and videos](https://arpitbhayani.me/notes/common-misconception---cdns-can-only-cache-images-and-videos): Common misconception - CDNs can *only* cache images and videos. To be honest, CDNs do not care what they get from the origin servers. For them, it is just a ... - [One of the best courses I took during my college](https://arpitbhayani.me/notes/one-of-the-best-courses-i-took-during-my-college): One of the best courses I took during my college years was called \"Storage and Virtualization\" and one of the assignments was to write our own file system.... - [Some time back, in my live cohort, we were discussing](https://arpitbhayani.me/notes/some-time-back-in-my-live-cohort-we-were-discussing): Some time back, in my live cohort, we were discussing BLOB vs TEXT, and while I was skimming MySQL documentation to brush up on some concepts, I stumbled upo... - [I learned a neat trick in Go](https://arpitbhayani.me/notes/i-learned-a-neat-trick-in-go): I learned a neat trick in Go. I have a VERSION file at the project root holding the current version number of DiceDB. I want to use this version everywhere I... - [The "SQL doesn’t scale" argument is a lazy and an absurd generalization](https://arpitbhayani.me/notes/the-sql-doesnt-scale-argument-is-a-lazy-and-an-absurd-generalization): The \"SQL doesn’t scale\" argument is a lazy and an absurd generalization. The real question isn't whether SQL or NoSQL scales; it’s whether a database meets... - [Netflix reduced connection churn in its API gateway by 10x](https://arpitbhayani.me/notes/netflix-reduced-connection-churn-in-its-api-gateway-by-10x): Netflix reduced connection churn in its API gateway by 10x. Connection churn is a massive problem with proxies like API gateways, and it effectively means th... - [It's surprising how many engineers I talk to today have](https://arpitbhayani.me/notes/its-surprising-how-many-engineers-i-talk-to-today-have): It's surprising how many engineers I talk to today have never linked, nor ever tried to link, an external library in a c/c++ codebase. Most languages today c... - [Time-series databases use a really simple algorithm to compress the](https://arpitbhayani.me/notes/time-series-databases-use-a-really-simple-algorithm-to-compress-the): Time-series databases use a really simple algorithm to compress the data and reduce storage footprint by ~10x. Delta Compression (encoding) is one of the sim... - [Go 1.24 is expected to be released this month, but](https://arpitbhayani.me/notes/go-124-is-expected-to-be-released-this-month-but): Go 1.24 is expected to be released this month, but their release note draft is out and after a long time it is a pretty insane one 🔥 three things I absolutel... - [Should you learn sharding and partitioning if we already have](https://arpitbhayani.me/notes/should-you-learn-sharding-and-partitioning-if-we-already-have): Should you learn sharding and partitioning if we already have a bunch of managed databases? According to me, an absolute yes! but more than that, you should ... - [YAGNI is my favorite principle when I build and implement any system](https://arpitbhayani.me/notes/yagni-is-my-favorite-principle-when-i-build-and-implement-any-system): YAGNI is my favorite principle when I build and implement any system. YAGNI is an abbreviation of You Aren’t Going to Need It, and it is all about avoiding o... - [Sometime back, I got curious about image formats and started](https://arpitbhayani.me/notes/sometime-back-i-got-curious-about-image-formats-and-started): Sometime back, I got curious about image formats and started exploring the difference between JPEG and PNG, here's something that you will find fascinating. ... - [If you plan to learn in public in 2025, spend more time learning than sharing.](https://arpitbhayani.me/notes/if-you-plan-to-learn-in-public-in-2025-spend): If you plan to learn in public in 2025, spend more time learning than sharing. Don't get me wrong, it is good, in fact great, that you are sharing things as ... - [Bayes' Theorem, the thing we learned in our statistics class](https://arpitbhayani.me/notes/bayes-theorem-the-thing-we-learned-in-our-statistics-class): Bayes' Theorem, the thing we learned in our statistics class and always wondered why are we studying, is super-crucial in ads engineering. To model and repre... - [Enjoy all the Spotify Wrapped you like, but spare some](https://arpitbhayani.me/notes/enjoy-all-the-spotify-wrapped-you-like-but-spare-some): Enjoy all the Spotify Wrapped you like, but spare some time to check out these to catch up on the coolest things that happened in 2024 in CS, Physics, and Ma... - [Implement what you read, and read how to make your implementation better](https://arpitbhayani.me/notes/implement-what-you-read-and-read-how-to-make-your-implementation-better): Implement what you read, and read how to make your implementation better. - [60% of the tables I have recently designed, do not](https://arpitbhayani.me/notes/60-of-the-tables-i-have-recently-designed-do-not): 60% of the tables I have recently designed, do not have the standard auto-increment ID column. Although counter-intuitive, doing this has helped me gain a si... - [Good engineers are usually excellent project managers and then become solid engineering leaders.](https://arpitbhayani.me/notes/good-engineers-are-usually-excellent-project-managers-and-then-become): Good engineers are usually excellent project managers and then become solid engineering leaders. Every role in engineering, regardless of seniority, demands ... - [Most NoSQL databases should have been a jsonb column in PostgreSQL](https://arpitbhayani.me/notes/most-nosql-databases-should-have-been-a-jsonb-column-in-postgresql): Most NoSQL databases should have been a jsonb column in PostgreSQL. - [PostgreSQL is a fascinating database and if you want to](https://arpitbhayani.me/notes/postgresql-is-a-fascinating-database-and-if-you-want-to): PostgreSQL is a fascinating database and if you want to explore something super interesting in it, I would highly recommend reading about these five niche co... - [Six core computer science projects that I absolutely loved doing](https://arpitbhayani.me/notes/six-core-computer-science-projects-that-i-absolutely-loved-doing): Six core computer science projects that I absolutely loved doing during my bachelor's and master's. 1. writing a file system using FUSE 2. building a word di... - [One of the good coding practices that I picked up](https://arpitbhayani.me/notes/one-of-the-good-coding-practices-that-i-picked-up): One of the good coding practices that I picked up while working at Google is about writing helpful error messages. Instead of simply stating the error, almos... - [I was crunching some numbers for JSON vs protobuf and](https://arpitbhayani.me/notes/i-was-crunching-some-numbers-for-json-vs-protobuf-and): I was crunching some numbers for JSON vs protobuf and the difference is staggering. - 2x improvement in data size - 2.5x improvement in serialization time - ... - [I am on a spree to explore PostgreSQL internals and](https://arpitbhayani.me/notes/i-am-on-a-spree-to-explore-postgresql-internals-and): I am on a spree to explore PostgreSQL internals and today I explored how it handles JSONB data with GIN (Generalized Inverted Index) indexes. When I was digg... - [For the last few weeks, I have been spending time](https://arpitbhayani.me/notes/for-the-last-few-weeks-i-have-been-spending-time): For the last few weeks, I have been spending time implementing WAL for DiceDB and hence spent a ton of time exploring how other databases have implemented it... - [Today, I was reading through PostgreSQL's documentation and I stumbled](https://arpitbhayani.me/notes/today-i-was-reading-through-postgresqls-documentation-and-i-stumbled): Today, I was reading through PostgreSQL's documentation and I stumbled upon something interesting called the `INCLUDE` clause. Let’s dig deeper. The queries ... - [PostgreSQL implements an interesting optimization to make some scans index-only](https://arpitbhayani.me/notes/postgresql-implements-an-interesting-optimization-to-make-some-scans-index-only): PostgreSQL implements an interesting optimization to make some scans index-only and execute the query faster. Let's explore the implementation. An index-only... - [The root cause of performance issues is almost always a](https://arpitbhayani.me/notes/the-root-cause-of-performance-issues-is-almost-always-a): The root cause of performance issues is almost always a poorly configured parameter. Although more tunables and fine-grained control seem like a good idea, i... - [Low-level design patterns are great, but beyond a point, they](https://arpitbhayani.me/notes/low-level-design-patterns-are-great-but-beyond-a-point-they): Low-level design patterns are great, but beyond a point, they make code unnecessarily complex, slow, hard to contribute, hard to read, hard to debug, and bor... - [While I was trying to figure out which paper to](https://arpitbhayani.me/notes/while-i-was-trying-to-figure-out-which-paper-to): While I was trying to figure out which paper to read this weekend, I got the answer to one question I have had for ages - how do cloud storage providers dete... - [I extensively used Elasticsearch for 2 years straight while I](https://arpitbhayani.me/notes/i-extensively-used-elasticsearch-for-2-years-straight-while-i): I extensively used Elasticsearch for 2 years straight while I was leading and building Search, here's one of the practices that helped us keep the service ef... - [You must the isolation level of your database, as picking](https://arpitbhayani.me/notes/you-must-the-isolation-level-of-your-database-as-picking): You must the isolation level of your database, as picking the wrong one can lead to data integrity issues. Here's a quick write-up about the four core isolat... - [Most early engineers (in some cases even seniors) get confused](https://arpitbhayani.me/notes/most-early-engineers-in-some-cases-even-seniors-get-confused): Most early engineers (in some cases even seniors) get confused with the word \"consistency\", but remember, Consistency in ACID is different from Consistency... - [I always wondered how we could programmatically ensure variables get](https://arpitbhayani.me/notes/i-always-wondered-how-we-could-programmatically-ensure-variables-get): I always wondered how we could programmatically ensure variables get aligned on different CPU cache lines to minimize cache thrashing. Did a quick prototype ... - [Database guarantees durability using WAL, and it is possible due](https://arpitbhayani.me/notes/database-guarantees-durability-using-wal-and-it-is-possible-due): Database guarantees durability using WAL, and it is possible due to LSN ⚡ Databases dump every single operation in WAL before it is applied to the actual dat... - [this is a really interesting question asked in my video](https://arpitbhayani.me/notes/this-is-a-really-interesting-question-asked-in-my-video): this is a really interesting question asked in my video on how Grab handles millions of orders where I dissected their architecture, design decisions, and tr... - [Build micro-services, not nano-services](https://arpitbhayani.me/notes/build-micro-services-not-nano-services): Build micro-services, not nano-services. - [PostgreSQL crumbles even when a moderate number of clients connect to it](https://arpitbhayani.me/notes/postgresql-crumbles-even-when-a-moderate-number-of-clients-connect-to-it): PostgreSQL crumbles even when a moderate number of clients connect to it. This happens because of how it handles each connection. Let's understand this in a ... - [Should two microservices services share a database](https://arpitbhayani.me/notes/should-two-microservices-services-share-a-database): Should two microservices services share a database? ⚡ There is no hard rule that says two services cannot share a database. Again, there are risks involved i... - [A solution that exists for all, is a solution that](https://arpitbhayani.me/notes/a-solution-that-exists-for-all-is-a-solution-that): A solution that exists for all, is a solution that exists for none. - [I saw many engineers blaming the outage on Microsoft 🤦‍♂️](https://arpitbhayani.me/notes/i-saw-many-engineers-blaming-the-outage-on-microsoft): I saw many engineers blaming the outage on Microsoft 🤦‍♂️ SWEs blaming without knowing the root cause is concerning. It is not Microsoft, it is Crowdstrike w... - [I spent some time this afternoon going through Buffer Cache](https://arpitbhayani.me/notes/i-spent-some-time-this-afternoon-going-through-buffer-cache): I spent some time this afternoon going through Buffer Cache in PostgreSQL, and here's the gist of what it is and some interesting details about it ⚡ In Postg... - [When you start your PostgreSQL database, a bunch of background](https://arpitbhayani.me/notes/when-you-start-your-postgresql-database-a-bunch-of-background): When you start your PostgreSQL database, a bunch of background processes are also forked; I spent some time today understanding them in-depth, here's everyth... - [Redis is written in C, but its test cases are](https://arpitbhayani.me/notes/redis-is-written-in-c-but-its-test-cases-are): Redis is written in C, but its test cases are written in TCL 🤯 While going through Redis internals, I looked at test cases to understand the flow, I was surp... - [I was always curious about where and how PostgreSQL stores](https://arpitbhayani.me/notes/i-was-always-curious-about-where-and-how-postgresql-stores): I was always curious about where and how PostgreSQL stores data in files, and today I spent some time exploring the internals ... ⚡ Physical files (present i... - [One of the most amusing features of PostgreSQL is Tablespaces,](https://arpitbhayani.me/notes/one-of-the-most-amusing-features-of-postgresql-is-tablespaces): One of the most amusing features of PostgreSQL is Tablespaces, let me explain what it does and how it works ⚡ Tablespaces are the storage locations for data ... - [Everyone: please keep your variable names self-explanatory](https://arpitbhayani.me/notes/everyone-please-keep-your-variable-names-self-explanatory): Everyone: please keep your variable names self-explanatory CockroachDB: hold my beer 🙃 While I was skimming the Pebble codebase, I stumbled on an oddly long ... - [Today, I was going through PostgreSQL internals and found something](https://arpitbhayani.me/notes/today-i-was-going-through-postgresql-internals-and-found-something): Today, I was going through PostgreSQL internals and found something interesting about the `create database` command ... ⚡ When we create a new database in Po... - [Zero-copy writes make Kafka fast, but how exactly](https://arpitbhayani.me/notes/zero-copy-writes-make-kafka-fast-but-how-exactly): Zero-copy writes make Kafka fast, but how exactly? ⚡ Kafka is a message broker, and it accepts messages from the network and writes to the disk, and vice ver... - [PostgreSQL is not just a relational db, but an object-relational db ⚡](https://arpitbhayani.me/notes/postgresql-is-not-just-a-relational-db-but-an-object-relational-db): PostgreSQL is not just a relational db, but an object-relational db ⚡ It has a super-cool feature that allows us to create user-defined types and define beha... - [Today I learned, there are over one trillion SQLite databases](https://arpitbhayani.me/notes/today-i-learned-there-are-over-one-trillion-sqlite-databases): Today I learned, there are over one trillion SQLite databases in active use 🤯 and it is likely used more than all other database engines combined. If you are... - [Hot shards are a pain, but why do they occur](https://arpitbhayani.me/notes/hot-shards-are-a-pain-but-why-do-they-occur): Hot shards are a pain, but why do they occur? ⚡ Hot shards occur when a specific node of a distributed database, becomes overloaded and has to work significa... - [Whenever you are shipping any service, make it highly observable ⚡](https://arpitbhayani.me/notes/whenever-you-are-shipping-any-service-make-it-highly-observable): Whenever you are shipping any service, make it highly observable ⚡ Observability is crucial whenever we are building and shipping; because what gets measured... - [Over-engineering has killed more tech startups than a bad business idea ⚡](https://arpitbhayani.me/notes/over-engineering-has-killed-more-tech-startups-than-a-bad): Over-engineering has killed more tech startups than a bad business idea ⚡ I have seen startups with more microservices than the number of paying customers. I... - [Writing quick prototypes from scratch is easy, do it, but ⚡](https://arpitbhayani.me/notes/writing-quick-prototypes-from-scratch-is-easy-do-it-but): Writing quick prototypes from scratch is easy, do it, but ⚡ the real deal is building an ability to understand any massive codebase and make changes to it wi... - [High-observability is a prerequisite for optimization](https://arpitbhayani.me/notes/high-observability-is-a-prerequisite-for-optimization): High-observability is a prerequisite for optimization. - [In the world where you have managed databases, should you](https://arpitbhayani.me/notes/in-the-world-where-you-have-managed-databases-should-you): In the world where you have managed databases, should you learn sharding and partitioning? ⚡ According to me, the answer is an absolute yes! you should know ... - [Caching is not the only way to handle the load ⚡](https://arpitbhayani.me/notes/caching-is-not-the-only-way-to-handle-the-load): Caching is not the only way to handle the load ⚡ Caching is quick, but definitely not the only way to optimize systems. To build a performant system, underst... - [System Design in the real world always revolves around cost 💰](https://arpitbhayani.me/notes/system-design-in-the-real-world-always-revolves-around-cost): System Design in the real world always revolves around cost 💰 You can get easy wins while building a low-latency system simply by adding a ton of memory and ... - [Projects are the best way to learn a programming language,](https://arpitbhayani.me/notes/projects-are-the-best-way-to-learn-a-programming-language): Projects are the best way to learn a programming language, and here are the three projects that I did learn Golang back in 2016 ⚡ 1. Build a command-line tod... - [Nginx is one of the most powerful tools out here,](https://arpitbhayani.me/notes/nginx-is-one-of-the-most-powerful-tools-out-here): Nginx is one of the most powerful tools out here, and I have used it in production for many years ⚡ Here are the 8 key features that I believe every engineer... - [Writing multi-threaded programs is easy, writing correct multi-threaded programs is](https://arpitbhayani.me/notes/writing-multi-threaded-programs-is-easy-writing-correct-multi-threaded-programs-is): Writing multi-threaded programs is easy, writing correct multi-threaded programs is difficult, and writing correct and performant multi-threaded programs is ... - [We keep making software complex enough to fit and use](https://arpitbhayani.me/notes/we-keep-making-software-complex-enough-to-fit-and-use): We keep making software complex enough to fit and use the underlying hardware ⚡ The Apollo Guidance Computer, which took us to the moon, ran on 4KB RAM and 3... - [Here's an interesting question asked on Partitioning and Sharding ⚡](https://arpitbhayani.me/notes/heres-an-interesting-question-asked-on-partitioning-and-sharding): Here's an interesting question asked on Partitioning and Sharding ⚡ The question is particularly interesting because we always think of sharding the database... - [Why designing highly available services important](https://arpitbhayani.me/notes/why-designing-highly-available-services-important): Why designing highly available services important? ⚡ Because services are only useful when they’re online. Unavailable services not only lead to a loss in re... - [Let's break one of the biggest misconceptions about Consistent Hashing ⚡](https://arpitbhayani.me/notes/lets-break-one-of-the-biggest-misconceptions-about-consistent-hashing): Let's break one of the biggest misconceptions about Consistent Hashing ⚡ Many engineers think that Consistent Hashing is a service that just solves your scal... - [During my live cohort, we were discussing BLOB vs TEXT,](https://arpitbhayani.me/notes/during-my-live-cohort-we-were-discussing-blob-vs-text): During my live cohort, we were discussing BLOB vs TEXT, and while I was skimming MySQL documentation to brush up on some concepts, I stumbled upon something ... - [Changing something in staging can take down production ⚡](https://arpitbhayani.me/notes/changing-something-in-staging-can-take-down-production): Changing something in staging can take down production ⚡ In an overly complicated microservices-laden infrastructure, it is not uncommon to take down product... - [LRU is a popular but memory-intensive algorithm, hence Redis tweaked it ⚡](https://arpitbhayani.me/notes/lru-is-a-popular-but-memory-intensive-algorithm-hence-redis-tweaked-it): LRU is a popular but memory-intensive algorithm, hence Redis tweaked it ⚡ The standard implementation of LRU requires a doubly-linked list; wherein each node... - [I used to believe that `TEXT` column type could store](https://arpitbhayani.me/notes/i-used-to-believe-that-text-column-type-could-store): I used to believe that `TEXT` column type could store strings of any length, but I was wrong ⚡ Today, while I was going through PostgreSQL source code, I stu... - [How to decide the optimal number of partitions for a Kafka topic](https://arpitbhayani.me/notes/how-to-decide-the-optimal-number-of-partitions-for-a-kafka-topic): How to decide the optimal number of partitions for a Kafka topic? ⚡ One of the most important things to know about Kafka is that its parallelism is limited b... - [System Design is not about drawing boxes, you need to](https://arpitbhayani.me/notes/system-design-is-not-about-drawing-boxes-you-need-to): System Design is not about drawing boxes, you need to know the implementation detail ⚡ Here are 3 of my videos that cover everything about Database Sharding,... - [ACID and CAP theorem, both have C standing for "Consistency",](https://arpitbhayani.me/notes/acid-and-cap-theorem-both-have-c-standing-for-consistency): ACID and CAP theorem, both have C standing for \"Consistency\", but they do not mean the same ⚡ In the context of ACID, consistency refers to the requirement... - [Hardware failure in large infra is not a question of](https://arpitbhayani.me/notes/hardware-failure-in-large-infra-is-not-a-question-of): Hardware failure in large infra is not a question of \"if\", but a question of \"when\" ⚡ While building a service that spans 100s of servers, never build wi... - [3 videos that cover everything about sharding, partitioning, and their](https://arpitbhayani.me/notes/3-videos-that-cover-everything-about-sharding-partitioning-and-their): 3 videos that cover everything about sharding, partitioning, and their implementation without downtime ⚡ 1. Sharding vs Partitioning - youtu.be/wXvljefXyEo 2... - [How do the updates happening on the master reach the replica](https://arpitbhayani.me/notes/how-do-the-updates-happening-on-the-master-reach-the-replica): How do the updates happening on the master reach the replica? ⚡ In a classic master-replica setup, any write operation happening on the master is logged in t... - [Amazon's Prime Video cut 90% of its cloud costs by](https://arpitbhayani.me/notes/amazons-prime-video-cut-90-of-its-cloud-costs-by): Amazon's Prime Video cut 90% of its cloud costs by migrating from serverless to a regular containerized architecture ⚡ This migration teaches us one of the m... - [CockroachDB is fascinating](https://arpitbhayani.me/notes/cockroachdb-is-fascinating): CockroachDB is fascinating! Here are 5 key things that you should know about it ⚡ 1. Symmetrical Nodes In distributed data stores we generally see a few node... - [Writes in CockroachDB are fascinating as it directly guarantees a](https://arpitbhayani.me/notes/writes-in-cockroachdb-are-fascinating-as-it-directly-guarantees-a): Writes in CockroachDB are fascinating as it directly guarantees a Serializable isolation level. Let's understand it in 6 easy steps ⚡ 1. Writes or Updates ar... - [CockroachDB Internals ] CockroachDB is distributed SQL database that replicates](https://arpitbhayani.me/notes/cockroachdb-internals-cockroachdb-is-distributed-sql-database-that-replicates): [CockroachDB Internals #5] CockroachDB is distributed SQL database that replicates the data to offer fault tolerance. Here are key details about it ⚡ Althoug... - [Consistent Hashing is not some magical solution that fits everywhere](https://arpitbhayani.me/notes/consistent-hashing-is-not-some-magical-solution-that-fits-everywhere): Consistent Hashing is not some magical solution that fits everywhere. Let me tell you one place where you should never use consistent hashing ⚡ Consistent Ha... - [CockroachDB Internals ] CockroachDB leverages multi-version concurrency control to process](https://arpitbhayani.me/notes/cockroachdb-internals-cockroachdb-leverages-multi-version-concurrency-control-to-process): [CockroachDB Internals #4] CockroachDB leverages multi-version concurrency control to process concurrent requests and guarantee consistency. Let's quickly un... - [CockroachDB Internals ] Data Structures and Algorithms are crucial in](https://arpitbhayani.me/notes/cockroachdb-internals-data-structures-and-algorithms-are-crucial-in): [CockroachDB Internals #3] Data Structures and Algorithms are crucial in the real world and here's an example ⚡ CockroachDB, a highly available Distributed S... - [CockroachDB Internals ] CockroachDB is PostgreSQL compliant, how and why](https://arpitbhayani.me/notes/cockroachdb-internals-cockroachdb-is-postgresql-compliant-how-and-why): [CockroachDB Internals #2] CockroachDB is PostgreSQL compliant, how and why? ⚡ For any client to talk to a database, they need to speak the common language a... - [CockroachDB Internals ] Let's talk about OLTP and OLAP databases](https://arpitbhayani.me/notes/cockroachdb-internals-lets-talk-about-oltp-and-olap-databases): [CockroachDB Internals #1] Let's talk about OLTP and OLAP databases and understand where they differ ... ⚡ OLTP databases are designed to handle Transactiona... - [I am fascinated by random numbers ⚡](https://arpitbhayani.me/notes/i-am-fascinated-by-random-numbers): I am fascinated by random numbers ⚡ What makes it interesting, is how we can configure them to follow a certain distribution - uniform, normal, triangular, e... - [How databases are upgraded in production](https://arpitbhayani.me/notes/how-databases-are-upgraded-in-production-2): How databases are upgraded in production? ⚡ an over-simplified version 🤟 Minor version upgrades of the database are simple but major version upgrades are a b... - [3 in-depth videos that cover everything about Sharding along with](https://arpitbhayani.me/notes/3-in-depth-videos-that-cover-everything-about-sharding-along-with): 3 in-depth videos that cover everything about Sharding along with its implementation details ⚡ 1. Sharding vs Partitioning - youtu.be/wXvljefXyEo 2. Implemen... - [Here's how you design a good distributed system 👇‍](https://arpitbhayani.me/notes/heres-how-you-design-a-good-distributed-system): Here's how you design a good distributed system 👇‍ - [CDN is much more than a cache for images and videos](https://arpitbhayani.me/notes/cdn-is-much-more-than-a-cache-for-images-and-videos): CDN is much more than a cache for images and videos. CDN is just a transparent cache that sits between the user and the origin. It can cache any response com... - [was implementing graceful shutdown for some TCP server, and it](https://arpitbhayani.me/notes/was-implementing-graceful-shutdown-for-some-tcp-server-and-it): was implementing graceful shutdown for some TCP server, and it took ~2 hours to debug a trivial signal handler and get it running as intended 🙈 sometimes we ... - [Just adding threads won't make your code run fast](https://arpitbhayani.me/notes/just-adding-threads-wont-make-your-code-run-fast): Just adding threads won't make your code run fast. You need to understand the kind of workload, the capability of the language, and the data access pattern o... - [Random numbers that we generate in our programming language are](https://arpitbhayani.me/notes/random-numbers-that-we-generate-in-our-programming-language-are): Random numbers that we generate in our programming language are not actually random, but pseudo-random. Given the same seed value, they will spit out the exa... - [How databases are upgraded in production](https://arpitbhayani.me/notes/how-databases-are-upgraded-in-production): How databases are upgraded in production? [over-simplified] Minor version upgrades of the database are simple but major version upgrades are a big pain, typi... - [Spent the last 4 hours understanding the GIF format, deep](https://arpitbhayani.me/notes/spent-the-last-4-hours-understanding-the-gif-format-deep): Spent the last 4 hours understanding the GIF format, deep dive into the internals is so much fun 🔥 I was always fascinated by how animated GIFs are stored an... - [Just spend hour and half understanding Shannon Entropy](https://arpitbhayani.me/notes/just-spend-hour-and-half-understanding-shannon-entropy): Just spend hour and half understanding Shannon Entropy... Whoa what a ride! So so many interesting use cases of it. Planning to put out a video that - explai... - [There is no better resource to learn anything in-depth than](https://arpitbhayani.me/notes/there-is-no-better-resource-to-learn-anything-in-depth-than): There is no better resource to learn anything in-depth than the official documentation. YouTube tutorials and blogs are good enough to get started, but when ... - [Essay : Indexing on a Partitioned Data](https://arpitbhayani.me/notes/essay-indexing-on-a-partitioned-data): Essay #72: Indexing on a Partitioned Data Partitioning plays a vital role in scaling a database beyond a certain scale of reads and writes. This essay takes ... - [Essay : Data Partitioning Strategies](https://arpitbhayani.me/notes/essay-data-partitioning-strategies): Essay #71: Data Partitioning Strategies Partitioning plays a vital role in scaling a database beyond a certain scale of reads and writes. This essay takes a ... - [Essay : An Introduction to Data Partitioning](https://arpitbhayani.me/notes/essay-an-introduction-to-data-partitioning): Essay #70: An Introduction to Data Partitioning Partitioning plays a vital role in scaling a database beyond a certain scale of reads and writes. In this ess... - [Essay : Leaderless Replication to have Strong Consistency in Distributed Database](https://arpitbhayani.me/notes/essay-leaderless-replication-to-have-strong-consistency-in-distributed-database): Essay #69: Leaderless Replication to have Strong Consistency in Distributed Database Traditional leader-centric replication strategies revolve around the fac... - [Essay : Preventing Wormholes in a Distributed Datastore](https://arpitbhayani.me/notes/essay-preventing-wormholes-in-a-distributed-datastore): Essay #65: Preventing Wormholes in a Distributed Datastore What happens when you have multiple Replica having different Replication Lags? A Wormhole! Let me ... - [How would you feel when you posted on a Social](https://arpitbhayani.me/notes/how-would-you-feel-when-you-posted-on-a-social): How would you feel when you posted on a Social Platform, and upon refreshing it, it gave you a 404? This is a classical case of your datastore missing Read-y... - [Recently I wrote a short snippet about setting up a](https://arpitbhayani.me/notes/recently-i-wrote-a-short-snippet-about-setting-up-a): Recently I wrote a short snippet about setting up a new replica and the challenges that come with it. As promised, I published the long form of the snippet a... - [Ever wondered how the Replication happens, how a new Replica](https://arpitbhayani.me/notes/ever-wondered-how-the-replication-happens-how-a-new-replica): Ever wondered how the Replication happens, how a new Replica is set up? how the Replication Lag comes down to 0? Here's everything you need to know ✨ General... - [Ever wonder how replication happens between Master and Replica](https://arpitbhayani.me/notes/ever-wonder-how-replication-happens-between-master-and-replica): Ever wonder how replication happens between Master and Replica? How changes on Master propagates to Replica? This is a short summary of how it happens, the d... ### Videos - [Demystifying Kafka's Exactly-Once Semantics: Idempotence, Transactions, and Fencing](https://arpitbhayani.me/videos/demystifying-kafkas-exactly-once-semantics-idempotence-transactions-fencing): Kafka's exactly-once semantics ensures messages are delivered and persisted exactly once, even in the face of retries and failures. This deep dive explores the three layers of its implementation: producer idempotence for single-producer retries, transactional IDs and epochs to handle zombie producers, and a distributed two-phase commit protocol for atomic writes across multiple partitions. It clarifies that this guarantee applies to delivery, not processing. - [Consistent Hashing: Demystifying the Algorithm and Its Simple Implementation](https://arpitbhayani.me/videos/consistent-hashing-implementation-from-first-principles): Consistent Hashing is a fundamental algorithm in distributed systems, often misunderstood as a complex service. This article demystifies its core purpose: solving data ownership in a cluster with minimal changes during topology shifts. It breaks down the classic hashing problem, explains the consistent hashing ring concept, and reveals its surprisingly simple implementation using a sorted array and binary search. - [How Stripe Achieves Zero-Downtime, Consistent Data Migrations at Scale](https://arpitbhayani.me/videos/how-stripe-achieves-zero-downtime-consistent-data-migrations-at-scale): Explore Stripe's sophisticated strategy for performing massive online data migrations with zero downtime and guaranteed data consistency. This article dissects their four-step dual writing process, detailing crucial techniques like asynchronous writes, distributed backfilling on snapshots, shadow mode for read verification, and robust rollback mechanisms, offering invaluable insights for large-scale system evolution. - [Stripe's Zero-Downtime, Consistent Data Migration Strategy at Scale](https://arpitbhayani.me/videos/stripe-zero-downtime-data-migration): This article dissects Stripe's sophisticated approach to online data migration, demonstrating how they migrate millions of records and evolve schemas with zero downtime and no data inconsistency. It details a four-step dual-writing strategy, including asynchronous writes, snapshot-based distributed backfilling, shadow mode for read verification, and robust rollback mechanisms. Learn the critical nuances and trade-offs involved in ensuring data integrity and system availability during large-scale database changes. - [Stripe's Canonical Log Lines: A Smarter Approach to Structured Logging](https://arpitbhayani.me/videos/stripe-canonical-log-lines-smarter-structured-logging): Stripe addresses the challenges of large-scale logging with Canonical Log Lines, a system that consolidates all critical request-level information into a single, comprehensive log entry. This approach simplifies debugging, accelerates data analysis by eliminating the need to stitch multiple log lines, and enables more efficient observability in distributed systems. - [Stripe's Canonical Log Lines: A Smarter Approach to Structured Logging](https://arpitbhayani.me/videos/stripes-canonical-log-lines-smarter-structured-logging): Traditional logging often leads to overwhelming text volume and slow, complex queries. Stripe addresses this by introducing canonical log lines, a single, comprehensive log entry emitted per request that consolidates all critical information. This approach simplifies querying, reduces processing overhead, and enables efficient aggregation and visualization of key metrics. - [Stripe's DocDB: Scaling MongoDB to 5 Million Queries Per Second](https://arpitbhayani.me/videos/stripe-docdb-scaling-mongodb-5-million-queries-per-second): Explore how Stripe built DocDB, an internal data layer on MongoDB Community Edition, to achieve 5 million queries per second with five nines of availability. This deep dive covers DocDB's architecture, including its database proxy, logical sharding, and a sophisticated data movement platform enabling zero-downtime migrations and hot shard handling through a unique config server flipping mechanism. - [How PayPal's Braintree Solved the Thundering Herd Problem and Simplified Architecture](https://arpitbhayani.me/videos/how-paypals-braintree-solved-thundering-herd-problem-and-simplified-architecture): PayPal's Braintree faced cascading failures due to the Thundering Herd Problem, where synchronized retries overwhelmed their dispute processing system. They tackled this by introducing "jitter" to desynchronize retries and significantly simplified their architecture by eliminating an unnecessary microservice, moving its logic directly into worker nodes. This case study highlights the power of simple solutions and avoiding premature abstraction in system design. - [How GitHub Sharded Their Databases Without Downtime and Broke Their Monolith](https://arpitbhayani.me/videos/github-database-sharding-without-downtime-monolith): This article dissects GitHub's two-tier strategy for partitioning their massive MySQL monolith without downtime. It covers their approach to enforcing logical boundaries using 'schema domains' and 'query linters', followed by a detailed, step-by-step zero-downtime physical migration process leveraging ProxySQL and GTID for seamless cutovers. Learn how GitHub scaled their core database to handle millions of queries per second while maintaining consistency and availability. - [Inside Stripe's Multi-Tier Rate Limiter Architecture](https://arpitbhayani.me/videos/stripe-multi-tier-rate-limiter-architecture): This article dissects Stripe's sophisticated four-tier rate limiting strategy, designed to ensure API availability, fair usage, and predictable latency under unpredictable workloads. It explores how Stripe prioritizes critical requests and prevents cascading failures by implementing request, concurrent, fleet usage, and worker utilization limiters, bridging the gap between engineering resilience and business continuity. - [Understanding L4 Load Balancers: Modes, Mechanisms, and Use Cases](https://arpitbhayani.me/videos/understanding-l4-load-balancers-modes-mechanisms-use-cases): L4 load balancers are fundamental components in distributed systems, operating at the transport layer to efficiently distribute traffic. This article explores their two primary modes: pass-through, which transparently forwards packets, and proxy, which terminates connections for advanced routing logic. Learn their mechanisms, trade-offs, and when to apply each for optimal system performance and reliability. - [How Atlassian Reduced Latency by 70% Using the Sidecar Pattern](https://arpitbhayani.me/videos/atlassian-latency-reduction-sidecar-pattern): Explore how Atlassian leveraged the sidecar pattern to dramatically reduce latency by 70% for their critical Tenant Contact Service (TCS). This deep dive explains the problem of inconsistent client performance, the architectural choice of a sidecar over a library, and the significant benefits achieved in system optimization and load reduction. - [How Bitbucket Achieved Read-After-Write Consistency and Reduced Master Database Load by 50%](https://arpitbhayani.me/videos/bitbucket-read-after-write-consistency-database-scaling): Bitbucket faced significant master database load and read-after-write consistency challenges in its master-replica PostgreSQL setup. This article dissects their innovative solution, which involves tracking Log Sequence Numbers (LSNs) for user writes and intelligently routing subsequent reads to replicas that have already replicated the user's latest changes, resulting in a 50% reduction in master queries. - [Optimizing Jira: How Atlassian Migrated from JSON to Protobuf for Massive Performance and Cost Benefits](https://arpitbhayani.me/videos/optimizing-jira-atlassian-json-to-protobuf-migration): Atlassian's Jira team achieved significant performance gains and cost reductions by migrating their issues microservice from JSON to Protobuf. This article details the phased migration strategy, the technical challenges overcome, and the impressive results, including 75% less CPU, 80% smaller data size, and 55% cost savings. - [Trello's Migration from RabbitMQ to Kafka for Real-time WebSocket Updates](https://arpitbhayani.me/videos/trello-rabbitmq-kafka-migration-websockets): Explore Trello's architectural evolution for real-time updates, detailing their journey from a complex 15-node RabbitMQ cluster to a simplified Kafka-based system. This analysis covers RabbitMQ's challenges at scale, including split-brain issues and transient queue overhead, and highlights Kafka's benefits in cost reduction, improved stability, and enhanced performance for WebSocket communication. - [Atlassian's Cache Invalidation Evolution: From SNS+SQS Push to S3 Pull Architecture](https://arpitbhayani.me/videos/atlassians-evolution-cache-invalidation-sns-sqs-s3-pull): Explore Atlassian's journey in managing distributed cache invalidation for their Tenant Context Service. This article details their initial SNS+SQS push-based approach, highlighting its critical scalability and cost challenges due to excessive fan-out. Discover how they re-architected their system to a more efficient batching and S3 pull-based model, addressing infrastructure costs and demonstrating the trade-offs between push and pull architectures at scale. - [Load Balancers Are Not Magic: Dissecting the Atlassian Outage](https://arpitbhayani.me/videos/load-balancers-not-magic-atlassian-outage): This article dissects the 2019 Atlassian outage, which revealed that load balancers are not infinitely scalable and require warm-up time. It explains how Atlassian's blue-green deployment, which replaced the load balancer, led to an unwarmed ELB being hit by full production traffic, causing a 5-minute service interruption before self-recovery. Learn about load balancer scaling, the difference between surges and spikes, and best practices for deployment strategies. - [HTTP Streaming: Enhancing Web Performance and User Experience with Airbnb's Approach](https://arpitbhayani.me/videos/http-streaming-airbnb-web-performance): This article explores HTTP streaming, a powerful technique for sending partial responses to clients, significantly improving web performance and user experience. It delves into the core mechanics, implementation details, and practical advantages, showcasing how Airbnb leverages early flushing and deferred data chunks to optimize First Contentful Paint and minimize load times in production. - [A Bug in GitHub's Redis-Based Rate Limiter: The Wobbling X-RateLimit-Reset Header](https://arpitbhayani.me/videos/github-redis-rate-limiter-wobbling-bug): This article dissects a fascinating bug encountered by GitHub in their Redis-based rate limiter, where the X-RateLimit-Reset header exhibited 'wobbling' behavior. It explores GitHub's evolution from Memcached to Redis, the root cause stemming from distributed system clock synchronization and network latency, and the ingenious solution implemented to ensure consistent rate limit reset times. - [DragonflyDB's Distributed Transactions in a Shared-Nothing Architecture](https://arpitbhayani.me/videos/dragonflydb-distributed-transactions-shared-nothing-architecture): Explore how DragonflyDB, a high-throughput Redis replacement, implements distributed transactions within a single machine. This deep dive covers its shared-nothing architecture, the two-phase commit-like protocol involving a coordinator fiber and shard threads, and mechanisms like intent locks and head-of-queue execution to ensure atomicity and serializability. - [Latency vs. Response Time: Understanding Key Performance Metrics](https://arpitbhayani.me/videos/latency-vs-response-time-understanding-key-performance-metrics): Latency and response time are often used interchangeably, but they represent distinct aspects of system performance. This article clarifies their definitions, components, and significance, highlighting that latency refers to waiting time and network traversal, while response time encompasses latency plus server processing, reflecting the total observed performance. - [How LinkedIn Reduced Microservice Latency by 60% with Protocol Buffers](https://arpitbhayani.me/videos/how-linkedin-reduced-latency-with-protobuf): LinkedIn achieved a 60% reduction in microservice latency across 50,000+ endpoints by replacing JSON serialization with Google Protocol Buffers. Discover the inefficiencies of textual serialization formats at scale and how LinkedIn safely rolled out binary encoding across their Rest.li framework. - [Designing a Real-Time Gaming Leaderboard: Horizontally Scalable & Highly Available](https://arpitbhayani.me/videos/designing-realtime-gaming-leaderboard): Learn how to architect a production-ready, low-latency gaming leaderboard capable of handling millions of concurrent events. This guide breaks down the pitfalls of naive OLTP approaches and demonstrates how to decouple write and read paths using DynamoDB and real-time analytical engines like Rockset. - [Compute-Compute Separation: How Rockset Achieves Real-Time Latency and Workload Isolation](https://arpitbhayani.me/videos/rockset-compute-compute-separation-workload-isolation): An architectural breakdown of Rockset's compute-compute separation design pattern for real-time search and analytics. Learn how traditional databases and standard decoupled storage architectures fail under concurrent ingest and analytical workloads, and how streaming MemTable replication with shared SSD caching achieves microsecond freshness, high cache hits, and zero resource contention. - [Rockset Architecture: Distributed Query Execution and Horizontal Autoscaling](https://arpitbhayani.me/videos/rockset-query-execution-and-horizontal-scaling): An in-depth exploration of Rockset's query execution engine and elasticity architecture. Learn how document-based sharding, cost-based operator DAGs, pipelined tuple streaming, and RocksDB-Cloud enable sub-second analytical queries and on-demand horizontal scaling. - [Architecting for 20 Million Concurrent Viewers: Inside JioCinema's IPL Live Streaming Infrastructure](https://arpitbhayani.me/videos/jiocinema-ipl-streaming-architecture-20m-concurrency): An architectural breakdown of how JioCinema live-streams the Indian Premier League (IPL) to over 20 million concurrent devices. Learn how engineering teams handle massive traffic spikes using pre-scaled infrastructure, multi-CDN optimization, panic-mode failovers, and server-side ad insertion. - [Designing Reddit's Unified Media Metadata Store: 100k RPS at 17ms p99 Latency](https://arpitbhayani.me/videos/reddit-media-metadata-store-aurora-postgres-architecture): An architectural breakdown of how Reddit consolidated fragmented media metadata across multiple databases into AWS Aurora PostgreSQL. Learn how they achieved 100,000 requests per second at a sub-17ms p99 latency without a read cache, leveraging PgBouncer, Kafka CDC, JSONB, and pg_partman. - [How DNS Works: Decentralized Architecture, Anycast, and Infinite Scale](https://arpitbhayani.me/videos/how-dns-works-architecture-anycast-scaling): An architectural deep-dive into how the Domain Name System (DNS) operates as a globally distributed, decentralized key-value store. Learn how DNS resolvers, the 13 logical root name servers, Anycast routing, TLD servers, and authoritative zones work together to resolve domains at scale without a central point of failure. - [Understanding Proxy, Forward Proxy, and Reverse Proxy in System Design](https://arpitbhayani.me/videos/understanding-proxy-forward-proxy-and-reverse-proxy): An architectural deep-dive into network proxies, comparing forward proxies and reverse proxies. Learn how forward proxies protect client identities and enforce corporate policies, and how reverse proxies enable load balancing, API routing, caching, and database connection pooling using tools like Nginx, HAProxy, and ProxySQL. - [Deep Dive into CockroachDB Architecture: Distributed SQL, Distributed Execution, and Storage Internals](https://arpitbhayani.me/videos/cockroachdb-architecture-distributed-sql-internals): An architectural deep dive with CockroachDB co-founder Ben Darnell covering distributed SQL execution, why serializability is the default isolation level, the migration from RocksDB to Pebble, and how CockroachDB handles clock uncertainty without Google Spanner's atomic clocks. - [Distributed Database Indexes: Architecture, Trade-Offs, and Internals](https://arpitbhayani.me/videos/distributed-database-indexes-tradeoffs-and-internals): An architectural exploration of secondary indexing in sharded and distributed databases. Understand why cross-partition queries cause scatter-gather bottlenecks, and how to evaluate trade-offs between Global Secondary Indexes (GSIs) and Local Secondary Indexes (LSIs). - [The Google File System (GFS): Architecture, Trade-Offs, and Internals](https://arpitbhayani.me/videos/google-file-system-paper-explained): An architectural breakdown of the seminal 2003 Google File System (GFS) paper. Learn how Google designed a distributed file system on failure-prone commodity hardware by separating metadata from data paths, embracing 64 MB chunking, and optimizing for sequential appends. - [Building Highly Available Load Balancers with Anycast: Google's 2010 Architecture](https://arpitbhayani.me/videos/highly-available-load-balancers-anycast-google-architecture): An architectural breakdown of Google's 2010 paper 'Anycast as a Load Balancing Feature', detailing how Anycast and Linux HA networking primitives enable seamless regional failover. Learn how LVS, IPVS, Heartbeat, and ldirectord combine with BGP to provide transparent, multi-site traffic resilience without proxying bottlenecks. - [CAP Theorem: First Principles, the '2 of 3' Myth, and How Google Spanner Approaches It](https://arpitbhayani.me/videos/cap-theorem-from-first-principles): A first-principles deep dive into Eric Brewer's CAP theorem, debunking the common 'pick two of three' misconception. Understand the precise definitions of Consistency, Availability, and Partition Tolerance, and discover how Google Cloud Spanner practically navigates the theorem using TrueTime and redundant private networks. - [Migrating from Cloud to Bare Metal: Dukaan's Architecture and Infrastructure Blueprint](https://arpitbhayani.me/videos/migrating-from-cloud-to-bare-metal-dukaan-architecture): An architectural deep-dive into how e-commerce platform Dukaan abandoned public cloud providers for bare-metal infrastructure. Discover how they tackled database replication, GitOps deployments, global traffic spikes, and disaster recovery with a lean engineering team. - [Designing a High-Throughput, Secure Key-Value Store: Inside PayPal's JunoDB](https://arpitbhayani.me/videos/designing-high-throughput-secure-key-value-store-junodb): An architectural deep-dive into how PayPal designed JunoDB to combine single-digit millisecond latency with strict financial-grade security. Learn how it achieves end-to-end encryption, handles seamless key rotation via KMS, and leverages Go's concurrency model for CPU-bound cryptographic operations. - [Architecting for Six 9s: How PayPal's JunoDB Achieves High Availability](https://arpitbhayani.me/videos/how-junodb-achieves-six-nines-availability): An architectural deep dive into PayPal's distributed key-value store, JunoDB, and how it delivers 99.9999% availability for financial operations. Learn how JunoDB leverages a 2D storage grid, synchronous quorum reads and writes, and cross-datacenter asynchronous replication to eliminate single points of failure. - [How PayPal's JunoDB Scales Horizontally: Architecture, Partitioning, and Routing](https://arpitbhayani.me/videos/how-junodb-scales-horizontally): An architectural deep-dive into how PayPal's key-value database, JunoDB, scales horizontally across connections, compute, and storage. Learn how its two-tiered routing strategy combines modular hashing and consistent hashing to reliably handle over 100 billion daily requests. - [High-Level Architecture and System Design of PayPal's JunoDB](https://arpitbhayani.me/videos/junodb-architecture-system-design): An architectural deep-dive into PayPal's open-source distributed key-value store, JunoDB. Learn how it achieves horizontal scalability and fault tolerance using embedded RocksDB shards, consistent hashing, topology-abstracting proxies, and etcd. - [JunoDB Overview: PayPal's Open-Source Key-Value Store and Latency Bridging](https://arpitbhayani.me/videos/junodb-overview-paypal-key-value-store): An architectural breakdown of PayPal's open-source distributed key-value store, JunoDB. Learn why PayPal transitioned from C++ to Go, how JunoDB achieves six nines of availability across 350 billion daily requests, and how it solves read-your-writes consistency across active-active data centers using latency bridging. - [Solving the Thundering Herd Problem: Implementing API Retries with Exponential Backoff and Jitter](https://arpitbhayani.me/videos/thundering-herd-problem-api-retries-jitter): Naive API retries during transient network glitches can overwhelm recovering servers and trigger the thundering herd problem. Learn how combining exponential backoff with randomized jitter prevents synchronized retry spikes and allows distributed systems to gracefully recover. - [Designing Idempotent API Endpoints for Payments: Stripe's Approach](https://arpitbhayani.me/videos/designing-idempotent-api-endpoints-stripe): Explore how to design fault-tolerant, idempotent payment APIs that prevent double charging during network failures. Learn how Stripe leverages explicit idempotency keys, auxiliary distributed storage, and state tracking to achieve exactly-once processing semantics. - [How Slack Efficiently Classifies Emails at Scale with Eventual Consistency](https://arpitbhayani.me/videos/how-slack-efficiently-classifies-emails-at-scale-with-eventual-consistency): Discover how Slack designs a resilient, eventually consistent email classification system to distinguish internal from external workspace members. This technical deep dive covers domain heuristics, asynchronous Kafka processing with atomic upserts, and an intelligent healer service that resolves counter drift caused by at-least-once delivery semantics. - [Understanding Conflict-Free Replicated Data Types (CRDTs): Architecture, Algorithms, and Trade-offs](https://arpitbhayani.me/videos/understanding-crdts-architecture-algorithms-tradeoffs): An in-depth exploration of Conflict-Free Replicated Data Types (CRDTs), examining how they enable offline-first collaborative tools and geo-replicated databases. Learn the differences between state-based and operation-based CRDTs, how they resolve issues like character interleaving, and their boundaries compared to consensus protocols. - [Zero-Downtime Data Migration: How Shopify Solves Hot Shards](https://arpitbhayani.me/videos/shopify-zero-downtime-data-migration-hot-shards): Learn how Shopify rebalances multi-tenant MySQL shards to eliminate hot partitions without incurring customer-facing downtime. This deep dive covers pod-based database architecture, change data capture (CDC) via binlog streaming, and the multi-phase cutover strategy powering tools like Ghostferry. - [Designing a High-Throughput Order Data Layer: Grab's Architecture for Millions of Daily Transactions](https://arpitbhayani.me/videos/grab-order-data-layer-architecture): An architectural breakdown of Grab's order data platform, detailing the dual-database pattern separating OLTP from OLAP, DynamoDB sparse global secondary indexing, and multi-tier queue failover strategies. - [Scaling Elasticsearch at Twitter: Architecture, Proxies, and Asynchronous Ingestion](https://arpitbhayani.me/videos/scaling-elasticsearch-twitter-architecture): Discover how Twitter scales its search infrastructure across tweets, users, and DMs using Elasticsearch. Learn how an intelligent proxy layer, Kafka-driven asynchronous ingestion, and HDFS-based backfilling protect clusters from massive traffic surges. - [Scaling Financial Data Consistency: Razorpay's Journey from Monolith to Microservices](https://arpitbhayani.me/videos/razorpay-journey-to-microservices-data-consistency): An architectural deep-dive into how Razorpay migrated from a PHP/MySQL monolith to an event-driven microservices architecture. Learn how they handled database connection saturation during peak events, dismantled database foreign keys, and implemented high-throughput eventual consistency using the transactional outbox pattern, CDC pipelines, and two-way handshakes. - [Designing Uber's Highly Available Emergency SOS Service](https://arpitbhayani.me/videos/designing-ubers-highly-available-emergency-sos-service): An architectural breakdown of Uber's life-critical Emergency SOS service, detailing how the platform achieves continuous high availability and sub-second dispatch. Learn how real-time location streaming, reverse geocoding, asynchronous Kafka pipelines with synchronous fallbacks, and RapidSOS integrations ensure passenger safety. - [Scaling Booking.com's Highly Available User Review System](https://arpitbhayani.me/videos/scaling-booking-com-user-review-system): An architectural deep-dive into how Booking.com powers its mission-critical ratings and reviews platform. Learn how they achieve sub-50ms P99 latency at 10,000 QPS using consistent hashing, materialized views, caching, and multi-AZ database sharding. - [Architecting Discord's Data Platform: Processing Trillions of Points with Derive](https://arpitbhayani.me/videos/discords-derive-data-platform-architecture): An architectural deep-dive into Derive, Discord's declarative self-serve data platform designed to process petabytes of data and trillions of events daily. Learn how Discord decouples analytical workloads from operational OLTP databases, orchestrates derived views via YAML, and bridges BigQuery with ScyllaDB for real-time low-latency serving. - [Designing Himeji: Airbnb's Scalable Centralized Authorization System](https://arpitbhayani.me/videos/airbnb-himeji-centralized-authorization-system): An in-depth analysis of Airbnb's centralized authorization system, Himeji. Learn how Himeji uses tuple-based data modeling, set theory, consistent hashing, and CDC-driven cache invalidation to provide sub-millisecond, fine-grained access control at scale. - [Designing a Scalable Phone Number Masking System for Hyperlocal Apps](https://arpitbhayani.me/videos/designing-scalable-phone-number-masking-system): Learn how hyperlocal platforms like Gojek, Uber, and Swiggy protect user privacy by masking phone numbers at scale. This guide covers virtual number pooling, ephemeral transaction-based allocation, and dynamic call-bridging with telecom providers. - [Architecture of Yelp's In-House Search Engine: nrtSearch](https://arpitbhayani.me/videos/architecture-of-yelps-in-house-search-engine-nrtsearch): An architectural deep-dive into how Yelp replaced Elasticsearch with nrtSearch, a custom gRPC and Lucene-based search engine. Learn how segment-based replication, AWS EBS failovers, and virtual sharding eliminated indexing bottlenecks and drastically reduced search latency. - [Scaling to 10 Billion Daily Requests: How GIPHY Architected Its CDN Strategy](https://arpitbhayani.me/videos/how-giphy-uses-cdn-to-serve-10-billion-gifs): Discover how GIPHY serves over 10 billion media assets daily by pushing both static assets and API responses to edge networks. Learn about multi-tiered caching with Origin Shielding, surrogate key invalidation, and custom cache control strategies using Fastly. - [Serving Massive Image Thumbnails at Scale: Dropbox's Chunked Transfer Architecture](https://arpitbhayani.me/videos/serving-massive-thumbnails-chunked-transfer-encoding): Learn how Dropbox optimized thumbnail rendering and circumvented browser concurrent TCP connection limits using HTTP 1.1 Chunked Transfer Encoding. This guide breaks down batching, base64 data URIs, and asynchronous streaming to eliminate head-of-line blocking and achieve low-latency visual feeds. - [Real-Time Aggregations in DynamoDB: How Deliveroo Computes Favorite Counts](https://arpitbhayani.me/videos/real-time-aggregations-dynamodb-deliveroo): Amazon DynamoDB excels at low-latency point reads and writes but lacks native aggregation primitives like GROUP BY or COUNT. This breakdown explores how Deliveroo implemented cost-effective, real-time favorite counts by decoupling write operations from aggregation using DynamoDB Streams, AWS Lambda, and atomic counter updates. - [How Razorpay Scaled Their Notification System to Handle High-Throughput Fintech Workloads](https://arpitbhayani.me/videos/how-razorpay-scaled-notification-system): An architectural teardown of how Razorpay scaled its high-throughput notification platform under intense peak loads. Learn how priority-based queue isolation, granular rate limiting, and asynchronous streaming via Kinesis prevented database I/O saturation and maintained strict sub-2-second P99 delivery SLAs. - [Designing Hyper-Personalized Type-Ahead Search at Flipkart Scale](https://arpitbhayani.me/videos/flipkart-hyper-personalized-type-ahead-search): Learn how Flipkart transformed standard type-ahead search suggestions into a hyper-personalized, context-aware experience. Explore their ranking criteria, session intent modeling using catalog taxonomy, and the end-to-end architecture leveraging Apache Solr and XGBoost with Learning to Rank (LTR). - [Architecture of Pinterest's Time Series Database: Goku](https://arpitbhayani.me/videos/architecture-of-pinterest-time-series-database-goku): An in-depth architectural breakdown of Pinterest's custom in-memory time series database, Goku. Learn how Pinterest solved OpenTSDB's JVM garbage collection and disk scan bottlenecks by leveraging Facebook's Gorilla compression, push-down aggregations, and a two-tiered memory bucket model. - [The Architecture of Airbnb's Knowledge Graph](https://arpitbhayani.me/videos/architecture-of-airbnb-knowledge-graph): An architectural deep-dive into how Airbnb structures and serves entity relationships across listings, locations, and experiences. Learn why they chose a relational database over specialized graph databases, how queries are translated, and how mutations are ingested asynchronously at scale. - [Designing and Scaling Swiggy's Support Chatbot Architecture](https://arpitbhayani.me/videos/swiggy-chatbot-system-design): An architectural deep-dive into how food-delivery giant Swiggy designed its automated support chatbot. Learn how deterministic decision trees, webview rendering, fraud detection engines, and business continuity fallbacks deliver sub-10-second issue resolution at scale without relying on costly NLP infrastructure. - [Two-Phase Commit (2PC) Protocol for Distributed Transactions](https://arpitbhayani.me/videos/two-phase-commit-distributed-transactions): An architectural breakdown of the Two-Phase Commit (2PC) protocol used to achieve atomic consensus across distributed nodes. This guide covers the two-phase protocol mechanics, core operating assumptions, message complexity, and critical failure scenarios that classify 2PC as a blocking consensus protocol. - [Exponential Information Gathering (EIG) Algorithm for Byzantine Agreement](https://arpitbhayani.me/videos/exponential-information-gathering-eig-byzantine-agreement): An in-depth guide to the Exponential Information Gathering (EIG) algorithm for solving Byzantine agreement in distributed systems. Learn how the EIG tree data structure, round-by-round permutation gossip, and bottom-up majority resolution guarantee consensus despite malicious nodes. - [Exponential Information Gathering (EIG): Crash-Tolerant Distributed Consensus](https://arpitbhayani.me/videos/exponential-information-gathering-eig-consensus): An in-depth exploration of the Exponential Information Gathering (EIG) algorithm for achieving distributed consensus in the presence of crash failures. Learn how the permutation-based EIG tree gathers exhaustive message paths over f+1 rounds, guaranteeing identical state views and consistent decision rules across nodes. - [FloodSet Algorithm: Distributed Consensus Under Process Crash Failures](https://arpitbhayani.me/videos/floodset-algorithm-distributed-consensus): An in-depth exploration of the FloodSet algorithm, a foundational consensus protocol designed for synchronous distributed systems experiencing process crash failures. Learn how maintaining flooded value sets across f + 1 rounds guarantees agreement, validity, and termination. - [Unsolvable Distributed Consensus and The Two Generals' Problem](https://arpitbhayani.me/videos/unsolvable-distributed-consensus-two-generals-problem): An in-depth exploration of the Two Generals' Problem, proving why deterministic consensus is fundamentally impossible over unreliable communication channels. Learn how the infinite acknowledgement dilemma manifests in distributed databases and how real-world systems use probabilistic assumptions and retries to bypass theoretical bounds. - [Distributed Minimum Spanning Tree: The GHS Algorithm and Applications](https://arpitbhayani.me/videos/distributed-minimum-spanning-tree-ghs-algorithm): An in-depth exploration of the Gallager-Humblet-Spira (GHS) algorithm for constructing Minimum Spanning Trees in distributed networks. Learn how distributed components discover minimum weight outgoing edges, merge through synchronized levels, and enable downstream applications like low-overhead leader election. - [Distributed Bellman-Ford: Computing Shortest Paths in Decentralized Networks](https://arpitbhayani.me/videos/distributed-bellman-ford-shortest-path): Explore how the classical Bellman-Ford algorithm adapts to decentralized distributed systems where no single node has full network topology visibility. Learn the mechanics of synchronous edge relaxation, state tracking, and communication versus time complexity trade-offs. - [Synchronous Breadth-First Search (BFS) in Distributed Systems](https://arpitbhayani.me/videos/synchronous-breadth-first-search-distributed-systems): An in-depth exploration of synchronous Breadth-First Search (BFS) in distributed systems where nodes only have local knowledge of their immediate neighbors. Covers the mechanics of building a directed spanning tree, child-parent signaling, termination detection via convergecast, and network complexity trade-offs. - [FloodMax Algorithm for Leader Election in Distributed Systems](https://arpitbhayani.me/videos/floodmax-leader-election-algorithm): An in-depth guide to the FloodMax algorithm, a topology-agnostic leader election protocol for distributed systems. Learn how network diameter dictates election rounds, evaluate time and message complexity, and explore key optimizations to reduce network overhead. - [TimeSlice Leader Election Algorithm in Distributed Systems](https://arpitbhayani.me/videos/timeslice-leader-election-algorithm): An in-depth analysis of the TimeSlice leader election algorithm for synchronous distributed networks. Explores how ring topology, phased synchronous execution, and unique identifier thresholds achieve O(n) message complexity at the cost of O(n * u_min) time complexity. - [HS Algorithm for Leader Election in Distributed Systems](https://arpitbhayani.me/videos/hs-algorithm-leader-election): An in-depth guide to the Hirschberg-Sinclair (HS) algorithm for synchronous leader election on bidirectional rings. Learn how exponential neighborhood exploration achieves O(n log n) message complexity and enables automated fault recovery without knowing total network size. - [Understanding the LCR Algorithm for Distributed Leader Election](https://arpitbhayani.me/videos/lcr-algorithm-leader-election): An in-depth breakdown of the LCR (Le Lann-Chang-Roberts) leader election algorithm for ring topologies. Learn how nodes coordinate synchronously to elect a leader based on unique identifiers, how termination is achieved without knowing the cluster size, and the communication complexity trade-offs involved. - [Exploiting the BitTorrent Network: Mechanics of P2P Free-Riding and Protocol Abuse](https://arpitbhayani.me/videos/exploiting-bittorrent-network-free-riding-protocol-abuse): An in-depth technical analysis of peer-to-peer vulnerabilities in the BitTorrent protocol, detailing how free-riders manipulate peer discovery, optimistic unchoking, piece selection, and tracker metrics to maximize download speeds without uploading. - [Kademlia Explained: A Deep Dive into Distributed Hash Tables](https://arpitbhayani.me/videos/kademlia-distributed-hash-table-deep-dive): An architectural deep dive into Kademlia, the distributed hash table powering decentralized peer-to-peer overlay networks like BitTorrent. Learn how 160-bit node and key representations, the XOR metric, binary trie routing, and k-buckets guarantee deterministic convergence without a central authority. - [BitTorrent Piece Selection: How Rarest-First Ensures Fault Tolerance and Speed](https://arpitbhayani.me/videos/bittorrent-piece-selection-rarest-first-algorithm): An in-depth exploration of BitTorrent's piece selection algorithms, focusing on the Rarest-First policy. Learn how peers track piece availability, balance load away from seeders, handle cold starts with Random-First, maintain block pipelining with Strict Priority, and avoid tail latency using Endgame Mode. - [BitTorrent's Choke Algorithm: Decentralized Tit-for-Tat and Anti-Free-Riding](https://arpitbhayani.me/videos/bittorrent-choke-algorithm-internals): An architectural exploration of BitTorrent's choke algorithm, detailing how peer-to-peer networks allocate bandwidth and prevent free-riding without a central coordinator. Learn the mechanics of regular unchoking, optimistic unchoking for peer bootstrapping, and seeder-side allocation strategies. - [BitTorrent Architecture: Trackers, Pieces, Seeders, and Swarm Dynamics](https://arpitbhayani.me/videos/bittorrent-architecture-overview): An architectural deep-dive into BitTorrent internals, exploring how trackers, .torrent metadata, SHA-1 piece verification, and swarm connection limits enable decentralized peer-to-peer file distribution at scale. - [Understanding the Torrent File Format and Bencoding](https://arpitbhayani.me/videos/understanding-torrent-file-format-and-bencoding): An in-depth exploration of the BitTorrent .torrent file structure, swarm lifecycle mechanics, and the Bencoding serialization specification. Learn how metadata, multi-file paths, piece-level SHA-1 hashing, and recursive encoding work together to enable trustless peer-to-peer file distribution. - [Introduction to BitTorrent: Architecture, Protocols, and Peer-to-Peer File Distribution](https://arpitbhayani.me/videos/introduction-to-bittorrent-architecture-p2p): An architectural exploration of BitTorrent, examining how peer-to-peer distribution overcomes client-server upload bandwidth bottlenecks. Covers hybrid P2P topology, pieces versus blocks, peer sets, and real-world infrastructure applications such as large-scale server artifact deployments. - [Dissecting GitHub's Integer Overflow Outage: Post-Incident Protocols and Mitigation vs. Resolution](https://arpitbhayani.me/videos/dissecting-github-outage-and-post-incident-protocols): An architectural teardown of GitHub's outage caused by an INT32 foreign key overflow in their scope token service. Learn the critical difference between incident mitigation and true resolution, alongside a four-step playbook for post-outage recovery. - [Dissecting a GitHub Outage: Blast Radius and Localizing Failures in Microservices](https://arpitbhayani.me/videos/dissecting-github-outage-blast-radius-localizing-failures): An architectural breakdown of a major GitHub Actions outage caused by a database infrastructure fault and silent telemetry failure. Learn how zero-trust service authentication, synchronous coupling, and automated failover mechanics influence blast radius and fault containment in distributed microservices. - [Backend for Frontend (BFF) Pattern in Microservices](https://arpitbhayani.me/videos/backend-for-frontend-pattern-in-microservices): An in-depth exploration of the Backend for Frontend (BFF) architectural pattern, addressing how to serve diverse client types—such as web, mobile, and voice assistants—without compromising core backend simplicity. The article covers request aggregation, protocol adaptation, architectural trade-offs, and clear guidelines on when to implement BFF layers. - [Dissecting GitHub's ZooKeeper Outage: Split-Brain Consensus and Fallback Strategies](https://arpitbhayani.me/videos/github-outage-zookeeper-multiple-leaders-split-brain): An in-depth postmortem analysis of GitHub's outage caused by the election of two ZooKeeper leaders during rapid node reprovisioning. Learn how conflicting metadata cascaded into Apache Kafka and how a resilient fallback queue architecture prevented catastrophic data loss. - [Database Management at Scale: Dissecting the GitHub MySQL Outage](https://arpitbhayani.me/videos/database-management-at-scale-github-mysql-outage): An architectural breakdown of how production MySQL databases are managed using ProxySQL and GitHub Orchestrator. Learn how automatic failover, anti-flapping patterns, and deployment rollbacks function during high-severity cascading outages. - [Best Practices for Seamless Microservices Integration](https://arpitbhayani.me/videos/best-practices-microservices-integration): Designing microservices requires balancing cross-service collaboration with operational autonomy. This guide covers four essential architectural best practices—schema compatibility, technology-agnostic interfaces, consumer-centric design, and strict encapsulation—to prevent tight coupling and technical debt. - [Dissecting GitHub's Outage: When a Rate Limiter Causes Downtime](https://arpitbhayani.me/videos/dissecting-github-outage-rate-limiter-downtime): An architectural breakdown of the GitHub outage where an internal rate limiter on a dynamic configuration service caused widespread application errors. Learn how tightly coupled synchronous dependencies during deployments can trigger cascading failures and how to prevent them through proper service tiering and caching. - [Architectural and Organizational Principles for Building Microservices](https://arpitbhayani.me/videos/principles-for-building-microservices): Building microservices is as much an organizational and sociotechnical discipline as it is an engineering challenge. This guide explores key strategies for navigating distributed architecture, handling inevitable technical conflicts, managing technical debt, and aligning technical execution with business strategy. - [Standardizing Microservices: Architectural Guardrails for Scalable Systems](https://arpitbhayani.me/videos/standardizing-microservices-architectural-guardrails): Unchecked microservice autonomy introduces severe operational chaos, debugging bottlenecks, and hiring challenges. This guide explores the definition of a manageable service and details the three non-negotiable verticals every engineering organization must standardize: monitoring, interfaces, and fault tolerance. - [Top 10 Engineering and Organizational Challenges in Adopting Microservices](https://arpitbhayani.me/videos/microservices-adoption-challenges): Moving from a monolithic architecture to microservices introduces significant operational, architectural, and organizational complexities. This breakdown explores the top ten challenges engineers face—ranging from distributed tracing and configuration management to cascading failures and dependency versioning—and how to address them effectively. - [Understanding Microservices: Architecture, Evolution, and Trade-offs](https://arpitbhayani.me/videos/understanding-microservices-architecture-evolution): A comprehensive guide to microservices architecture, breaking down how systems transition from monoliths, their core characteristics, and the critical anti-patterns to avoid. - [Dissecting the GitHub Actions Outage: When Proactive Fixes Meet Hidden Blind Spots](https://arpitbhayani.me/videos/dissecting-github-actions-outage-blind-spots): An in-depth post-mortem of the March 2021 GitHub Actions outage caused by integer overflow during JSON unmarshaling. Despite migrating database primary keys from INT to BIGINT six months in advance, an external GraphQL library hardcoded to 32-bit integers created a critical blind spot that halted workflow execution and search indexing. - [API Composition Pattern in Microservices](https://arpitbhayani.me/videos/api-composition-pattern-in-microservices): Learn how the API Composition pattern solves the challenge of querying distributed data across multiple microservices. This guide explores architectural patterns, sequential vs. parallel fan-out strategies, real-world trade-offs, and how API gateways optimize client-server communication. - [Dissecting the Secret Scanning Bug That Took Down GitHub](https://arpitbhayani.me/videos/scanning-bug-that-took-down-github): In April 2021, an unexpected database dependency caused GitHub's core repository creation API to fail for 53 minutes. This post-mortem analysis examines the root cause—a table migration for secret scanning—and explores why synchronous couplings, monolithic evolution artifacts, and failure domain design can bring down critical infrastructure. - [Database per Service Pattern in Microservices: Architecture, Benefits, and Trade-offs](https://arpitbhayani.me/videos/database-per-service-pattern-microservices): An architectural deep dive into the Database per Service pattern in microservices. Learn how private data stores enable service autonomy and polyglot persistence, alongside critical trade-offs such as distributed transactions, eventual consistency, and operational complexity. - [Understanding REST: Core Architecture, HTTP Synergy, and Trade-offs](https://arpitbhayani.me/videos/understanding-rest-architecture-http-tradeoffs): An architectural deep dive into Representational State Transfer (REST), clarifying the distinction between REST specifications and HTTP implementations. Learn how resource-oriented design, representation decoupling, and HTTP verb multiplexing work, alongside the performance downsides and RPC trade-offs. - [An In-Depth Guide to Rolling Deployments: Mechanics, Implementation, and Trade-offs](https://arpitbhayani.me/videos/in-depth-guide-rolling-deployments): Explore the inner workings of rolling deployments, from graceful connection draining and load balancer detachment to immutable infrastructure replacement. Learn tuning techniques like batch updates and double-half deployments, along with essential forward and backward compatibility requirements. - [Implementing Vertical Sharding: A Practical Guide to Live Table Migrations](https://arpitbhayani.me/videos/how-to-implement-vertical-sharding): Learn how to practically implement vertical database sharding to mitigate database hot spots and decompose monoliths. This guide covers metadata routing with ZooKeeper watches, binlog-based replication, atomic cutover mechanisms, and consistency trade-offs. - [How an Edge Case and Retry Storms Can Take Down a Database: Lessons from GitHub's Outage](https://arpitbhayani.me/videos/how-an-edge-case-caused-github-downtime): An analysis of how subtle edge cases in high-throughput services can generate unoptimized database queries and trigger catastrophic cascading failures. Using GitHub's August 2021 MySQL outage as context, this deep dive explores the anatomy of retry storms, degraded primaries, and defensive system design patterns. - [An In-Depth Guide to Blue-Green Deployments](https://arpitbhayani.me/videos/blue-green-deployments): Explore the mechanics, architectural trade-offs, and implementation details of blue-green deployments. Learn how provisioning identical production environments eliminates deployment micro-downtimes, enables instant rollbacks, and simplifies disaster recovery. - [An In-Depth Guide to Canary Deployments](https://arpitbhayani.me/videos/in-depth-guide-to-canary-deployments): Learn how canary deployments mitigate the risks of production outages by routing a fraction of real user traffic to updated services. This guide covers the architectural mechanics, traffic routing strategies, trade-offs, and critical use cases like full-service rewrites. - [Understanding Remote Procedure Calls (RPC): Architecture, Stubs, and Inter-Service Communication](https://arpitbhayani.me/videos/introduction-to-remote-procedure-calls-rpc): A comprehensive deep dive into Remote Procedure Calls (RPC), exploring how they abstract complex network operations into native local function calls. Learn how stubs, Interface Definition Languages (IDLs), and transport protocols enable efficient, polyglot microservice communication. - [Designing Workflows in Microservices: Orchestration vs Choreography](https://arpitbhayani.me/videos/designing-workflows-in-microservices-orchestration-vs-choreography): Explore the fundamental differences between orchestration and choreography for modeling workflows across distributed microservices. Learn how centralized coordination compares with decentralized event-driven architectures, and evaluate the precise trade-offs regarding coupling, observability, latency, and consistency. - [How an ALTER TABLE Caused a Massive GitHub Outage](https://arpitbhayani.me/videos/how-an-alter-table-caused-a-massive-github-outage): A deep dive into the November 2020 GitHub outage caused by a routine MySQL schema migration. Learn how ghost table renames triggered semaphore deadlocks on read replicas, why dual-fleet architectures fell victim to cascading crash-recovery loops, and why GitHub prioritized data integrity over availability to recover. - [Synchronous vs. Asynchronous Communication in Microservices](https://arpitbhayani.me/videos/synchronous-vs-asynchronous-microservices-communication): An architectural deep-dive into synchronous and asynchronous communication patterns in microservices. Understand blocking HTTP/gRPC interactions versus message brokers, the trade-offs in latency, coupling, cascading failures, and concrete criteria for selecting the right pattern. - [Serverless Computing Explained: Architecture, Real-World Use Cases, and Trade-offs](https://arpitbhayani.me/videos/serverless-computing-explained-architecture-and-use-cases): An architectural deep dive into serverless computing, breaking down how it works, pay-per-execution economics, five real-world use cases, and critical engineering trade-offs like cold starts and execution limits. - [Sharing Databases in Microservices: Anti-Pattern or Pragmatic Architecture?](https://arpitbhayani.me/videos/sharing-databases-in-microservices): Examine the shared database pattern in microservices architecture, analyzing why it is often labeled an anti-pattern alongside the real-world advantages it provides. Learn the four critical challenges of database sharing—coupling, logic leakage, corruption risks, and resource contention—and discover practical mitigations to safely leverage direct data access. - [Database Sharding vs. Partitioning: Architecture, Mechanics, and Scaling Trade-offs](https://arpitbhayani.me/videos/database-sharding-and-partitioning): Explore the foundational mechanics of database scaling, contrasting vertical scaling with horizontal scale-out architectures. Understand the precise distinctions between physical sharding and logical partitioning, visualized through a 2x2 architectural matrix, alongside operational trade-offs such as partition rebalancing and cross-shard queries. - [Scoping Microservices: Achieving the Right Boundary with Loose Coupling and High Cohesion](https://arpitbhayani.me/videos/scoping-microservices-loose-coupling-high-cohesion): Determining microservice boundaries is one of the hardest challenges in distributed systems design. This guide explores how to apply loose coupling and high cohesion to prevent microservice anti-patterns such as distributed monoliths and nano-services. - [System Protection via Throttling and Rate Limiting: 5 Real-World Use Cases](https://arpitbhayani.me/videos/system-protection-throttling-rate-limiting-use-cases): Throttling and rate limiting serve as critical defensive mechanisms to keep distributed systems resilient under load. This guide explores the core strategies for handling traffic surges—buffering, rejecting, and ignoring—along with five concrete external and internal use cases for protecting infrastructure and controlling cloud costs. - [An Engineering Deep-Dive into Atlassian's April 2022 Outage](https://arpitbhayani.me/videos/atlassian-outage-2022-engineering-deep-dive): A comprehensive post-mortem analysis of the April 2022 Atlassian outage that permanently deleted data for approximately 400 cloud customers. Discover the architectural trade-offs of multi-tenant shared databases, replication mechanics, soft vs. hard deletes, and why surgical point-in-time recovery takes weeks. - [A Pragmatic Framework for System Design: Spiral vs. Incremental MVP Approaches](https://arpitbhayani.me/videos/how-to-approach-system-design): System design can be overwhelming without a structured mental model. This guide outlines the two primary approaches to designing distributed architectures—the Spiral Approach and the Incremental MVP Approach—along with the three fundamental layers of system design and principles for scoping complex engineering problems. - [Should You Adopt Microservices? Architecture, Trade-Offs, and Service Fencing](https://arpitbhayani.me/videos/should-you-adopt-microservices-architecture-and-fencing): An architectural guide exploring whether and when to adopt a microservices architecture. Learn how microservices unlock team velocity, enable independent scaling, and improve fault tolerance, alongside practical heuristics for fencing service boundaries effectively. - [Building Robust Payment Services Using Idempotency Keys](https://arpitbhayani.me/videos/building-robust-payment-services-using-idempotency-keys): Learn the mechanics of designing idempotent APIs for mission-critical payment systems. This guide explores why distributed retries cause duplicate charges, when to avoid automatic retries, and how to implement the check-and-update pattern using idempotency keys. - [Dissecting the Google Maps Outage: Bad Rollouts, Retry Storms, and Cascading Failures](https://arpitbhayani.me/videos/dissecting-google-maps-outage-cascading-failures): A comprehensive postmortem analysis of the March 2022 global Google Maps outage. Learn how a single buggy deployment triggered synchronous timeouts, buffer saturation, a 10x client retry storm, and catastrophic cascading failure across microservices. - [Implementing Distributed Transactions Using the Two-Phase Commit Protocol](https://arpitbhayani.me/videos/implementing-distributed-transactions-using-two-phase-commit): A practical, code-level guide to implementing distributed transactions across microservices using the Two-Phase Commit (2PC) protocol. Using a 10-minute food delivery system as a concrete case study, this breakdown covers database schemas, row-level locking, reservation phases, and handling distributed resource contention. - [Distributed Transactions: Demystifying the Two-Phase Commit Protocol](https://arpitbhayani.me/videos/distributed-transactions-two-phase-commit-protocol): An architectural deep-dive into distributed transactions and the Two-Phase Commit (2PC) protocol. Using a real-world 10-minute food delivery workflow, learn how prepare and commit phases guarantee atomicity and isolation across independent microservices, along with critical failure modes, lease timers, and performance trade-offs. - [Safely and Gracefully Handling Timeouts in Microservices](https://arpitbhayani.me/videos/handling-timeouts-in-microservices): Synchronous dependencies between microservices inevitably suffer from network delays, node failures, and service degradation. This guide explores the core failure modes of inter-service communication and breaks down five practical strategies—from fallback defaults and safe retries to complete architectural decoupling—for handling timeouts gracefully. - [How to Handle Database Outages: Anatomy, Incident Triage, and Architectural Fixes](https://arpitbhayani.me/videos/handling-database-outages-short-and-long-term-fixes): Learn the underlying mechanics of database outages, why stateless web tiers outpace stateful backends during traffic spikes, and how to triage severe database saturation under pressure. Discover immediate incident mitigations—from killing offending queries to reserved connection logins—alongside long-term architectural fixes including InnoDB engine tuning, N+1 query elimination, and replication strategies. - [Dissecting Spotify's Global Outage: Service Discovery, GCP Traffic Director, and gRPC Failure Modes](https://arpitbhayani.me/videos/spotify-global-outage-service-discovery-traffic-director): An in-depth post-mortem analysis of Spotify's global outage on March 8, 2022, triggered by a GCP Traffic Director failure and compounded by a silent bug in Java's gRPC client library. Learn how service meshes, the xDS protocol, and dual-strategy service discovery architectures shape system resilience at scale. - [Scaling a Taxonomy Service and Database: Architecture and Bottlenecks](https://arpitbhayani.me/videos/scaling-taxonomy-service-and-database): An architectural breakdown of scaling a taxonomy service handling hierarchical classification data. Learn how to address relational database bottlenecks, connection exhaustion, tree traversal queries, and multi-tier caching strategies. - [Designing End-to-End Message Encryption: From First Principles to Real-World Architecture](https://arpitbhayani.me/videos/end-to-end-message-encryption): An architectural deep-dive into end-to-end encryption (E2EE) for messaging systems. Learn how asymmetric cryptography and digital signatures guarantee confidentiality and authenticity, why transport-layer TLS falls short of true privacy, and how modern protocols like Signal evolve beyond baseline public-key mechanics. - [Designing a Scalable Notification Service for Instagram](https://arpitbhayani.me/videos/designing-notifications-service-for-instagram): An architectural deep-dive into designing an Instagram-scale notification engine. Learn how to solve the massive fanout bottleneck, design client-agnostic notification payloads, implement smart decider logic, and decouple stream ingestion from I/O-heavy dispatch workers. ## Leadership ### Notes - [Effective Leadership Is About Outcomes Not Simply Interpersonal Skills](https://arpitbhayani.me/notes/effective-leadership-is-about-outcomes-not-simply-interpersonal-skills): Being good with people is an important part of leadership, but it is not the same as being a good leader. - [Tech leadership involves mediating excessive product requests and engineering builds](https://arpitbhayani.me/notes/tech-leadership-involves-mediating-excessive-product-requests-and-engineering-builds): my day is simple: I spend it explaining why product is asking for too much and engineering is building too much. fun fact - that is what tech leadership looks like. - [Startup Hiring Pitch of Unlimited Autonomy Is Usually a Lie](https://arpitbhayani.me/notes/startup-hiring-pitch-of-unlimited-autonomy-is-usually-a-lie): The biggest lie startups tell during hiring is "We have a lot of problems, and you can pick whatever you want to solve." - [Design Document Gaps Foster Engineer Decision-Making and Issue Discovery](https://arpitbhayani.me/notes/design-document-gaps-foster-engineer-decision-making-and-issue-discovery): I leave gaps in a design doc on purpose because, if I do not, I am treating my teammates as hands, not brains. - [Asking the right question is more important now](https://arpitbhayani.me/notes/asking-the-right-question-is-more-important-now): The ability to ask the right question is more important than ever now. - [Influence Is How Good Ideas Survive in Organizations](https://arpitbhayani.me/notes/influence-is-how-good-ideas-survive-in-organizations): Politics at work gets a bad reputation. Most people hear the word and think of manipulation, backstabbing, or someone taking credit for their work. That association is not wrong, but it is incomplete. - [Weak Leadership Revealed By "I" Instead of "We](https://arpitbhayani.me/notes/weak-leadership-revealed-by-i-instead-of-we): One of the clearest signs of weak leadership is the use of "I" instead of "we". - [Leadership across companies expects AI to magically cut time-to-ship in half.](https://arpitbhayani.me/notes/leadership-across-companies-expects-ai-to-magically-cut-time-to): Leadership across companies expects AI to magically cut time-to-ship in half. Yes, AI can help engineers code faster. But coding was never the bottleneck. Th... - [Be more prepared for your 1:1s than your manager.](https://arpitbhayani.me/notes/be-more-prepared-for-your-11s-than-your-manager): Be more prepared for your 1:1s than your manager. Being more prepared doesn't mean doing their job. It just means you're leading a meeting that's ultimately ... - [High Probability of Bad Outcome Doesn't Equal Bad Decision](https://arpitbhayani.me/notes/high-probability-of-bad-outcome-doesn-t-equal-bad-decision): Some decisions have a high probability of a bad outcome, but that does not make them bad decisions. - [Collaboration Is Better Than Competition in Many Cases](https://arpitbhayani.me/notes/collaboration-is-better-than-competition-in-many-cases): Why compete when you can collaborate. - [Availability Bias Leads to Optimizing Visible Not Actual Problems](https://arpitbhayani.me/notes/availability-bias-leads-to-optimizing-visible-not-actual-problems): We tend to make decisions based on data that is easy to collect, not data that is most representative. This is availability bias, and it has a massive influence on how our systems are built. - [Don't just bring problems to your manager; bring solutions.](https://arpitbhayani.me/notes/dont-just-bring-problems-to-your-manager-bring-solutions): Don't just bring problems to your manager; bring solutions. It's easy to get stuck in a rut of simply reporting problems. However, taking the initiative to t... - [Looking for Ability and Culture-Fit While Recruiting](https://arpitbhayani.me/notes/looking-for-ability-and-culture-fit-while-recruiting): While recruiting, I always looked for two things - ability and culture-fit. - [Comfort and Competition - Know When to Switch Gears](https://arpitbhayani.me/notes/leverage-the-equilibrium): Discover the power of balanced leadership - blending comfort and competition to drive team success and avoid burnout. - [Stop Leaving Money on the Table - Negotiate Your Job Offer](https://arpitbhayani.me/notes/negotiate-the-offer): Negotiate your job offer like a pro! Learn key strategies, including leveraging your current salary and competing offers, for career and financial growth. - [Quantify your resume, Know Your Numbers](https://arpitbhayani.me/notes/quantification-in-resume): Stand out with your resume! Learn how to quantify your engineering achievements and showcase your impact with simple, effective templates. - [The Importance of Being Likeable in Interviews](https://arpitbhayani.me/notes/hiring-is-unfair): Job hunting? Discover tips to make a great impression in interviews and improve your chances of landing the role, even if it's a close call. - [Building a Blameless Culture for Team Success](https://arpitbhayani.me/notes/building-a-blameless-culture-for-team-success): Blameless culture matters ⚡ - [All good engineers I have worked with were active listeners ⚡](https://arpitbhayani.me/notes/all-good-engineers-i-have-worked-with-were-active-listeners): All good engineers I have worked with were active listeners ⚡ When in a meeting or a discussion, good engineers don't just hear the words, they actively list... - [Good engineering managers hire well to free up time](https://arpitbhayani.me/notes/good-engineering-managers-hire-well-to-free-up-time): Good engineering managers spend most of their time and energy on hiring the right people; because good hires make them - [Do not shy away if you get boring projects at work ⚡](https://arpitbhayani.me/notes/do-not-shy-away-if-you-get-boring-projects-at): Do not shy away if you get boring projects at work ⚡ It is important to acknowledge that a company or a team will not have exciting projects for every engine... - [Three Key Attributes for Hiring Engineers and Leaders](https://arpitbhayani.me/notes/three-key-attributes-for-hiring-engineers-and-leaders): I have set up teams ground-up and led them to have a substantial org-wide impact. The only 3 things I look for while hiring engineers and leaders are - [Ambitious versus achievable goals, learn both traits](https://arpitbhayani.me/notes/ambitious-versus-achievable-goals-learn-both-traits): There are two types of managers, - [Engineering Leaders Focus on High-Impact Projects](https://arpitbhayani.me/notes/engineering-leaders-focus-on-high-impact-projects): Engineering leaders have a lot on their plate, and the good ones focus most on ## Software Engineering ### Notes - [PostgreSQL 19 Ships Property Graphs Enabling Direct Query of Existing Tables](https://arpitbhayani.me/notes/postgresql-19-ships-property-graphs-enabling-direct-query-of-existing-tables): PostgreSQL version 19 now includes built-in property graph support, enabling users to define and query graphs directly over their existing relational tables. This innovation allows for pattern-matching queries instead of complex joins and integrates seamlessly with standard SQL without requiring new extensions. - [Engineering Speed And Abstractions Create Longer Failure Paths, An Unacknowledged Tradeoff](https://arpitbhayani.me/notes/engineering-speed-and-abstractions-create-longer-failure-paths-an-unacknowledged-tradeoff): The text argues that engineers are losing their understanding of complex systems. This is attributed to the pressure for faster delivery and the increasing use of higher-order abstractions, which, while speeding up "happy paths," ultimately prolong the "failure path" when issues arise, a significant unacknowledged tradeoff. - [AI makes pull requests less central in open-source contribution](https://arpitbhayani.me/notes/ai-makes-pull-requests-less-central-in-open-source-contribution): Artificial intelligence is causing a shift in how contributions are made to open-source projects. The community's primary role will evolve from submitting code to defining project direction and providing valuable bug reports. - [Perform gradual frontend rollouts with a cookie and random number](https://arpitbhayani.me/notes/perform-gradual-frontend-rollouts-with-a-cookie-and-random-number): One of the simplest ways to do a gradual frontend rollout does not need a feature flag service at all. A cookie and a random number are enough. Here is the idea... - [Modern SaaS Value Shifts From Core Features To Essential Plumbing](https://arpitbhayani.me/notes/modern-saas-value-shifts-from-core-features-to-essential-plumbing): SaaS is not dead. The kind that is hard to justify buying is. Let me explain... companies pay for SaaS when it wins on at least two of four axes - time, money, capability (team's), and tokens. - [Skipping Go Compiler Bounds Checks Improves Performance with Unsafe](https://arpitbhayani.me/notes/skipping-go-compiler-bounds-checks-improves-performance-with-unsafe): Fun fact: Go compiler inserts a hidden check every time you index into a slice, and that check has a real cost. Take a simple function... - [Fragile staging and end-to-end tests hinder system scalability](https://arpitbhayani.me/notes/fragile-staging-and-end-to-end-tests-hinder-system-scalability): End-to-end tests do not work at scale, nor does staging infrastructure. Past a certain number of services, both turn into a liability, and a big one at that. - [Good DevOps Practices Are Essential for Reliable AI Agentic Workflows](https://arpitbhayani.me/notes/good-devops-practices-are-essential-for-reliable-ai-agentic-workflows): Months of building and shipping AI systems made me realize - one thing that makes agentic workflows work is good old best devops practices. - [Hands-on experience with systems reveals their critical failure modes](https://arpitbhayani.me/notes/hands-on-experience-with-systems-reveals-their-critical-failure-modes): Reading a tutorial and terms like exponential backoff, jitter, and idempotency keys makes sense. Then you build the thing, the API returns a 500, and you watch your system crash. - [Go's Error Handling Creates Excessive Nil And Error Checks](https://arpitbhayani.me/notes/go-s-error-handling-creates-excessive-nil-and-error-checks): Go is a great language, but lately it has been bothering me that my codebase is now filled with some, for lack of a better word, stupid nil and err checks. - [MD5 hash collisions are easily constructed and not secure](https://arpitbhayani.me/notes/md5-hash-collisions-are-easily-constructed-and-not-secure): We treat large hash functions like MD5 as practically unique and safe from collisions in normal use. But that's not always the case... Here are two strings that produce the same MD5 hash - [Learning One Language Deeply Gives Intuition AI Cannot Provide](https://arpitbhayani.me/notes/learning-one-language-deeply-gives-intuition-ai-cannot-provide): In my Applied AI Cohort, at the end, when we chit-chat, someone asked this question: Given that AI is generating most of the code, is it even useful to learn new languages deeply? Here is my take. - [Asymmetry in SYN Flood Attacks Makes SYN Cookies an Effective Countermeasure](https://arpitbhayani.me/notes/asymmetry-in-syn-flood-attacks-makes-syn-cookies-an-effective-countermeasure): SYN Flood is one of the oldest denial-of-service attacks, and it is still effective today. Here's what happens under the hood... - [Adopt a Specific Order for Comprehensive Code Review](https://arpitbhayani.me/notes/adopt-a-specific-order-for-comprehensive-code-review): Most of us review code in the wrong order. We spot a missing test or a style inconsistency before even asking whether the code is correct. We should think about it differently. - [Git Worktrees Empower Coding Agents to Run Tasks in Parallel](https://arpitbhayani.me/notes/git-worktrees-empower-coding-agents-to-run-tasks-in-parallel): Coding agents like Claude Code and others love Git worktrees. So, if you are using one or trying to build one, knowing about them is important, and here is what they are all about. - [Match Existing Codebase Conventions for Easier Collaboration](https://arpitbhayani.me/notes/match-existing-codebase-conventions-for-easier-collaboration): When you start working on a new (for you) but existing codebase, you will notice patterns you strongly disagree with. Naming conventions that seem stupid. Abstractions that seem over-engineered. - [Programming Outcomes are Harder to Ignore with Agents](https://arpitbhayani.me/notes/programming-outcomes-are-harder-to-ignore-with-agents): Programming was always about outcomes. Agents just made that harder to ignore. - [Premature Optimization Adds Complexity, Reduces Readability](https://arpitbhayani.me/notes/premature-optimization-adds-complexity-reduces-readability): I have seen more systems struggling because of wrong code than slower ones. The fact remains, most engineers optimise too early. - [Go 1.26 just dropped :) and there's some interesting stuff](https://arpitbhayani.me/notes/go-126-just-dropped-and-theres-some-interesting-stuff): Go 1.26 just dropped :) and there's some interesting stuff in this release. Here are a few that you will certainly find useful. 1. `new` can now take an expr... - [In C, you can define two interesting macros - likely() and unlikely](https://arpitbhayani.me/notes/in-c-you-can-define-two-interesting-macros---likely-and-unlikely): In C, you can define two interesting macros - likely() and unlikely(). Here's what they would do and how they could make code performant... These macros woul... - [I do not remember shell commands :) and I needed](https://arpitbhayani.me/notes/i-do-not-remember-shell-commands-and-i-needed): I do not remember shell commands :) and I needed to kill a process running on port 21079. Instead of struggling to call and running a couple of commands, I b... - [Let me talk about something obvious but with a bit of quantification](https://arpitbhayani.me/notes/let-me-talk-about-something-obvious-but-with-a-bit-of-quantification): Let me talk about something obvious but with a bit of quantification... Theoretically, both arrays and linked lists take O(n) time to traverse, but here's wh... - [JavaScript runtime has an off-by-one bug :) I recently stumbled](https://arpitbhayani.me/notes/javascript-runtime-has-an-off-by-one-bug-i-recently-stumbled): JavaScript runtime has an off-by-one bug :) I recently stumbled upon a claude code issue where running ``` echo 348555896224571969 ``` actually executes in B... - [One coding project that I recommend every engineer build at](https://arpitbhayani.me/notes/one-coding-project-that-i-recommend-every-engineer-build-at): One coding project that I recommend every engineer build at least once is to write your own JSON parser that converts the given string into a language-native... - [Don't sacrifice code clarity for marginal gains](https://arpitbhayani.me/notes/dont-sacrifice-code-clarity-for-marginal-gains): Don't sacrifice code clarity for marginal gains. 50 lines of highly complex code that's hard to understand and maintain, providing 5% improvement, should nev... - [DNS is perhaps the largest eventually consistent system in the world](https://arpitbhayani.me/notes/dns-is-perhaps-the-largest-eventually-consistent-system-in-the-world): DNS is perhaps the largest eventually consistent system in the world. A single request travels through recursive resolvers, root servers, TLDs, and authorita... - [Exception handling is expensive, and it is 66x+ slower than](https://arpitbhayani.me/notes/exception-handling-is-expensive-and-it-is-66x-slower-than): Exception handling is expensive, and it is 66x+ slower than compared to regular function call 🤯 I was digging deeper into the JVM to understand the cost of t... - [I love the way Golang makes us handle errors](https://arpitbhayani.me/notes/i-love-the-way-golang-makes-us-handle-errors): I love the way Golang makes us handle errors. Instead of raising and throwing exceptions, like many other programming languages, Go treats errors as first-cl... - [When In Doubt, Code It Out](https://arpitbhayani.me/notes/when-in-doubt-code-it-out): Prototypes are not only great for learning concepts better, but they are also great for doing highly reliable project estimations. Here's how ... - [Abstraction is a fundamental principle in software engineering, but premature](https://arpitbhayani.me/notes/abstraction-is-a-fundamental-principle-in-software-engineering-but-premature): Abstraction is a fundamental principle in software engineering, but premature abstraction does more harm than good ⚡ Premature abstraction occurs when we cre... - [Unpopular opinion: Abstraction kills productivity and readability ⚡](https://arpitbhayani.me/notes/unpopular-opinion-abstraction-kills-productivity-and-readability): Unpopular opinion: Abstraction kills productivity and readability ⚡ Although code abstraction and dependency injection are good and I understand their import... - [I always wondered how we could build our own File](https://arpitbhayani.me/notes/i-always-wondered-how-we-could-build-our-own-file): I always wondered how we could build our own File System and today I have started building one ⚡ I stumbled upon an interesting optimization in one of the en... - [Four coding habits that make you a 10x ⚡](https://arpitbhayani.me/notes/four-coding-habits-that-make-you-a-10x): Four coding habits that make you a 10x ⚡ - writing clean code - documenting your code - periodically refactoring your code, and - writing unit and integratio... - [Comments make the code easier to read, but most engineers](https://arpitbhayani.me/notes/comments-make-the-code-easier-to-read-but-most-engineers): Comments make the code easier to read, but most engineers write very obvious comments like Ex: the function \"fetch_url\" - fetches the URL 🤦‍♂️ Here are a f... - [Spent the afternoon revising the paper on the Isolation Forest](https://arpitbhayani.me/notes/spent-the-afternoon-revising-the-paper-on-the-isolation-forest): Spent the afternoon revising the paper on the Isolation Forest algorithm for anomaly detection ⚡ The paper explores the use of decision trees to detect anoma... - [Lot of engineers comment on pull requests to impose superiority 🤦‍♂️](https://arpitbhayani.me/notes/lot-of-engineers-comment-on-pull-requests-to-impose-superiority): Lot of engineers comment on pull requests to impose superiority 🤦‍♂️ a comment on a PR should always - be actionable - be constructive - enhance the implemen... - [If you want to learn low-latency and high-performance programming, here's](https://arpitbhayani.me/notes/if-you-want-to-learn-low-latency-and-high-performance-programming-heres): If you want to learn low-latency and high-performance programming, here's what you should do to get started 👇‍ 1. pick a language that offers low-level primi... ### Videos - [How Google Manages Billions of Lines of Code in a Single Monorepo](https://arpitbhayani.me/videos/google-monorepo-billions-lines-of-code): Explore Google's unique monorepo strategy, which houses billions of lines of code in a single repository, and understand the custom tooling and cultural practices that enable this massive scale. This deep dive covers their trunk-based development, custom file systems like Sits, and how they overcome challenges like diamond dependencies, offering insights into managing enormous codebases effectively. ## Systems Internals ### Blogs - [What are Blocking Queues and Why We Need Them](https://arpitbhayani.me/blogs/blocking-queues): Concurrent programming is one of the most interesting and challenging aspects of software engineering. When multiple goroutines need to share data, coordinating access becomes critical. - [Why gRPC Uses HTTP2](https://arpitbhayani.me/blogs/grpc-http2): When Google introduced gRPC in 2015, one of the most significant architectural decisions was building it on top of HTTP/2 rather than the widely adopted HTTP/1.1. This was just about following some trend, but a deliberate choice that fundamentally shapes how gRPC performs and behaves. - [Why and How Cache Locality Can Make Your Code Faster](https://arpitbhayani.me/blogs/cpu-cache-locality): While we write code thinking about algorithms and data structures, the CPU is quietly making millions of decisions about what data to keep close and what to evict from its precious cache memory. - [Why does DNS use both UDP and TCP](https://arpitbhayani.me/blogs/dns-udp-tcp): DNS is one of the most critical pieces of internet infrastructure, quietly translating human-readable domain names into IP addresses billions of times per day. - [Paper Notes - On-demand Container Loading in AWS Lambda](https://arpitbhayani.me/blogs/on-demand-container-loading-in-aws-lambda): Explore AWS Lambda's efficient scaling - block-level loading, deduplication with encryption, & erasure coding for low-latency container startups. - [Paper Notes - NanoLog - A Nanosecond Scale Logging System](https://arpitbhayani.me/blogs/nanolog-a-nanosecond-scale-logging-system): Explore NanoLog's high-performance logging - compile-time optimization, lock-free buffers, and lightweight encoding for nanosecond speed. - [Fork Bomb](https://arpitbhayani.me/blogs/fork-bomb): Online Coding Platforms and Code Evaluators are susceptible to this attack as they accept raw code from the user and execute it. So, if you are building one, do ensure you are protected against it and infinite loops. - [Python Internals - Exploring Chained Comparison Operators](https://arpitbhayani.me/blogs/chained-operators-python): Explore Python's chained comparisons (like a < b < c) and short-circuiting. Learn how they work under the hood and how to modify CPython! - [I Changed the Rules for the Python's Walrus Operator](https://arpitbhayani.me/blogs/the-weird-walrus): Explore Python's walrus operator ( -=) and its quirks! Learn why `a -= 10` throws an error and how to modify CPython to allow it. - [Constant Folding in Python](https://arpitbhayani.me/blogs/constant-folding-python): Explore Python's constant folding - how it optimizes code by evaluating expressions at compile time. Dive into CPython's elegant implementation. - [How Python Uses String Interning to Keep Runtime Efficient](https://arpitbhayani.me/blogs/string-interning-python): Explore Python's string interning - a compiler optimization for performance. Learn how CPython uses it to boost speed and reduce memory use. - [Visualizing Recursion in Python with Just a Decorator](https://arpitbhayani.me/blogs/recursion-visualizer-python): Visualize recursion in Python! Learn to build a simple recursion tree visualizer using decorators and the recviz package. - [Making Integers Iterable in Python](https://arpitbhayani.me/blogs/python-iterable-integers): Dive into Python internals - Modify CPython to make integers iterable! Explore iterators, protocols, and why it's a bad idea. - [Structure Composition and Emulating Inheritance in C](https://arpitbhayani.me/blogs/inheritance-c): Emulate inheritance in C using structure composition! Learn how it enables code extensibility, powering Linux Kernel & Python. - [How Python Handles Integers Under the Hood](https://arpitbhayani.me/blogs/python-caches-integers): Dive into Python's integer implementation! Explore how singletons and reference counting optimize performance for small integers. - [Modeling Finite State Machines with Python Coroutines](https://arpitbhayani.me/blogs/fsm-python): Explore Finite State Machines (FSM) with Python coroutines. Learn to model FSMs for regex, divisibility, & SQL validation. - [Python Prompt Strings](https://arpitbhayani.me/blogs/python-prompts): Customize your Python interactive shell prompt! Learn how to personalize and format your `>>>` and `...` prompts. - [Python's Missing Feature - Function Overloading](https://arpitbhayani.me/blogs/function-overloading): Explore function overloading in Python! Learn how to implement it using decorators and namespaces, despite Python's limitations. - [How Python Handles Gigantic Integers](https://arpitbhayani.me/blogs/long-integers-python): Explore Python's arbitrary-precision integers! Learn how it handles large numbers internally, from storage to operations like addition. - [Python Internals - I Made Addition Unpredictable](https://arpitbhayani.me/blogs/i-changed-my-python): Explore Python internals by tweaking its source code! Learn how I made addition unpredictable and the challenges I faced. - [HTTP - The Hard Way with Netcat](https://arpitbhayani.me/blogs/making-http-requests-using-netcat): Explore HTTP messages by building a simple Python webserver and interacting with it using Netcat. See requests in action! ### Notes - [Preventing PostgreSQL database-wide recoveries using strict Linux overcommit](https://arpitbhayani.me/notes/preventing-postgresql-database-wide-recoveries-using-strict-linux-overcommit): Interestingly, an out-of-memory error is not the worst-case failure, but often the best-case failure... let me explain... - [Hidden Systemd Units In Base Images Can Crash Kubernetes Training Jobs](https://arpitbhayani.me/notes/hidden-systemd-units-in-base-images-can-crash-kubernetes-training-jobs): Fun fact: Pinterest spent three months chasing a network bug that turned out to be caused by a container they were not even using. - [Huge Pages Optimize Postgres Shared Buffers by Improving TLB Efficiency](https://arpitbhayani.me/notes/huge-pages-optimize-postgres-shared-buffers-by-improving-tlb-efficiency): Here's something interesting... Postgres's sharedbuffers cache gets more expensive with every connection you open, and it is because of how the OS manages memory pages... - [Loop unrolling is one of those compiler tricks that feels](https://arpitbhayani.me/notes/loop-unrolling-is-one-of-those-compiler-tricks-that-feels): Loop unrolling is one of those compiler tricks that feels like it should not work, but it does :) It is also super easy to implement. The idea is simple: ins... - [Here's something very fundamental to how memory works in operating](https://arpitbhayani.me/notes/heres-something-very-fundamental-to-how-memory-works-in-operating): Here's something very fundamental to how memory works in operating systems, but most forget it over time. A quick reminder - when you call `malloc()`, you ar... - [Anthropic spun up 16 Opus 4](https://arpitbhayani.me/notes/anthropic-spun-up-16-opus-4): Anthropic spun up 16 Opus 4.6 agents to build a Rust-based C compiler from scratch - and the compiler they produced was able to compile the Linux kernel 🤯 Al... - [Here is something interesting about memory management in Linux: most](https://arpitbhayani.me/notes/here-is-something-interesting-about-memory-management-in-linux-most): Here is something interesting about memory management in Linux: most systems use 4KB pages by default. But, there is something called Transparent Huge Pages ... - [SQLite has about 155,800 lines of code, and its test](https://arpitbhayani.me/notes/sqlite-has-about-155800-lines-of-code-and-its-test): SQLite has about 155,800 lines of code, and its test suite has roughly 92 million lines. That is ~590x more test code than actual code 🤯 This is the level of... - [Meta open-sourced Pyrefly, a Python type-checker and language server, and](https://arpitbhayani.me/notes/meta-open-sourced-pyrefly-a-python-type-checker-and-language-server-and): Meta open-sourced Pyrefly, a Python type-checker and language server, and I gave it a spin in one of my side projects; tbh, it is pretty neat and fast. The P... - [Zero-copy writes make Kafka fast, but how exactly](https://arpitbhayani.me/notes/zero-copy-writes-make-kafka-fast-but-how-exactly-2): Zero-copy writes make Kafka fast, but how exactly? Kafka accepts messages from the network and writes to the disk, and vice versa. The traditional way of mov... - [Python supports really long integers, practically infinite, but when it](https://arpitbhayani.me/notes/python-supports-really-long-integers-practically-infinite-but-when-it): Python supports really long integers, practically infinite, but when it comes to adding two such long integers, what Python does is something really fascinat... - [Golang is adding a new Garbage Collector called Green Tea in 1](https://arpitbhayani.me/notes/golang-is-adding-a-new-garbage-collector-called-green-tea-in-1): Golang is adding a new Garbage Collector called Green Tea in 1.25 (opt-in), and it could slash GC overhead by up to 50% 🤯 The current garbage collector in Go... - [While trying to understand and optimize a nuance in Redis/Valkey,](https://arpitbhayani.me/notes/while-trying-to-understand-and-optimize-a-nuance-in-redisvalkey): While trying to understand and optimize a nuance in Redis/Valkey, I stumbled upon something super interesting - Transparent Hugepages. I had no idea what the... - [What does a Process look like in Linux Kernel source code](https://arpitbhayani.me/notes/what-does-a-process-look-like-in-linux-kernel-source-code): What does a Process look like in Linux Kernel source code? While preparing for my next video, I got curious about how the process is represented in the Linux... - [Go is quite memory efficient, and escape analysis is what](https://arpitbhayani.me/notes/go-is-quite-memory-efficient-and-escape-analysis-is-what): Go is quite memory efficient, and escape analysis is what keeps it efficient. Go uses a compiler optimization called escape analysis which helps optimize mem... - [Python supports extremely long integers; so how does it implement](https://arpitbhayani.me/notes/python-supports-extremely-long-integers-so-how-does-it-implement): Python supports extremely long integers; so how does it implement the multiplication of two really long integers? CPython uses a divide-and-conquer algorithm... - [The addition of two numbers in Python is fascinating ⚡](https://arpitbhayani.me/notes/the-addition-of-two-numbers-in-python-is-fascinating): The addition of two numbers in Python is fascinating ⚡ Python literally does what we are taught in school. Go digit by digit and maintain a carry. But, inste... - [Go is quite memory efficient; here's the secret sauce ⚡](https://arpitbhayani.me/notes/go-is-quite-memory-efficient-heres-the-secret-sauce): Go is quite memory efficient; here's the secret sauce ⚡ Go uses a compiler optimization called escape analysis which helps optimize memory usage. The key ide... - [Go 1.22 was released yesterday, and it finally included the](https://arpitbhayani.me/notes/go-122-was-released-yesterday-and-it-finally-included-the): Go 1.22 was released yesterday, and it finally included the feature that I always wanted it to have ⚡ It always felt weird to write the regular for loops in ... - [Google created the Snappy Compression Algorithm that trades off better](https://arpitbhayani.me/notes/google-created-the-snappy-compression-algorithm-that-trades-off-better): Google created the Snappy Compression Algorithm that trades off better compression for speed ⚡ and here's how it works ... Phase 1: Dictionary Creation Befor... - [malloc is not the only way to allocate memory ⚡](https://arpitbhayani.me/notes/malloc-is-not-the-only-way-to-allocate-memory): malloc is not the only way to allocate memory ⚡ The actual memory allocation and deallocation happen with `brk`, `sbrk`, and `mmap` system calls and malloc i... - [As compared to the other runtimes, Go is quite memory](https://arpitbhayani.me/notes/as-compared-to-the-other-runtimes-go-is-quite-memory): As compared to the other runtimes, Go is quite memory efficient; here's the secret sauce ⚡ Go uses a compiler optimization called escape analysis which helps... - [Here's an interesting fact about Python Dictionaries ⚡](https://arpitbhayani.me/notes/heres-an-interesting-fact-about-python-dictionaries): Here's an interesting fact about Python Dictionaries ⚡ Python Dictionaries maintain the insertion order of the keys. This means when you iterate over the key... - [I was always fascinated by virtual memory management, hence decided](https://arpitbhayani.me/notes/i-was-always-fascinated-by-virtual-memory-management-hence-decided): I was always fascinated by virtual memory management, hence decided to do a deep dive ⚡ I loved the concept because it allows processes to access more memory... - [Spent yesterday evening reading about and implementing Snappy Compression Algorithm](https://arpitbhayani.me/notes/spent-yesterday-evening-reading-about-and-implementing-snappy-compression-algorithm): Spent yesterday evening reading about and implementing Snappy Compression Algorithm and it is lit ⚡ and here's how it works ... Phase 1: Dictionary Creation ... - [Why did the college want us to study Compiler Construction?](https://arpitbhayani.me/notes/why-did-the-college-want-us-to-study-compiler-construction): Why did the college want us to study Compiler Construction? Do we really need it in our regular work? 🤔 Here's how I used a compiler optimization technique t... ### Videos - [How Redis Implements Strings: A Deep Dive into SDS and Encoding](https://arpitbhayani.me/videos/redis-string-implementation-sds-encodings): Explore Redis's highly optimized string implementation, Simple Dynamic Strings (SDS), and its dynamic encoding strategies. Learn how Redis efficiently stores short strings (EMB_STR), large binary data (RAW), and integers (INT) by leveraging custom data structures and memory allocation techniques, ensuring O(1) length access, efficient appends, and binary safety. - [How Redis Powers Geospatial Queries with the GeoHash Algorithm](https://arpitbhayani.me/videos/redis-geospatial-queries-geohash-algorithm): This article explores how Redis efficiently handles geospatial queries by leveraging the GeoHash algorithm. It explains the transformation of 2D latitude-longitude coordinates into a single 64-bit integer, enabling fast proximity searches through prefix matching and bit interleaving, and delves into Redis's internal implementation details. - [How Redis Implements LFU Eviction Using Morris Counter](https://arpitbhayani.me/videos/redis-lfu-morris-counter-implementation): Explore Redis's highly optimized Least Frequently Used (LFU) eviction strategy. This article details how Redis reuses 24 bits to combine a 16-bit Last Decrement Time for temporal decay with an 8-bit probabilistic Morris Counter for approximate frequency tracking, ensuring memory efficiency and effective key eviction. - [How Redis Implements Memory-Efficient Sets with Intset](https://arpitbhayani.me/videos/how-redis-implements-memory-efficient-sets-with-intset): Redis employs a clever dual-implementation strategy for sets: using a hash table for generic elements and a highly optimized Intset for integer-only sets. This document explores Intset's internal sorted array structure, its dynamic encoding upgrades for memory efficiency, and the trade-offs involved in its O(log N) search and O(N) insertion/deletion operations, highlighting Redis's frugal approach to memory management. - [How Redis Internally Implements Memory Efficient Lists: Ziplist and Quicklist](https://arpitbhayani.me/videos/redis-list-implementation-ziplist-quicklist): Redis, an in-memory database, employs highly optimized data structures to manage lists efficiently. This article delves into Ziplist, a contiguous memory block for small lists, and Quicklist, a doubly linked list of Ziplists, explaining how they overcome the memory and CPU cache inefficiencies of traditional linked lists through clever encoding and memory layout optimizations. - [How and Why Redis Overrides Malloc: Deep Dive into jemalloc and tcmalloc](https://arpitbhayani.me/videos/redis-overrides-malloc-jemalloc-tcmalloc-internals): Redis, an in-memory database, overrides the default `malloc` with specialized allocators like `jemalloc` or `tcmalloc` to achieve peak performance. This deep dive explains the limitations of standard `malloc`, such as memory fragmentation and inefficient OS page management, and details how custom allocators enhance memory utilization, concurrency, and overall efficiency for Redis's demanding workloads. - [How Redis Caps Its Memory Usage: A Deep Dive into Redis Internals](https://arpitbhayani.me/videos/redis-memory-capping-internals): Redis manages its memory by wrapping standard allocation functions with `zmalloc`, which maintains an atomic counter of all allocated memory. This `used_memory` counter is then utilized by the eviction module (`evict.c`) to enforce configured `maxmemory` limits, triggering key evictions when necessary to maintain performance and stability. This design separates memory tracking from policy enforcement, offering granular control and graceful handling of memory pressure. - [Implementing Redis's Approximated LRU Algorithm: A Go Deep Dive](https://arpitbhayani.me/videos/implementing-redis-approximated-lru-algorithm-go-deep-dive): This article explores the implementation of Redis's approximated LRU eviction algorithm, drawing inspiration from the Redis C source code. It details the eviction pool mechanism, the 24-bit clock resolution for idle time calculation, and Redis's unique dual-dictionary structure. The piece culminates in a practical Go implementation, highlighting key design choices and trade-offs. - [Redis's Approximated LRU Algorithm: Deep Dive into Memory-Efficient Eviction](https://arpitbhayani.me/videos/redis-approximated-lru-algorithm-memory-efficient-eviction): This article explores Redis's highly optimized, approximated Least Recently Used (LRU) eviction algorithm. It dissects the inefficiencies of naive LRU implementations, then dives into Redis's innovative solutions, including a 24-bit LRU clock for memory savings, a clever idle time calculation to handle clock wrap-around, and a sampling-based eviction pool for efficient candidate selection. The discussion highlights Redis's trade-offs, prioritizing memory efficiency and practical approximation over theoretical O(1) complexity. - [Implementing All Keys Random Eviction and INFO Command in Redis Internals](https://arpitbhayani.me/videos/implementing-all-keys-random-eviction-and-info-command-redis-internals): This article delves into the implementation of the 'All Keys Random' eviction strategy and the 'INFO' command for database statistics within a custom Redis-compliant database. It explains how to track key counts, visualize eviction patterns using Prometheus and Grafana, and highlights the benefits of building Redis-compliant systems for leveraging existing tooling. - [Redis Internals: Understanding Objects, Encodings, and INCR Command Implementation](https://arpitbhayani.me/videos/redis-internals-objects-encodings-incr-command): Explore the core of Redis's object model, detailing how values are encapsulated within a `redisObject` structure. This document explains the critical roles of 'types' and 'encodings' in defining data representation and implementation, showcasing how Redis optimizes memory with bit fields and handles operations like `INCR` by dynamically converting between string and integer representations. Learn about the design decisions that make Redis highly extensible and efficient. - [Implementing Command Pipelining in Redis: A Deep Dive into Internals](https://arpitbhayani.me/videos/implementing-command-pipelining-redis-internals): Redis command pipelining significantly boosts throughput by sending multiple commands in a single network round trip, reducing latency overhead. This deep dive explores its core mechanics, demonstrating how to implement it by modifying a Redis clone to read concatenated commands, buffer individual responses, and send them back as a single, multiplexed reply. While enhancing performance, it's crucial to consider the increased memory consumption on the server side due to response buffering. - [Redis Key Eviction Strategies and Approximated Implementations](https://arpitbhayani.me/videos/redis-key-eviction-strategies-approximated-implementations): Redis, an in-memory data store, relies on robust eviction strategies to manage limited RAM and prevent Out-Of-Memory errors. This article explores various Redis eviction policies, including LRU, LFU, and random, delving into their approximated implementations like sampling for LRU and the Morris Counter for LFU, which prioritize space efficiency. We also walk through a simplified "first eviction" strategy to understand the core logic. - [Implementing DEL, EXPIRE, and Auto-Cleanup in Redis Internals](https://arpitbhayani.me/videos/implementing-del-expire-auto-cleanup-redis-internals): This article dives into the internal implementation of Redis's DEL and EXPIRE commands, along with its sophisticated auto-deletion mechanisms. It explains how Redis, despite being single-threaded, efficiently manages key expiration through both passive (lazy) deletion upon access and an active, probabilistic sampling algorithm to clean up unaccessed expired keys, ensuring memory efficiency without performance bottlenecks. - [Implementing Redis GET, SET, and TTL Commands with Expiry Logic](https://arpitbhayani.me/videos/implementing-redis-get-set-ttl-commands-expiry-logic): This article dives into the implementation of core Redis commands: GET, SET, and TTL, within a custom Redis-like server. It explores how to handle key-value storage, manage time-to-live (TTL) for keys, and correctly respond to various client requests, including expired and non-existent keys. We'll examine the internal data structures and logic required to replicate Redis's behavior for these fundamental operations. - [Implementing Asynchronous I/O with Epoll for a Concurrent Redis Server](https://arpitbhayani.me/videos/implementing-asynchronous-io-epoll-concurrent-redis-server): This article details the transformation of a blocking, single-client TCP server into a highly concurrent, single-threaded asynchronous server using event loops and Linux's `epoll` system calls. It explains the core concepts of I/O multiplexing, raw socket programming, and how to efficiently manage multiple client connections, achieving performance comparable to Redis for simple operations. Readers will gain a deep understanding of low-level networking and system call interactions. - [Event Loops Internals: How Redis Handles Concurrent Connections on a Single Thread](https://arpitbhayani.me/videos/event-loops-internals-redis-concurrent-connections): This article dives into the internals of event loops and asynchronous I/O, explaining how single-threaded applications like Redis efficiently manage thousands of concurrent client connections without resorting to complex multi-threading. It contrasts this approach with traditional multi-threaded servers, highlighting the challenges of thread safety and resource contention, and then details the kernel-level mechanisms like `epoll` that power modern asynchronous systems. - [Implementing Redis' PING Command: A Deep Dive into RESP and Server Internals](https://arpitbhayani.me/videos/implementing-redis-ping-command-redis-internals): This article explores the implementation of Redis' fundamental PING command in Go, dissecting the Redis Serialization Protocol (RESP) for both decoding client commands and encoding server responses. It covers handling various PING arguments, error conditions, and demonstrates how to leverage Redis' own benchmarking tools to validate and compare the custom server's performance against the official Redis server. - [Implementing the Redis Serialization Protocol (RESP) Decoder in Go](https://arpitbhayani.me/videos/implementing-redis-serialization-protocol-resp-decoder-go): This article details a GoLang implementation of the Redis Serialization Protocol (RESP) decoder, explaining how to parse various RESP data types like simple strings, errors, integers, bulk strings, and arrays. It highlights a modular `decodeOne` function that returns the number of bytes processed, a crucial design choice for robustly handling complex and nested data structures, ensuring an extensible and readable decoder. - [The Fundamentals of Wire Protocols and Redis Serialization Protocol (RESP)](https://arpitbhayani.me/videos/the-fundamentals-of-wire-protocols-and-redis-serialization-protocol-resp): This article explores the necessity of wire protocols in distributed systems, using Redis Serialization Protocol (RESP) as a prime example. It details RESP's design principles, including its simple, human-readable format, efficient parsing mechanisms, and support for various data types like simple strings, bulk strings, integers, and arrays. Understanding RESP reveals how Redis achieves its high performance and reliability through a carefully crafted communication protocol. - [Low-Level Design and Data Schema Modeling of API Clients like Requestly](https://arpitbhayani.me/videos/low-level-design-data-schema-modeling-api-clients-requestly): This document explores the low-level design and data schema modeling for building a full-fledged API client like Requestly. It covers core features such as variable interpolation, request chaining, collection runners, and test assertion frameworks, detailing their implementation considerations and database schemas. The discussion highlights the complexity involved in creating a robust API development and testing tool. - [Optimizing Database Memory Usage: When `malloc` Becomes a Bottleneck](https://arpitbhayani.me/videos/optimizing-database-memory-usage-when-malloc-becomes-a-bottleneck): Explore how default memory allocators like `glibc malloc` can lead to significant memory fragmentation and lock contention in high-concurrency database environments like MySQL. This article delves into `tcmalloc`'s multi-threaded architecture and presents a practical scenario demonstrating how switching allocators can dramatically reduce RSS usage and improve performance. - [Essential C Projects for Every Engineer: Understanding System Internals and I/O](https://arpitbhayani.me/videos/essential-c-projects-system-internals-io): Mastering C is crucial for understanding how software interacts with the operating system. This article outlines two foundational projects—building a custom shell and a file-based word dictionary—that provide deep insights into system calls, process management, and the nuances of file I/O, empowering engineers to build more robust and efficient systems. - [The CrowdStrike Outage: Unpacking the Kernel Mode Root Cause and Misplaced Blame](https://arpitbhayani.me/videos/crowdstrike-outage-kernel-mode-root-cause): The recent CrowdStrike outage, affecting millions of Windows devices, was not a cyberattack but a critical software bug in a CrowdStrike update. This article delves into how a kernel-mode logic error led to invalid memory access and system crashes, highlighting the inherent risks of low-level software and the importance of understanding responsibility when third-party applications operate with deep system privileges. - [Understanding TCP TIME_WAIT and Resolving "Address Already in Use" Errors](https://arpitbhayani.me/videos/tcp-time-wait-address-already-in-use): Restarting a network server often fails with an "address already in use" error even when no active process is bound to the port. This guide breaks down the TCP 4-way termination handshake, why the active closer enters the TIME_WAIT state, and how socket options like SO_REUSEADDR resolve port binding conflicts. - [Architecture and Internals of Blacksmith: Accelerating GitHub Actions with Hardware-First Optimization](https://arpitbhayani.me/videos/blacksmith-github-actions-internals-and-architecture): An architectural deep-dive into how Blacksmith runs GitHub Actions twice as fast at half the cost. Discover how selecting high-clock-rate gaming CPUs, locally attached NVMe storage, collocated caches, and AWS Firecracker microVMs flips standard cloud cost trade-offs on their head. - [How Converged Indexes Work: Inside Rockset's Search and Analytics Engine](https://arpitbhayani.me/videos/how-converged-indexes-work-rockset-internals): Explore how Rockset leverages Converged Indexing built on top of RocksDB Cloud to unify row, column, and inverted search indexes into a single key-value store. Learn how decomposing documents into lexicographically sorted key patterns enables sub-millisecond point lookups, analytical scans, and search queries without manual index management. - [Architecture Deep-Dive of a Real-Time Analytics Database: Rockset Internals](https://arpitbhayani.me/videos/rockset-internals-real-time-analytics-database-architecture): An architectural deep-dive into Rockset, a real-time search and analytics database designed for sub-second queries on semi-structured data. Learn how its Aggregator-Leaf-Tailer (ALT) architecture separates compute and storage while leveraging RocksDB-Cloud, distributed logs, and Amazon S3 for extreme scalability and durability. - [How PostgreSQL Generates All Query Execution Plans](https://arpitbhayani.me/videos/how-postgresql-generates-query-execution-plans): Explore the internal mechanics of PostgreSQL's query planner and how it systematically constructs candidate execution plans. Learn how the optimizer evaluates table scans, join algorithms, join orders, and query pushdowns before selecting the most cost-effective execution path. - [How PostgreSQL Parses Queries and Constructs the Parse Tree](https://arpitbhayani.me/videos/how-postgresql-parses-queries-parse-tree): An architectural deep dive into PostgreSQL's query parsing pipeline. Learn how the backend uses Flex and Bison to tokenize raw SQL, evaluate context-free grammars, and generate the Abstract Syntax Tree (AST) that powers query execution. - [PostgreSQL Connection Management: The Process-per-Client Model Deep Dive](https://arpitbhayani.me/videos/postgresql-connection-management-process-per-client): An architectural deep dive into PostgreSQL's process-per-client model, exploring how the Postmaster supervisor process forks backend processes to service client connections. Learn how Unix file descriptor inheritance passes sockets to children, how shared memory facilitates cross-process communication, and why connection poolers like PgBouncer are essential. - [Understanding Database Trade-offs: The RUM Conjecture Explained](https://arpitbhayani.me/videos/understanding-database-trade-offs-rum-conjecture): The RUM Conjecture establishes that database access methods cannot simultaneously optimize for Read times, Update costs, and Memory overheads. By understanding how B-Trees, LSM-Trees, sparse indexes, and adaptive data structures navigate this trade-off triangle, engineers can make informed database design and architectural decisions. - [Why Thread Pools Exist and How to Implement Them](https://arpitbhayani.me/videos/why-thread-pools-exist-and-how-to-implement-them): Spawning an unbounded number of threads per request leads to memory exhaustion and severe context-switching overhead. Thread pools solve this by capping concurrent workers, stabilizing resource utilization, and delegating incoming tasks through a synchronized work queue. This guide explores the architecture, sizing trade-offs, and implementation mechanics of thread pools. - [Variable-Length Integer (Varint) Encoding: How Databases Optimize Storage and Transmission](https://arpitbhayani.me/videos/varint-encoding-database-integer-compression): Learn how databases and serialization protocols like Redis, RocksDB, and Protobuf use variable-length integer (varint) encoding to drastically reduce storage and network overhead. This guide explains continuation-bit encoding, step-by-step serialization and deserialization, and the CPU vs. I/O trade-offs involved. - [How Pass by Value vs Pass by Pointer Works Internally: An Assembly Deep Dive](https://arpitbhayani.me/videos/pass-by-value-vs-pass-by-pointer-assembly-internals): Examine the low-level machine mechanics behind pass by value versus pass by pointer in Go. Through micro-benchmarking and disassembly analysis, discover how x86 assembly instructions like REP MOVSQ copy memory directly onto the stack and why pass by pointer operates in constant time. - [Understanding the Read Uncommitted Isolation Level: Mechanics, Anomalies, and Trade-offs](https://arpitbhayani.me/videos/read-uncommitted-isolation-level-mechanics-anomalies-trade-offs): An in-depth technical analysis of the Read Uncommitted transaction isolation level in relational databases. Learn how it works under the hood via non-locking reads, the concurrency anomalies it permits (dirty reads, phantom reads, and non-repeatable reads), and the rare scenarios where its relaxed constraints make sense. - [Disabling Python Garbage Collection at Scale: How Instagram Saved 10% Infrastructure Cost](https://arpitbhayani.me/videos/disabling-python-garbage-collection-instagram): A deep dive into how Instagram dismissed Python's cyclic garbage collector to reclaim 25% RAM per host and boost fleet throughput by 10%. Learn how Copy-on-Write (COW), CPython reference counting, Linux page faults, and worker lifecycle management interact under high-scale multi-process workloads. - [Navigating Massive Codebases: A First-Principles Guide to Reading and Understanding Complex Software](https://arpitbhayani.me/videos/navigating-massive-codebases-first-principles): Master the art of exploring, understanding, and modifying massive codebases from first principles. Learn tactical strategies for rapid navigation, including convention absorption, execution tracing, test-driven exploration, and structural graph analysis. - [Optimistic Locking: Internals, CAS Semantics, and CPU Hardware Support](https://arpitbhayani.me/videos/optimistic-locking-internals-cas): An in-depth exploration of optimistic concurrency control versus pessimistic locking, detailing Compare-And-Swap (CAS) semantics, conflict handling strategies, and how modern CPUs execute atomic lock-free operations via hardware instructions like CMPXCHG. - [Writing Deadlock-Free Code: Mechanics, Simulation, and Total Resource Ordering](https://arpitbhayani.me/videos/writing-deadlock-free-code): Deadlocks are a critical failure mode in multithreaded systems where threads form circular dependencies waiting on exclusive resources. This guide explores the anatomy of deadlocks, demonstrates how out-of-order lock acquisition halts execution, and explains how enforcing a strict global total ordering eliminates circular waits to guarantee deadlock-free code. - [Designing and Implementing a Concurrent Thread-Safe Queue from Scratch](https://arpitbhayani.me/videos/concurrent-thread-safe-queue-from-scratch): Explore why naive queue implementations fail under multi-threaded workloads due to race conditions and non-atomic slice appends. Learn how to design an idiomatic, thread-safe queue from scratch using pessimistic locking in Go, while balancing correctness and synchronization overhead. - [Hacking CPython: Adding a Custom 'nuke' Statement to the Python Language](https://arpitbhayani.me/videos/hacking-cpython-adding-custom-nuke-statement): Learn how to navigate and modify massive codebases like CPython by adding a brand new keyword statement from scratch. Follow a first-principles depth-first search approach across Python's PEG grammar, AST definitions, compiler, and runtime to implement an abrupt termination keyword. - [Understanding Pessimistic Locking and Mutexes in Concurrent Programming](https://arpitbhayani.me/videos/understanding-pessimistic-locking-with-mutex): Explore why standard operations like count++ fail in concurrent environments and how pessimistic locking solves race conditions. Learn the mechanics of mutual exclusion (mutexes) in Go and discover key performance trade-offs when designing critical sections. - [Hacking CPython: Modifying the Internal Print Function to Inspect Object Metadata](https://arpitbhayani.me/videos/hacking-cpython-modifying-print-internals): A deep dive into CPython's C source code demonstrating how the builtin print function works under the hood. Learn how to navigate a massive codebase using docstring reverse-lookup, inspect PyObject headers, and modify the interpreter to expose runtime reference counts and type metadata. - [Why count++ Is Not Atomic: An Assembly and Micro-Operation Deep Dive](https://arpitbhayani.me/videos/why-count-plus-plus-is-not-atomic-assembly-micro-operations): A deep dive into why a single statement like count++ leads to race conditions in multithreaded programs. By analyzing GCC assembly output and hardware micro-operations, this article explains how seemingly single instructions decompose into non-atomic read-modify-write CPU sequences. - [Navigating Massive Open Source Codebases: Making Your First Change in CPython](https://arpitbhayani.me/videos/navigating-massive-open-source-codebases-cpython-first-change): Learn a systematic approach to explore, build, and modify massive open source codebases using CPython as a practical case study. Discover how to locate the entry point across different operating systems, trace execution paths, and compile a custom Python binary. - [Building a Multi-Threaded TCP Server from Scratch: Socket Programming & Concurrency Internals](https://arpitbhayani.me/videos/building-multithreaded-tcp-server-from-scratch): Understand how web servers handle concurrent TCP connections by building a TCP server from scratch using raw sockets. Explore the blocking nature of system calls like listen, accept, read, and write, and see why multi-threading and thread pooling are essential for high-throughput networking. - [Understanding Endianness: Little-Endian vs. Big-Endian in Systems and Serialization](https://arpitbhayani.me/videos/understanding-endianness-little-vs-big-endian): Explore the fundamentals of endianness, how CPU architectures store multi-byte data in memory, and the risks of byte-order misinterpretation across networks and storage. Learn standard mitigation strategies including protocol handshakes, strict format specifications, and Byte Order Marks (BOM). - [Writing Efficient and Fair Multi-Threaded Programs](https://arpitbhayani.me/videos/efficient-and-fair-multithreaded-programs): Simply adding threads to a program does not guarantee optimal performance if the workload is unevenly distributed across workers. Discover how to build concurrent programs that achieve both correctness and fairness by transitioning from static range partitioning to dynamic, atomic task distribution. - [Why Databases Store Data in B+ Trees: From Naive Disk Storage to Indexed Pages](https://arpitbhayani.me/videos/why-databases-store-data-in-b-plus-trees): Explore the architectural evolution of database storage engines from naive flat-file implementations to B+ trees. Understand how hardware constraints like disk block sizes dictate page layout, why point and range queries thrive on leaf chaining, and how both SQL and NoSQL engines serialize data on disk. - [Building a Simple Synchronous TCP Echo Server: Foundations of Redis Internals](https://arpitbhayani.me/videos/building-simple-tcp-echo-server-redis-internals): Learn how to build a bare-metal synchronous TCP echo server in Go without external dependencies as Step 0 of building a custom Redis clone. Explore socket programming, the blocking I/O execution model, connection concurrency limitations, and inspect the Redis Serialization Protocol (RESP) using redis-cli. - [Deconstructing Redis Internals: Architecture, Event Loops, and Memory Mechanics](https://arpitbhayani.me/videos/redis-internals-architecture-event-loops-and-memory-mechanics): An architectural exploration of Redis internals, detailing how a single-threaded database achieves ultra-high throughput. Learn the mechanics of I/O multiplexing, the RESP wire protocol, approximated LRU eviction, AOF persistence, and compact object encodings. - [Why and How Single-Threaded Redis Is Fast and Handles Concurrent Connections](https://arpitbhayani.me/videos/why-and-how-single-threaded-redis-is-fast): Redis processes tens of thousands of requests per second using a single thread without suffering from race conditions or lock contention. This deep dive breaks down the architecture behind Redis, comparing multi-threaded locking models against I/O multiplexing and the single-threaded event loop. - [Why Caching Fails to Speed Up Mark-and-Sweep Garbage Collection](https://arpitbhayani.me/videos/why-caching-does-not-speed-up-mark-and-sweep-gc): Caching is widely considered a universal performance booster, but its efficacy relies entirely on temporal and spatial locality. This deep dive explores why Mark-and-Sweep garbage collection breaks these fundamental access patterns and examines the edge cases where caching runtime metadata can still yield minor gains. - [Tricolor Abstraction: Foundations of Concurrent Garbage Collection](https://arpitbhayani.me/videos/tricolor-abstraction-concurrent-garbage-collection): Stop-the-world garbage collection pauses application execution to safely trace live memory graphs, creating severe latency bottlenecks. The tri-color abstraction—pioneered by Edsger Dijkstra and Leslie Lamport—partitions heap objects into white, gray, and black sets to preserve correctness while allowing tracing to run concurrently with application mutator threads. - [Mark and Sweep Garbage Collection: Architecture, Mechanics, and Optimizations](https://arpitbhayani.me/videos/mark-and-sweep-garbage-collection): An in-depth exploration of the classic Mark and Sweep garbage collection algorithm, contrasting indirect tracing collectors with direct reference counting. It covers allocator triggers, graph-based root reachability traversals, the sweep reclamation phase, and low-level optimizations like bit-meaning flipping to avoid memory write overhead. - [How to Pick a Garbage Collector: The Seven Core Trade-Offs](https://arpitbhayani.me/videos/how-to-pick-a-garbage-collector): Choosing an automatic garbage collector requires balancing fundamental trade-offs rather than searching for a universally superior algorithm. This guide breaks down the seven primary parameters—safety, throughput, completeness, pause time, space overhead, language optimizations, and scalability—to help engineers evaluate and tune the right GC for their specific workloads. - [Why Programming Languages Need Garbage Collection: Stack, Heap, and Memory Safety](https://arpitbhayani.me/videos/why-programming-languages-need-garbage-collection): Every executing program relies on memory management, dividing allocations between the stack and the heap. While the stack cleans up automatically, managing dynamic heap memory manually through explicit deallocation introduces catastrophic pitfalls like memory leaks and dangling pointers. Automatic garbage collection shifts memory reclamation to the language runtime, preventing silent data corruption and system crashes. - [Payloads in HTTP GET Requests: Myths, RFC Specs, and Practical Implementation](https://arpitbhayani.me/videos/payloads-in-http-get-requests): While software conventions discourage sending a request body in an HTTP GET request, the official HTTP/1.1 specification does not strictly forbid it. This article explores the RFC 7231 semantics, demonstrates GET payload handling in Python/Flask, and analyzes why systems like Elasticsearch historically accepted GET request bodies for complex queries. - [What are Embedded Databases and Why Do They Exist?](https://arpitbhayani.me/videos/what-are-embedded-databases): Discover the architecture and performance benefits of embedded databases like SQLite, LevelDB, and RocksDB. Learn how in-process storage engines eliminate network latency, power distributed systems, and handle extreme write and read workloads. - [Demystifying Write-Ahead Logging: Ensuring Database Reliability and High Performance](https://arpitbhayani.me/videos/demystifying-write-ahead-logging-database-reliability): Explore how Write-Ahead Logging (WAL) balances strict ACID durability with high write throughput in modern databases. Learn how sequential append-only logs, Log Sequence Numbers (LSNs), and CRC checksums enable crash recovery, point-in-time snapshots, and efficient disk I/O. - [How Database Indexes Minimize Disk I/O to Accelerate Read Performance](https://arpitbhayani.me/videos/how-database-indexes-work-disk-io): An intuitive, first-principles exploration of how database indexing drastically speeds up query reads by minimizing physical disk I/O operations. Through concrete storage and block-level calculations, this guide illustrates why an unindexed query triggers expensive full table scans and how index data structures optimize data retrieval. - [CPython Internals: How the 'is' and 'is not' Operators Are Implemented](https://arpitbhayani.me/videos/cpython-internals-how-is-operator-is-implemented): An architectural deep dive into how CPython implements the 'is' and 'is not' operators. Explore bytecode generation, stack evaluation in ceval.c, and how Python avoids CPU branch misprediction using an elegant branchless XOR trick. - [Under the Hood of Python's id() Function: CPython Internals and Pointer Semantics](https://arpitbhayani.me/videos/how-id-function-is-implemented-in-python): An in-depth exploration of CPython's id() function and how it maps object identities to raw memory addresses. Learn how id() is implemented in bltinmodule.c, why non-overlapping object lifetimes can share IDs, and how PyLong_FromVoidPtr converts pointers to Python integers. - [How Python Compares Float and Int Objects: A Deep Dive into CPython Internals](https://arpitbhayani.me/videos/how-python-compares-float-and-int-objects): Explore how CPython evaluates mixed-type comparisons like 10.0 == 10 under the hood. Learn how the rich comparison protocol avoids floating-point precision loss and handles arbitrary-precision integers in C source code. - [CPython Internals: How Python Optimizes and Caches Small Integers](https://arpitbhayani.me/videos/cpython-small-integer-optimization): An in-depth exploration of CPython's small integer caching mechanism, explaining how integers from -5 to 256 are pre-allocated as singletons to eliminate heap churn. We walk through the underlying C source code in longobject.c, index computation math, and interpreter initialization. - [How Python Implements Chained Comparison Operators](https://arpitbhayani.me/videos/how-python-implements-chained-comparison-operators): An under-the-hood exploration of how CPython implements chained comparison operators using bytecode manipulation. Learn how instructions like DUP_TOP, ROT_THREE, and JUMP_IF_FALSE_OR_POP enable mathematical evaluation semantics and automated short-circuiting on a stack machine. - [CPython Internals: String Interning and Dictionary Optimization](https://arpitbhayani.me/videos/cpython-string-interning-optimization): An architectural deep-dive into CPython's string interning mechanism based on a walkthrough of the CPython 3.10 codebase. Learn how Python optimizes string comparison and dictionary lookups using pointer equality, the internal dict-based global intern table, and compile-time identifier heuristics. - [Hacking CPython Grammar: Supporting Standalone Walrus Assignments](https://arpitbhayani.me/videos/cpython-grammar-standalone-walrus-operator): Explore CPython 3.8 internals by modifying the language grammar to support standalone walrus operator assignments. Learn how parsing rules, the LL(1) pgen grammar, and AST generation in ast.c handle assignment expressions. - [Building CPython from Source: Local Setup and Making Your First Code Change](https://arpitbhayani.me/videos/building-cpython-from-source-local-setup): Learn how to build CPython from source code on Unix-based systems using configure and make. This practical guide walks through setting up your local development environment, understanding the build pipeline, and making your first modification to Python's C entry point. - [The Honest Python: Deep Diving into CPython Internals](https://arpitbhayani.me/videos/honest-python-cpython-internals-introduction): An introduction to exploring Python runtime internals by reading, dissecting, and modifying the CPython source code. Learn how Python handles arbitrary-precision integers, high-performance data structures, garbage collection, and custom interpreter behaviors.