Drinking Philosophers: Generalized Resource Contention

    The Drinking Philosophers Problem The Drinking Philosophers Problem is a generalization of the classic Dining Philosophers Problem, proposed by K. M. Chandy and J. Misra in 1984. Unlike the dining version where philosophers share forks with immediate neighbors in a circle, drinking philosophers share bottles with arbitrary neighbors based on a conflict graph. This makes it much more realistic for modeling real-world resource allocation. The Scenario The drinking party has: ...

    August 12, 2025 · 12 min · Rafiul Alam

    Building a Real-Time Note Sharing App: WebSocket + Go + Vue.js (Simplified)

    If you’re new to real-time web applications and want to understand the fundamentals before diving into event-driven microservices, this tutorial is for you. We’ll build a simple but fully functional note-sharing app using WebSockets, Go, and Vue.js-perfect for learning the basics. Why Start Simple? Before jumping into NATS, Kafka, or complex event-driven architectures, it’s crucial to understand: How WebSocket connections work Real-time bi-directional communication Broadcasting messages to multiple clients State management in real-time apps This tutorial gives you that foundation with minimal dependencies and straightforward code. ...

    January 28, 2025 · 18 min · Rafiul Alam

    Building Microservices with gRPC and WebSocket Gateway: Connecting Vue.js to Go Services

    When building microservices, choosing the right communication protocol is crucial. While REST and event-driven architectures have their place, gRPC offers a compelling alternative with strong typing, efficient binary serialization, and built-in support for streaming. In this guide, we’ll build a complete note-sharing application using gRPC microservices in Go, with a Vue.js frontend connected through a WebSocket gateway. Why gRPC for Microservices? gRPC brings several advantages to microservice architectures: Strong Typing: Protocol Buffers provide type-safe contracts between services Performance: Binary serialization is faster and more compact than JSON Code Generation: Auto-generate client and server code from .proto files Streaming: Built-in support for bidirectional streaming Language Agnostic: Works across many programming languages HTTP/2: Connection multiplexing, header compression, and server push However, browsers can’t make native gRPC calls. That’s where our WebSocket gateway comes in. ...

    January 28, 2025 · 13 min · Rafiul Alam

    Event-Driven Note Sharing: Building Real-Time Microservices with NATS, Go, and Vue.js

    Building a real-time note-sharing application is a perfect use case for exploring event-driven architecture. In this comprehensive guide, we’ll build a production-ready system with two microservices (User and Note services) that communicate through NATS, delivering instant updates to a Vue.js frontend. Why Event-Driven Architecture? Traditional request-response patterns create tight coupling between services. When your Note service needs to notify users about changes, you don’t want to make synchronous HTTP calls to every service that cares about notes. Event-driven architecture solves this with loose coupling: ...

    January 27, 2025 · 22 min · Rafiul Alam

    Ebiten Game Development: First Steps

    Ebiten Game Development Series: Part 1: First Steps | Part 2: Core Concepts → What is Ebiten? Ebiten is a dead-simple 2D game engine for Go. Unlike heavyweight engines with complex editors and asset pipelines, Ebiten gives you a minimalist foundation: a game loop, a way to draw pixels, and input handling. Everything else? You build it yourself. This simplicity is Ebiten’s superpower. You’re not fighting an editor or memorizing a sprawling API. You write Go code that runs 60 times per second and draws rectangles. From those humble beginnings, you can build anything from Pong to procedurally generated roguelikes. ...

    December 15, 2024 · 12 min · Rafiul Alam