Home / Companies / Incident.io / Blog / Post Details
Content Deep Dive

Bloom filters: the niche trick behind a 16× faster API

Blog post from Incident.io

Post Details
Company
Date Published
Author
Mike Fisher
Word Count
3,611
Language
English
Hacker News Points
-
Summary

The blog post by Mike Fisher explores how the implementation of bloom filters significantly improved the performance of an API endpoint by reducing the P95 latency from 5 seconds to 0.3 seconds, achieving a 16x speed increase. The article discusses the initial challenges faced with slow filtering of alerts in a Postgres database due to the deserialization of large data batches, which was particularly cumbersome for larger customers with millions of alerts. It compares two solutions, GIN indexes and bloom filters, ultimately choosing the latter for its efficiency despite its complexity and niche nature. Bloom filters, which allow for efficient probabilistic checks, reduced the need for extensive data deserialization by encoding attribute values as bit strings and leveraged bitwise operations to streamline filtering, maintaining performance even as alert volumes increase. Additionally, a mandatory 30-day time bound was introduced for queries, optimizing the process by focusing on recent alerts and alleviating concerns about scalability. This combination of technical and product insights resulted in a more responsive and scalable alert filtering system, enhancing the user experience for large organizations.