CAP theorem triangle showing consistency, availability, and partition tolerance

CAP Theorem Explained: Consistency vs Availability in Distributed Systems

The CAP theorem is one of the most important ideas in distributed systems because it explains why “just make it always correct and always online” is not a realistic requirement once multiple nodes and unreliable networks enter the picture. In simple terms, CAP says that when a network partition happens, a distributed system can prioritize either: Consistency Availability But not both at the same time. Partition tolerance is not a feature you casually add or remove. If your system runs across multiple machines, partitions are a fact of life, so the real design choice is usually CP vs AP. ...

March 9, 2026 · 4 min · Nitin
Stripe hosted checkout flow using webhook-first fulfillment and order status polling

Integrating Stripe Payment with Checkout Flow (Webhooks + Polling)

If you use a hosted payment page like Stripe Checkout, the safest architecture is: Create an internal order before redirecting. Redirect the user to the hosted checkout URL. Use webhooks as the source of truth for fulfillment. Let the frontend poll order status after return. This avoids race conditions and ensures users still get entitlements even if they close the tab before the success page loads. Why This Pattern Works Hosted checkout redirects are excellent for UX and compliance, but redirects are not guaranteed delivery signals. ...

March 3, 2026 · 2 min · Nitin
Migrating WordPress to Hugo with Cloudflare Pages

How to Migrate WordPress to Hugo with Decap CMS and Cloudflare Pages (Free Hosting)

Why Migrate from WordPress? WordPress is powerful, but for a technical blog that mostly serves static content, it comes with unnecessary overhead — hosting costs, plugin updates, security patches, and slower page loads. Static site generators like Hugo offer a simpler, faster, and cheaper alternative. Here’s what we migrated to: Hugo — blazing fast static site generator PaperMod — clean, minimal theme perfect for tech blogs Decap CMS — web-based content management with GitHub backend Cloudflare Pages — free hosting with global CDN Google AdSense — preserved auto ads from the WordPress site The result? A site that builds in under 1 second, costs $0/month to host, and is served from Cloudflare’s global edge network. ...

February 8, 2026 · 5 min · Nitin

Resolving CORS Errors When Fetching Images from AWS S3 with Signed URLs

If you’re displaying images stored in an AWS S3 private bucket using signed URLs, you might have encountered a confusing scenario: images display perfectly in your web pages but throw CORS errors when you try to download them using JavaScript’s fetch API. Let’s break down the issue and explore a practical solution. Understanding the Problem Imagine you have your images securely stored in a private S3 bucket, and you’re using pre-signed URLs to grant temporary access: ...

June 29, 2025 · 3 min · Nitin

Building Robust Systems: Key Lessons from Designing Data-Intensive Applications Chapter 1

Introduction If you’re involved in building software today, chances are you’re dealing with data. Lots of it. Maybe it’s user activity, sensor readings, financial transactions, or something else entirely. Martin Kleppmann’s phenomenal book, “Designing Data-Intensive Applications” (often called DDIA), is practically required reading for navigating this landscape. Let’s dive into some key takeaways from this essential chapter. The Shift: It’s About the Data, Not Just the CPU The chapter opens by highlighting a crucial distinction: many modern applications are data-intensive, not compute-intensive. While CPU power is abundant, the real challenges often lie in: ...

May 4, 2025 · 5 min · Nitin

WebRTC Signaling & Connection Establishment

What is Signaling in WebRTC, and Why is it Needed? WebRTC allows direct peer-to-peer (P2P) communication, but before two peers can connect, they need to exchange network and media information. This process is called signaling. Signaling is needed for: Exchanging session descriptions (SDP – Session Description Protocol) between peers. Sharing ICE candidates to determine the best network path. Handling NAT traversal by identifying public and private network addresses. Establishing data channels for text, files, and other non-media communication. WebRTC does not define a signaling protocol. Developers must implement their own using available technologies like WebSockets, WebRTC Data Channels, or existing protocols like SIP. ...

February 7, 2025 · 4 min · Nitin

WebRTC Fundamentals

WebRTC (Web Real-Time Communication) is an open-source project that enables real-time communication between browsers and devices using peer-to-peer connections. It allows audio, video, and data sharing without requiring additional plugins or external software. How Does WebRTC Work? WebRTC works by establishing a direct connection between two peers (browsers or applications) to transmit media (audio/video) and data. The connection process involves several steps: Media Capture – A user’s camera and microphone are accessed. Signaling – Exchanging connection details between peers via a signaling server (e.g., using WebSockets). ICE Candidate Discovery – Finding the best network path between peers. Connection Establishment – Securely connecting the peers. Data Transmission – Streaming audio/video or sending arbitrary data. 2. Main Components of WebRTC WebRTC consists of three primary components: ...

February 7, 2025 · 3 min · Nitin

Building ARM64 Docker Images on x86_64 Machines Using QEMU and Docker Buildx

Introduction In the world of software development, the ability to build and deploy applications across different architectures is invaluable. This capability becomes particularly essential when dealing with ARM-based applications such as those for embedded systems or newer ARM-based servers. In this blog post, we will explore how to build ARM64 Docker container images on an x86_64 machine using QEMU emulation and Docker’s buildx tool. Understanding the Challenge The main challenge in building Docker images for a different architecture than your host machine lies in the architecture-specific binaries and dependencies. Directly running ARM binaries on an x86_64 machine is not possible without emulation due to differences in architecture instruction sets. ...

May 11, 2024 · 4 min · Nitin

Streamlining Data Processing with Google Dataflow

Introduction In today’s data-driven landscape, businesses require robust tools to efficiently process, transform, and analyze data for deriving meaningful insights. Google Dataflow is a solution, offering a powerful, fully managed service on the Google Cloud Platform (GCP) that simplifies the complexities of building data pipelines. Key Features of Google Dataflow Google Dataflow boasts several key features that make it indispensable for modern data processing needs: Unified Model for Batch and Stream Processing: Dataflow leverages the Apache Beam SDK, providing a unified approach to code both batch and streaming data pipelines. This eliminates the need for maintaining separate systems and skillsets for different processing types. Serverless and Auto-scaling: As a fully managed service, Dataflow handles infrastructure management seamlessly, automatically scaling resources based on workload to ensure cost-efficiency. Focus on Logic, not Infrastructure: Dataflow allows users to concentrate on the core logic of data transformation while handling distributed processing, fault tolerance, and resource provisioning intricacies. Rich Integration with GCP: Deep integration with other GCP services such as Cloud Pub/Sub, BigQuery, and Cloud Storage enables users to develop end-to-end data engineering solutions within the Google Cloud ecosystem. Real-Time Analytics with Pub/Sub to BigQuery Pipelines One of the most compelling use cases of Google Dataflow is its capability to build real-time data ingestion and analysis pipelines using Cloud Pub/Sub and BigQuery. Below, are outlined the steps involved in constructing such pipelines. ...

March 31, 2024 · 4 min · Nitin

Firestore: A NoSQL Database for Modern Applications

Introduction Cloud Firestore is a powerful, cloud-based NoSQL database that offers a flexible and scalable solution for storing and managing data. This post dives into the core concepts of Firestore, contrasting it with traditional relational databases and highlighting its unique advantages. NoSQL vs. Relational Databases: A Paradigm Shift If you’re familiar with relational databases like MySQL, you’re used to structured tables with predefined columns and data types. This rigid schema enforces data consistency but can be inflexible when your data model evolves. ...

March 23, 2024 · 3 min · Nitin