Urgent.News

650+ sources. One page. See who else covered it.

Editions โ–พ

Tech

Bloom Filters

One-liner: A probabilistic data structure that tells you if an element is definitely not in a set, or possibly in a set โ€” using very little memory. ๐Ÿ“Œ The Problem You have 1 billion URLs in a database. Before adding a new URL, you want to check if it already exists. Naive approach: Query the database every time. Cost: 1 DB query per URL check โ†’ slow, expensive Bloom Filter approach: Check theโ€ฆ

Bloom filters are a clever data structure that quickly tell you if something is definitely not in a set, or maybe it is. They take up very little memory, which is great for large collections like the billions of URLs in a database.

The basic idea is simple. You have a big array of bits, all starting at 0. To add an item, you use a few "hash functions" to turn the item into a few positions in the bit array, and you set those bits to 1. When you want to check if something is in the set, you run it through the same hash functions and look to see if all those positions are 1. If they are, the item is probably in the set. If any position is 0, the item definitely isn't in the set.

This is super fast because you're only doing a few quick lookups instead of a full database search. But there's a catch - it can give false positives. That means it might say an item is in the set when it's actually not. But it never gives false negatives - if it says an item isn't in the set, it really isn't.

To balance how often false positives happen, you can change two things: the size of the bit array (m) and the number of hash functions (k). More bits and more hash functions make false positives less likely, but they also use more memory.

In practice, you aim for about 10 bits per element for a 1% chance of false positives. So for 1 billion URLs, a bloom filter only needs about 1.25 GB of memory, compared to 50-100 GB for the actual URLs themselves. That's a huge memory savings!

Bloom filters are super useful for speeding up lookups, especially when you have expensive database queries. They're used in Chrome to quickly check if a URL is malicious, in Cassandra to avoid reading data that's definitely not needed, and in Bitcoin wallets to filter out unimportant transactions. They're even used in spam filters and web crawlers.

Just remember, if a bloom filter says an item is probably in the set, you should always double-check with a full database search to be sure. Bloom filters are great for a first filter, but they're not a replacement for accurate lookups.

Written by urgent.news from Dev.to's reporting โ€” not their text. Machine-written โ€” may contain errors; check the original before relying on it.

Read the original at dev.to โ†’

More in Tech

Your Browser Automation Clicks Might Be Landing 25% Off โ€” And Nothing Will Tell You

I spent a day pointing an AI agent at a browser to publish one product across four marketplaces. Most of it worked. The parts that didn't work failed in the worst possible way: silently , with noโ€ฆ

  • Browser automation clicks fail silently, no error messages
  • Coordinate systems differ between automation tool and page
  • Scaling factor of 0.7484 corrects click landing issues

Developers you build for the future...Don't forget to be inclusive!

Developers you build for the future...Don't forget to be inclusive! I build things for blind people. I'm a braille transcriber. I work in accessibility every day.

  • Chris, a braille transcriber, founded pifcoin.org to fund assistive technology.
  • Aurastoria.com created revenue and liquidity for these tokens.
  • Developers must prioritize accessibility as architecture, not a sprint feature.

Paywall Any API Endpoint With Two Prices: Sats or Compute

You built an API. It works. Then the scrapers show up. Not paying customers. Bots hammering your endpoint a thousand times a minute, running up your compute bill, and giving you nothing back.

  • Pay-to-Compute model protects APIs against scrapers
  • Callers pay in sats or solve compute-intensive proof-of-work
  • Server-side verification is minimal and straightforward

X Open Sources Its Ranking and Filtering Algorithms

An anonymous reader shared this report from TechCrunch: X is significantly expanding its open source codebase, which includes the app's "For You" algorithm and its core ranking engine, and adding aโ€ฆ

  • X open sources core ranking and filtering algorithms on GitHub
  • For You timeline algorithm and ranking model parameters released
  • Transparency tool lets users download aggregate stats as JSON

How I Cut MCP Token Usage by 91% (and Learned a Humbling Lesson About Tokenizers)

The Problem When you add MCP servers to your AI coding agent, each one dumps its full JSON schema into context. 255 tools across all servers = 39,964 tokens.

  • MCP servers consume large token space by adding full JSON schema to context
  • Mcptoon compresses JSON schema by 91%, reducing 39,964 tokens to 3,511
  • Mcptoon returns results in human-readable TOON format, saving even more tokens

More from Sunday 16 August โ†’