Previously I discussed about the Theory of Bloom Filter and implemented a simple version in Java. Let’s find out how we can implement a Bloom Filter for a distributed production environment.

We will be using Redis with RedisBloom Module to implement it.

Why Redis?

  1. Checking if value exists or not should be fast. So an in-memory data structure should be the better choice here.
  2. Redis has out of box support for many different data structures including Bloom Filter.
  1. Redis — We can set up Redis using docker check out the docker-compose file here.
  2. Java 8+
  3. Spring Boot

Github Project for reference —

While working on providing transaction support @ Fabhotels by using multiple transaction gateways, I needed to make sure that —

  1. No Single Payment Gateway is overloaded.
  2. We choose a gateway that is alive for each request.

How can we solve this problem?

  1. We can load balance by simple round-robin — Use the gateways in a cycle (A > B > C >A). But this will not solve the second issue of avoiding failures.
  2. Use a load balancer with intelligent routing.

Netflix Ribbon is an Inter Process Communication (IPC) cloud library. Ribbon primarily provides client-side load balancing algorithms.

  1. If you are…

Source : Cloudflare

A while back, I was working on a task that required me to generate a random unique string and use it as an identifier in a database column and I thought to myself, “It’s a trivial task, will be done in 2 minutes!”.

Rakishly, I began to formulate the code.

String id = createRandomString(6) //length 6while(dbRepository.hasId(id)){
id = createRandomString(6)

“This code will work. But at what cost?”

Time complexity is O(N *M* k), where N is the size of the db and k is the length of the random string to be generated and M is the number…

Postman is a fantastic tool to quickly test your API(s). However, working in a microservice environment with end points being secured via a token system makes testing a PITA.

Adding a new security token every time the previous one expires slows us down, Here’s how to automate it —


  1. Latest version of Postman
  2. A service that is used by your application for authorization.
  1. Create a collection in Postman

You have finally created the perfect app. Its sleek, beautiful and fast with all the bells and whistles that you had dreamt of.

But where are the users?

When my foray into Spring-Boot backed Microservices gave HTTP Session an existential crisis, I knew it was time that I should dabble with Spring Sessions.


You have multiple instances of a microservice behind a load balancer and you need the session to be maintained for the user after successful authorization, regardless of which instance is executing the request.

Probable Solutions

  1. Centralized Sessions — Maintain sessions in a common location for all instances to share.
  2. Consistent Hashing — Load balancer decides which instance to send the request to.

We will focus on Centralized Sessions here.

If the number of concurrent users of your…

Gaurav Sharma

I like building stuff.

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