Re:How we store 400M phone numbers with fast lookup
by bilalhusain on Sunday July 19, 2015 @06:34AM
(#9910736)
Earlier submission tanked on HN and the link didn't work, resubmitting with lookup timings added. Hopefully, readers will find it interesting this time.
[ Parent
| on HN ]
Re:How we store 400M phone numbers with fast lookup
by nly on Sunday July 19, 2015 @09:59AM
(#9911191)
> Unfortunately, 10 digits won't fit in 32 bits and 5 * 400 MB for storing number is not a very happy situation and it is NOT readily searchable.
Why is 7 bytes (2b prefs + 5b number) x 400M = ~2.4GB of RAM not good enough?
Re:How we store 400M phone numbers with fast lookup
by tacos on Sunday July 19, 2015 @01:48PM
(#9912053)
Exactly. My response to the headline was "Um... using ten lines of C and $44 worth of RAM?"
Re:How we store 400M phone numbers with fast lookup
by yason on Sunday July 19, 2015 @05:23PM
(#9912870)
Because the interesting part of the effort is doing it fast in anticipation of translating the optimization tricks to cases where you can't just go buy more RAM anymore. A lot of problems can be "solved" with current hardware because accesses or comparisons or whatnot become ridiculously cheap but that's not what computer science is about.
Re:How we store 400M phone numbers with fast lookup
by fleitz on Sunday July 19, 2015 @06:11PM
(#9913013)
This is one of the biggest problems I run into in 'software engineering', people building way to complex systems because they are 'interesting' rather than buying $50 of RAM and being done with it, and then poo-poo'ing systems that cost $50 and work.
Querying a DNC list is not a problem in which you will ever not be able to buy more RAM, it's trivially parallel, if for some reason DNC lists ever outpace Moore's law, just buy another system.
To be fair to the authors at least they didn't do something ridiculous like build a 100 note cassandra cluster.
Re:How we store 400M phone numbers with fast lookup
by icebraining on Monday July 20, 2015 @06:50PM
(#9919627)
This is one of the biggest problems I run into in 'software engineering', people building way to complex systems because they are 'interesting' rather than buying $50 of RAM and being done with it, and then poo-poo'ing systems that cost $50 and work.
Funny; one of the most common complaints about the software industry (common on HN) is that people use inefficient languages or algorithms and then waste too much hardware.
Re:How we store 400M phone numbers with fast lookup
by fleitz on Monday July 20, 2015 @10:08PM
(#9920205)
Yup, there's certainly a balance to be achieved.
Re:How we store 400M phone numbers with fast lookup
by wtallis on Sunday July 19, 2015 @08:07PM
(#9913368)
And realistically, there's nothing you can do with phone numbers that even needs the full speed of RAM. A fast SSD can do enough random reads to load the entire database in under 20 minutes, and nobody actually needs to know the status of all 400M numbers in the same 20 minutes because they can't all be dialed that quickly.
Re:How we store 400M phone numbers with fast lookup
by fleitz on Monday July 20, 2015 @12:03PM
(#9916945)
Exactly: https://github.com/twitter/fatcache
A single fatcache can do close to 100K set/sec for 100 bytes item sizes.
A single fatcache can do close to 4.5K get/sec for 100 byte item sizes.
All the 8 fatcache instances in aggregate do 32K get/sec to a single 600 GB SSD.
Re:How we store 400M phone numbers with fast lookup
by nulltype on Sunday July 19, 2015 @08:20PM
(#9913403)
Yeah, looking at the graph in the article is really weird. Wait, you can query 10k phone numbers per second with a single crappy linode machine, why does it need to be faster than that?
Re:How we store 400M phone numbers with fast lookup
by wtallis on Sunday July 19, 2015 @02:11PM
(#9912174)
Or one line of C and $500 of RAM (assuming we're going to spring for registered/ECC memory).
Re:How we store 400M phone numbers with fast lookup
by vidarh on Sunday July 19, 2015 @01:57PM
(#9912115)
Now do fast lookups. It needs an index, which is what their post is about.
Re:How we store 400M phone numbers with fast lookup
by fleitz on Sunday July 19, 2015 @04:06PM
(#9912631)
It doesn't need an index, it just needs to be sorted...
Then you can do fast lookups...