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.
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.
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!
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 works primarily in two ways:
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.
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.
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.
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
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.
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…
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.
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. …
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.
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.
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”
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
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”.
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…