3 ms·
CDB is one of my favorite data structures. When a student wants to learn about databases, I get them to implement cdb. It's easy to implement and really demon
by ctdean 12y ago
CDB is one of my favorite data structures. When a student wants to learn about databases, I get them to implement cdb.
It's easy to implement and really demonstrates some good system engineering tradeoffs.
- zura 12y agoAny links to theory behind cdb?
- twic 12y agoI'd be particularly interested to know why there are 256 hashtables, rather than one, or some other number. I don't think i've seen this hybrid trie-hashtable before. I wonder if there's any mileage in using a perfect hash function to build a database like this. It seems suited to the operating model of being slow to build but fast to access.
- geogriffin 12y agoi second that; if anyone knows why there are 256 hashtables rather than just 1, please speak up. my only guess is that it might be a way to prevent 32-bit int overflow in the C code..
- netghost 12y agoHere's an articles I came across that explains the structure: http://www.unixuser.org/~euske/doc/cdbinternals/ http://www.unixuser.org/~euske/doc/cdbinternals/ I think the theory is mostly that it's really simple and ends up requiring very few disk reads.