Prasanth Janardhanan

Model Context Protocol (MCP): Lets Implement an MCP server in Go

Model Context Protocol (MCP) is rapidly transforming how we interact with computers by enabling natural language instructions to handle complex tasks. As we stand at the beginning of this revolution, we’re witnessing fast-paced development in MCP tools and components. While a detailed introduction to MCP was covered in our previous post, here’s a quick refresher: MCP servers expose various capabilities (like resources, tools, and prompts) to clients. The clients can then use these capabilities in conjunction with Large Language Models (LLMs) to perform tasks.

Continue Reading →

Building a Reliable ETL System with Go and Temporal: When Data Needs to Move Like a Marvel Superhero 🦸‍♂️

Ever tried moving your entire apartment through a drinking straw? That’s basically what building ETL (Extract, Transform, Load) systems feels like sometimes. You’ve got terabytes of data that need to go from Point A to Point B, transform from one shape to another along the way, and arrive without losing a single byte. Oh, and it needs to happen yesterday. As a backend engineer who’s battled these challenges at scale, I’ve learned that building reliable ETL systems is less about writing perfect code (though that helps) and more about preparing for everything that could possibly go wrong.

Continue Reading →

Implementing Saga Pattern with Temporal in Go Microservices: Journey Through Distributed Transactions

Picture this: You’re standing in line at your favorite coffee shop. You order a complex drink (let’s call it the “Distributed Mocha Supreme”), and the barista starts a carefully choreographed dance between the espresso machine, milk steamer, and various syrup stations. Everything’s going great until—oops!—they’re out of whipped cream. Now what? Do they throw away everything they’ve made so far? Ask you to pay for a half-finished drink? Call over three managers for approval?

Continue Reading →

Building a simple query parser using PEG in Go

In another post, Simple Query Parser we had built a simple query parser using Participle - a parser builder for go lang. Parsing expression grammar (PEG) is a type of grammar. The advantage of PEG is that it doesn’t tolerate ambiguous grammar definitions and so is better in error reporting. The go language port of PEG is pigeon The popular Javascript port of PEG is pegjs. A good introduction to PEG grammar can be found in the pegjs documentation and also here.

Continue Reading →

How to support custom Javascript scripting in Go Applications

Why will someone need a Javascript Parser, written natively in Go? Isn’t it a crazy, Architecture Astronauts solution that is looking for a problem? Not necessarily. There was a time when applications allowed some kind of scripting to extend them and to make them fit into any workflow. For example VBScript for Microsoft office products. However, very few Web applications have the infrastructure to allow custom scripts inside them. There are a few that does support; one example is Google Apps Script.

Continue Reading →

Let's build a search query parser in Go

Mini languages are great. Makes it easy to express what you want in a concise manner. Sometimes a complex UI can be replaced with a mini-language. Some time back, google used to support a simple language in the search queries. For example: “some phrase” +required -not_required . Alas! they stopped it and Google search is less cool ever since. I would count regular expressions also as a mini-language. Imagine we are building an online store that allows searching for products using a simple but structured query language.

Continue Reading →

Background task processor in Go with persistence support using BadgerDB

Goroutines can run tasks concurrently. However, for most practical scenarios, you have to keep track of the status of those tasks. In case the process exited, killed, or power cycled, a mechanism should restart the unfinished tasks. For example, imagine you moved order status emailing to a goroutine. If the process was terminated or restarted we have no way to keep track of the tasks that were in progress. A background task manager can keep track of the task in progress, retry if required, and also manage scheduled and recurring tasks.

Continue Reading →

A Simple Wrapper to BadgerDB Key-Value store in Go

BadgerDB is an embeddable key-value store written in Go. It is a persistent store. In this article, we build a wrapper around badgerDB. The purpose of this wrapper is to make it simple to save simple values to the DB in “virtual tables”. The concept is an adaptation from the Sett project. Much of the code -especially the unit tests - are changed though. Usage import( "github.com/prasanthmj/sett" ) s := sett.

Continue Reading →