Bloom Filter using Redis

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.

Environment Setup

  1. Redis — We can set up Redis using docker check out the docker-compose file here.
  2. Java 8+
  3. Spring Boot

Let’s Setup Redisson

This class holds the configuration for Redisson
We set the Redis URL here
We create beans for Redisson Config and Client

Using Redisson

Create and load data in BloomFilter
User Service checks with bloom filter if it contains the name
API which exposes this functionality

Results

API : /rBloom/username/exists?name=John
Response : true
API : /rBloom/username/exists?name=Johni
Response : false
API : /rBloom/username/exists?name=Gaurav
Response : false

--

--

--

I like building stuff.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Install Apache Hadoop: Setting up a Single Node Hadoop Cluster

Best Groovy Editor For Mac

Becoming a Software Developer after studying design

Types of Python Frameworks for developing applications

Configuring web server and launching load balancer by haproxy using ansible playbook on aws.

What is Networking? Try Hack Me -CTF

Building A Serverless Screenshot Service with Lambda

CNCF Annual Survey Report Review: The state of cloud and Kubernetes

CNCF Annual Survey Report Review: The state of cloud and Kubernetes

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
Gaurav Sharma

Gaurav Sharma

I like building stuff.

More from Medium

Java-Spring Boot | GraphQL | Docker

An example of the dramatic performance improvement PostgreSQL lateral joins deliver on certain…

Enabling MySQL Logs In The Linux Environment

Sitecore 10 Docker installation : Solr-init is unhealthy error