4 ms·
Is this not a perfect use case for a trie? Can you make a trie in Redis?
by zachrose 9y ago
Is this not a perfect use case for a trie? Can you make a trie in Redis?
- jshen 9y agoI think so, specifically a ternary search tree. While you can implement one on top of redis, I’m pretty sure it would be significantly slower than an in memory TST.
- yeswecatan 9y agoI have not implemented a trie myself, but apparently the problem is they take up a lot of space: http://www.drdobbs.com/database/ternary-search-trees/184410528 http://www.drdobbs.com/database/ternary-search-trees/1844105...
- dvirsky 9y agoA trie and a ternary search tree are two very different beasts. Tries can are very memory efficient, as common prefixes in terms are bunched together, and nodes are not split on every letter.