Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Zalando Engineering 9 min read Research mediumAdept

Space efficient machine learning feature stores using probabilistic data structures - a benchmark

A Bloom-filter-backed in-process feature store matched a conventional key-value feature store's click-prediction accuracy (AUC ≈0.7997 vs ≈0.80) using about 3% of the memory (470MB vs 15GB). It kept 90% of the history uplift at roughly 40MB, with no measurable throughput cost. Features are stored as composite user^value keys and reconstructed by probing every possible value, so false positives inject tunable noise in exchange for space. The approach suits cases where an extra network call or many lookups per request are too expensive. It is not a drop-in replacement, though: you must know the full feature domain, high-volume real-time updates must hit every node, and deletions or expiry require rebuilding the filter from scratch.

Assumes: Bloom filtersfeature storeslogistic regressionROC-AUC

Related posts

  • Engineering stories behind the Medium Daily Digest Algorithm: Part 2

    Medium Engineering mediumAdept

    Medium replaced the Bloom filters behind its recommendation filters (muted writers, already-read, presented 3+ times) with per-user DynamoDB queries against the source-of-truth tables, cutting filtering cost roughly 10x and simplifying maintenance. The Bloom filters had grown huge because entries can't be deleted, so unmutes couldn't be reflected, contents couldn't be inspected for debugging, and derived data drifted from the database. Fetching all muted writers per user is cheap because most users mute no one. For the presentation counter, which had been hacked together from three layered Bloom filters, a best-effort query of the most recent 5k presentations (~100ms) is acceptable because the 3-presentation limit is a soft rule.

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

    incident.io mediumAdept

    incident.io cut P95 latency of its alert-filtering API for large organisations from 5s to 0.3s by pushing JSONB attribute filters into Postgres using bloom filters. Attribute key-value pairs are string-encoded, hashed with seven hash functions into a 512-bit bitmap stored as a bit(512) column, and queried with bitwise AND against bitmasks. With a 1% false-positive rate, only about 1% of the previous in-memory deserialization work remains. The bottleneck had been fetching and deserializing 500-row batches into Go structs. The team spiked a GIN index with jsonb_path_ops as the alternative and benchmarked both options before choosing.

  • Modeling Machine Learning Data in OLAP databases

    ClickHouse mediumAdept

    ClickHouse can act as the transformation engine and offline store of an ML feature store, with features modeled as timestamped tables and assembled into point-in-time correct training sets. Using a 100m-row web analytics dataset and a bounce-prediction example, the walkthrough builds a deduplicated "feature subset" table with ReplacingMergeTree and a trimmed PRIMARY KEY, then keeps it current with incremental materialized views. Features are tied to entities such as user and domain, computed with GROUP BY aggregations, and joined into feature vectors via ASOF JOIN on key and timestamp proximity. The aim is fast iteration during feature engineering, which usually costs more time than model selection.

  • Why OpenAI chose ClickHouse for petabyte-scale observability

    ClickHouse mediumAdept

    OpenAI ingests petabytes of logs daily, growing over 20% monthly, into a ClickHouse cluster of 90 shards with two replicas each, fed by Fluent Bit agents. Recent data stays on local disk because about 80% of queries touch the last two days, and older logs tier to blob storage. ClickHouse was chosen for being open source, horizontally scalable, tunable in its indexing and queryable in SQL. When the GPT-4o image generation launch raised log volume 50% overnight, the team added a query-only replica and sampled logs, then profiled ClickHouse and found more than half of CPU time going to Bloom filter construction. Replacing a per-insert division with a multiply and bit shift cut CPU usage 40%, and the fix was upstreamed.

  • Announcing General Availability of ClickHouse Full-text Search

    ClickHouse mediumAdept

    ClickHouse Full-text Search is now generally available, implemented as a Lucene-style inverted index that maps tokens to row numbers using configurable tokenizers and preprocessors defined in SQL. Unlike granule-level Bloom filter skip indexes, it is deterministic, supports multi-token search and scales better. It does not do relevance scoring or directly accelerate phrase search. On a 10-billion-row GitHub events dataset, a token search with monthly aggregation dropped from 193s with a linear scan and 143s with a Bloom filter to 0.42s with the text index. The costs are roughly 50% lower insert throughput and larger index storage than Bloom filters.

The quest for software engineering knowledge.

Look:
Layout: