Binary search on rank data cuts 4-million-item crawl from a week to a day
A software engineer needed to crawl roughly 4 million items from a public registry within a single day using parallel workers. Splitting the keyspace evenly by alphabet failed because key distribution was uneven, leaving one shard carrying 71% of the total workload. The engineer instead used the registry's listing API, which returns a key's global rank in the sorted order, as a binary search oracle. Running about 40 API calls per boundary, the algorithm identified cut points where each shard held an equal share of items regardless of alphabet width. The resulting balanced partition reduced the fattest shard from 71% of the work to roughly 1/N, turning a projected week-long crawl into a one-day job.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in