Seconding the "use a real DB" recommendations. Another thing to consider is that since you're basically storing a single bit (true/false) you could use vec and store the data packed that way (with suitable convenience wrappers to extract or set the value for a given thread). That'd get you 8 threads / byte, and with a lucky data set you might could use gzip to compress things for longer term storage (i.e. if you've got long contiguous runs of trues or falses it'll shrink pretty well). I once did something similar where I had 10,000 bits that stored in under half a K on disk.