If you are building a text-heavy web platform such as a blog or a documentation platform, your users expect a search functionality. One of the simplest and effective way to build search experiences is to leverage the full-text search (FTS) capabilities exposed by your database.

Photo by Loverna Journey on Unsplash

In this blog, we will look at building a search system for a web app that indexes various videos. Each video has a title, description, and associated metadata. We want our system to be searchable over video title and description. We will be using SQLAlchemy as our ORM layer for the underlying PostgreSQL database.

PostgreSQL and FTS

PostgreSQL…


So, if you have been working on web services in this half of the decade, you must have come across the term “load balancing”. So what is load balancing? Let’s find out!

What is load balancing?

Load balancing, as the name suggests, is distributing work to multiple agents. In our case, we distribute incoming HTTP requests from browsers, apps or other servers between a pool of web servers that can serve this request.

Load balancing

How does load balancing work?

Load balancing works primarily in two ways:

  1. Client-side
  2. Server-side

Client-side load balancing

In client-side load balancing, we expect the client to distribute requests to each of the servers capable of serving the request. We…


This post is about the confusions of a programmer familiar with many other ORMs was asked to use Hibernate for the first time.

An offline database — file archive
An offline database — file archive
Photo by Twitter: @jankolario on Unsplash

Before you ask “I thought you are a backend developer in working primarily on Java, how come you did not use Hibernate?” Yes, I am a Java developer. I write Java code for a living daily and no, I don’t use Hibernate often. I create REST APIs as the part of my daily job, but I don’t use Spring or Hibernate often. My Company uses JDBi extensively so I never had the chance to fully learn how…


Healthchecks are essential to signal whether a service is up and running normally. In a microservices-based architecture, health checks are used to discover healthy service instances. It is vital to have an accurate health check indicator for the reliability of our applications.

Photo by Siora Photography on Unsplash

A client-library, load-balancer, or service discovery co-ordinator (such as consul) takes care of periodically checking each instance’s health. When connecting to the service, the library or load-balancer checks the instances’ status and binds only to healthy service instances. A monitoring service may also rely on the health indicator to fire-off alerts.

How to design meaningful application health checks

Your application health check should be a…


You may come across a Makefile today or you may be writing one yourself. The Makefile will have some targets such as build, test, and install. When invoked, these tasks run a bunch of commands. Sadly, such Makefiles are no better than a task runner. Makefiles are much, much more capable.

Photo by Chester Alvarez on Unsplash

The problem with average Makefiles

With fast disks and CPUs, we do not have a strong need to prevent duplicate work anymore. A webpack build takes seconds, so small that you will be mostly okay with it running over and over.

But what if your tasks are not trivial enough?

You may have seen…


Photo by Bernard Tuck on Unsplash

README is important — no matter if your software is open-source or purely internal. It will form the first impression of your code. The main goals of your README should be to convey the necessary information about what your code does and instructions for other developers to set up and contribute changes as soon as possible.

Here is a checklist for the perfect README.

Title

Your repository needs a name. People will refer your project by that name. Good projects have memorable names. Even better when they connect to the primary functionality of the project. …


Here are 2¹⁰ words about how not to write the powerful, yet simple Envoy Lua filters.

First things first… What’s Envoy?

Envoy is a high-performance L4 and L7 proxy with wire-level support for multiple protocols such as HTTP, GRPC, MongoDB, DynamoDB, etc. It possesses advanced load balancing features including automatic retries, circuit breaking, rate limiting, all with the goodness of providing APIs for dynamically managing all its configuration.

At Gojek, we use Envoy at multiple places — as a fronting proxy to micro-services, as an ingress point to client-facing APIs, etc. …


PHP just celebrated its 25th anniversary. In our days of flashy frameworks coming up every other month, it’s not surprising to see tech evangelists calling for the death of PHP — since last few years, but it’s still strong with around 78% of the known web using it.

Photo by Florian Olivo on Unsplash

Bjarne Stroustrup, the creator of C++, has a quote here:

There are only two kinds of languages: the ones people complain about and the ones nobody uses.

Every language has a set of features that give you the uneasiness, you either make a compromise or create your own. If you choose to…


I do quite a lot of Java as part of the work I do at Gojek and one of the most helpful, but at times confusing part of the language is generics. Here I will be mentioning an interesting concept I recently came across — PECS or “Producer Extends, Consumer Super”

Photo by Samuel Sianipar on Unsplash

Generics in Java are invariant by default and are applied at compile-time. Polymorphic type arguments do not imply polymorphism in generic types, i.e., You cannot assign List<String> to List<CharSequence>.

However, with extends and super, you achieve “covariance” and “contra-variance” that aids in designing type-safe generic code aware of inheritance…


In part 1, we saw how to design a declarative API to be consumed as a Groovy DSL at a compiled environment. This part focuses on how to load them dynamically as “configuration”.

“Literally”, Configuration as code

Note: This is not same as configuration as code, which refers to checking-in your configuration as a SCM repository.

You must be familiar with using YAML, JSON or (God forbid!) XML for configuration. One of the serious drawback of these languages are they are declarative and carry no logic. However, using Groovy, you can create configuration as Groovy code.

This has several advantages — You can use…

Amitosh Swain Mahapatra

Product Engineer @ Gojek. Open-source contributor. Find me at https://amitosh.in/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store