Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌸 Blossom

A high-performance Bloom filter library written in Go, featuring multiple concurrency-safe implementations optimized for different workload patterns. Blossom also includes a REST API built with Gin for creating named Bloom filters, adding items, checking membership, and retrieving filter statistics.


✨ Features

  • 🚀 High-performance Bloom filter implementation
  • 🔒 Thread-safe concurrent operations
  • ⚡ Multiple implementations:
    • RWMutex-based Bloom Filter
    • Atomic Bloom Filter
    • Sharded Bloom Filter
  • 🌐 REST API built with Gin
  • 🧩 Create and manage multiple named Bloom filters
  • ➕ Add elements to filters
  • 🔍 Check element membership
  • 📊 Retrieve filter statistics
  • 🔑 Murmur3 hashing for efficient indexing
  • 📦 Modular and extensible architecture

🏗️ Project Structure

blossom/
├── bloom/          # Core Bloom filter implementations
├── bloom_api/      # REST API handlers and routes
├── gloom/          # Shared/internal components
├── main.go         # Application entry point
├── go.mod
└── go.sum

🛠️ Tech Stack

Category Technologies
Language Go (Golang)
Web Framework Gin
Hashing Murmur3
Concurrency RWMutex, sync/atomic, Sharding
API RESTful API
Version Control Git, GitHub

🚀 Getting Started

Prerequisites

  • Go 1.20+
  • Git

Clone the Repository

git clone https://github.com/akshitajundiya/blossom.git
cd blossom

Install Dependencies

go mod tidy

Run the Application

go run main.go

📡 API Overview

Create a Bloom Filter

POST /filters

Add an Item

POST /filters/{name}/add

Check Membership

GET /filters/{name}/contains

Get Filter Statistics

GET /filters/{name}/stats

📈 Why Bloom Filters?

Bloom filters are space-efficient probabilistic data structures used to quickly determine whether an element may exist in a set.

Advantages

  • Extremely memory efficient
  • Fast insert and lookup operations
  • Constant-time performance (O(k))
  • Ideal for caching, databases, networking, and distributed systems

Limitations

  • May produce false positives
  • No false negatives
  • Standard Bloom filters do not support deletion

🎯 Use Cases

  • Database query optimization
  • Distributed caching
  • Web crawlers
  • API request filtering
  • Duplicate detection
  • Network packet filtering
  • Recommendation systems

🤝 Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch
git checkout -b feature/my-feature
  1. Commit your changes
git commit -m "Add my feature"
  1. Push to the branch
git push origin feature/my-feature
  1. Open a Pull Request

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.


⭐ Support

If you find this project useful, consider giving it a ⭐ on GitHub!


Built with ❤️ using Go.

About

A high-performance Bloom filter library written in Go, featuring concurrency-safe implementations (RWMutex, Atomic, and Sharded) with a Gin-powered REST API for creating filters, adding items, membership checks, and statistics.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages