From Choreography to Durable Execution: Why Temporal Changes Everything

    The Choreography Problem: Hope-Driven Development For years, we’ve built distributed systems using choreography-Service A fires an event into the void, hoping Service B hears it. Service B processes it and fires another event, hoping Service C is listening. When something fails (and it will), we’re left scrambling through logs across multiple services, trying to piece together what happened. This is hope-driven development, and it’s fundamentally broken. Enter Temporal and the concept of Durable Execution-a paradigm shift that replaces hope with guarantees. ...

    February 8, 2025 · 11 min · Rafiul Alam

    NATS & JetStream in Go: Cloud-Native Messaging at Scale

    Backend Communication Current: NATS & JetStream WebRTC All Posts Apache Kafka What is NATS? NATS is a high-performance, cloud-native messaging system designed for microservices, IoT, and edge computing. It provides a simple yet powerful pub/sub model with subject-based addressing, making it ideal for building distributed systems that require fast, reliable communication. ...

    February 7, 2025 · 12 min · Rafiul Alam

    Visualizing LLM Embeddings: The Geometry of Meaning

    Introduction: Words as Numbers How do language models understand meaning? The answer lies in embeddings: representing words, sentences, and entire documents as vectors of numbers in high-dimensional space. In this space: Similar words cluster together Analogies emerge as geometric relationships Meaning becomes computable through vector arithmetic Let’s visualize this invisible geometry where meaning is distance. From Words to Vectors Traditional Approach: One-Hot Encoding graph TB A[Vocabulary:cat, dog, king, queen, apple] A --> B[cat = 1,0,0,0,0] A --> C[dog = 0,1,0,0,0] A --> D[king = 0,0,1,0,0] A --> E[queen = 0,0,0,1,0] A --> F[apple = 0,0,0,0,1] style B fill:#e74c3c style C fill:#e74c3c style D fill:#e74c3c style E fill:#e74c3c style F fill:#e74c3c Problem: No semantic relationship! ...

    February 6, 2025 · 11 min · Rafiul Alam

    Go Concurrency Pattern: The Ticket Seller

    ← Bank Account Drama | Series Overview | Login Counter → The Problem: Selling Tickets That Don’t Exist A concert has 1,000 tickets. Multiple goroutines handle sales concurrently. Each seller checks if tickets remain, and if yes, decrements the count and sells one. Sounds simple, right? Two sellers check simultaneously. Both see “1 ticket remaining.” Both sell. You’ve just sold ticket number -1. Congratulations, you’ve discovered the check-then-act race condition, one of the most common concurrency bugs in the wild. ...

    February 5, 2025 · 9 min · Rafiul Alam

    Profitability Metrics: Beyond 'Are We Making Money?'

    Business Math Current: Profitability Metrics: Beyond 'Are We Making Money?' Customer Economics: The LTV/CAC Framework That Predicts Success All Posts Next The WeWork Paradox: $47B Valuation with Negative Unit Economics In 2019, WeWork was valued at $47 billion. They had beautiful offices in major cities worldwide. Revenue was growing at triple-digit rates. They were “revolutionizing” real estate. ...

    February 4, 2025 · 12 min · Rafiul Alam

    WebRTC in Go: Peer-to-Peer Real-Time Communication

    Backend Communication Current: WebRTC gRPC Streaming All Posts NATS & JetStream What is WebRTC? WebRTC (Web Real-Time Communication) enables peer-to-peer audio, video, and data sharing directly between browsers and native applications. Unlike traditional client-server models, WebRTC allows clients to communicate directly with each other after establishing a connection through a signaling server. ...

    February 4, 2025 · 14 min · Rafiul Alam

    The LLM Development Workflow: A Data-Centric View

    Introduction: It’s All About the Data The secret to building great language models isn’t just architecture or compute-it’s data. Every decision in the LLM lifecycle revolves around data: What data do we train on? How do we clean and filter it? How do we align the model with human preferences? How do we measure success? Let’s trace the complete journey from raw text to a production-ready model, with data at the center. ...

    February 3, 2025 · 10 min · Rafiul Alam

    Go Concurrency Pattern: The Sieve of Eratosthenes Pipeline

    ← Monte Carlo Pi | Series Overview | Mandelbrot Set → The Problem: Finding Primes with Filters The Sieve of Eratosthenes is an ancient algorithm for finding prime numbers. The concurrent version creates a pipeline of filters: each prime spawns a goroutine that filters out its multiples. The Algorithm: Generate sequence: 2, 3, 4, 5, 6, 7, 8, 9, 10, … Take first number (2), it’s prime, filter all multiples of 2 Take next number (3), it’s prime, filter all multiples of 3 Take next number (5), it’s prime, filter all multiples of 5 Repeat until desired count The Beauty: Each prime creates its own filter. Numbers flow through a pipeline of increasingly selective filters. What passes through all filters must be prime. ...

    February 2, 2025 · 11 min · Rafiul Alam

    Customer Economics: The LTV/CAC Framework That Predicts Success

    Business Math Current: Customer Economics: The LTV/CAC Framework That Predicts Success Previous All Posts Profitability Metrics: Beyond 'Are We Making Money?' The $100M Mistake In 2011, a promising e-commerce startup raised $100M in funding. Their revenue was growing 20% month-over-month. The press loved them. Investors were excited. Eighteen months later, they shut down. ...

    February 1, 2025 · 10 min · Rafiul Alam

    gRPC Streaming in Go: High-Performance Inter-Service Communication

    Backend Communication Current: gRPC Streaming WebSockets All Posts WebRTC What is gRPC Streaming? gRPC (gRPC Remote Procedure Call) is a high-performance, open-source RPC framework that uses HTTP/2 for transport, Protocol Buffers for serialization, and provides built-in support for streaming. Unlike traditional request-response RPCs, gRPC streaming enables long-lived connections where either party can send multiple messages over time. ...

    February 1, 2025 · 15 min · Rafiul Alam