# 80%查询无果，Bloom filter让Cassandra集群缩小60%

Original title: Most lookups are for things that don't exist

> Hacker News story 50128688 · language: zh · submitted 2026-10-17
> Web version: https://zeli.app/zh/story/50128688
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 4 · by [frostbyte7](<https://news.ycombinator.com/user?id=frostbyte7>) · 💬 3
[original](<https://cristicretan.ro/articles/2026/10/16/most-lookups-are-for-things-that-dont-exist/>) · [HN discussion](<https://news.ycombinator.com/item?id=50128688>)

## Summary

我负责的服务每秒处理数百万次文件哈希查询，但80%的请求都在确认文件不存在。这导致Cassandra集群不堪重负，而缓存失败策略又无法奏效。最终，我在服务前端引入了Bloom filter，配合Redis存储位图。这一改动让绝大多数无效请求在到达Cassandra之前就被拦截，不仅解决了性能瓶颈，还让集群规模缩小了60%。关键在于理解Bloom filter的单向误报特性：它绝不会漏报，只会误报，而这在‘确认不存在’的场景下完全可接受。

## Key quote

> 绝大多数查询都在确认某物不存在，而每一次确认都付出了完整的代价。

---

## Cite

- Page: https://zeli.app/zh/story/50128688
- Date: 2026-10-17
- Source: cristicretan.ro (https://cristicretan.ro/articles/2026/10/16/most-lookups-are-for-things-that-dont-exist/)
- Hacker News: https://news.ycombinator.com/item?id=50128688

## Other languages

- en: https://zeli.app/story/50128688 · markdown: https://zeli.app/story/50128688.md
- ja: https://zeli.app/ja/story/50128688 · markdown: https://zeli.app/ja/story/50128688.md
- ko: https://zeli.app/ko/story/50128688 · markdown: https://zeli.app/ko/story/50128688.md
- de: https://zeli.app/de/story/50128688 · markdown: https://zeli.app/de/story/50128688.md
- es: https://zeli.app/es/story/50128688 · markdown: https://zeli.app/es/story/50128688.md
- ru: https://zeli.app/ru/story/50128688 · markdown: https://zeli.app/ru/story/50128688.md
