https://avatars.githubusercontent.com/u/1217739?size=192

Which Messaging System to Choose? Kafka, Valkey, RabbitMQ, NATS... Oh, So Many!

When building highly communicative distributed systems, one common headache is choosing the right messaging system. There are so many options available: Kafka, Valkey (born from Redis), RabbitMQ, and NATS. Each has its pros and cons. So, in this post, I’ll jot down some notes to compare them for myself, figuring out which one suits which task.

Let's Build a Voting System with Go and Svelte

Lately, I’ve been seeing a lot of local government election campaigns, so I took the opportunity to pick up a web technology that seems to be overlooked, Server-Sent Events (SSE), to create a simple online voting system that supports real-time score display using Go for the backend and Svelte for the frontend.

How to Write Go Code That Accesses Shared Resources Without Using Exclusive Locks 🤔

In Go, using a Mutex (Mutual Exclusion) is one way to manage access to shared data across multiple goroutines to prevent race conditions, which can lead to data corruption. However, sometimes using a Mutex can cause performance issues and program complexity, and it can hurt performance. So let’s try to write code that avoids unnecessary Mutex locks and see how it’s done.

Let's Try to Understand Zero-Allocation Programming in Go

One of the features of Go is its garbage collector (GC), which saves us developers from the headache of having to manage memory. However, this convenience comes at a cost: the time it takes for the GC to run. Although it’s not a full stop-the-world event, you can learn more about the Go GC here. But for some latency-critical tasks, we need to help the GC work less, which means reducing heap allocations. This is where the question of how to reduce heap allocations without going overboard comes in.

Simple Messaging with Go + NATS

While waiting for a friend at a coffee shop, I had some free time and it occurred to me that we travel with asynchronous tasks. Whoever leaves first, does their work first, and arrives first. In the meantime, others are on their own journey, and eventually, we all meet at the destination. So, I decided to write a simple Go + NATS Pub/Sub to document how it’s done.