News for hackers. Stuff that matters.
Re:Why the Windows Registry sucks technically (2010) by marcosdumay on Friday July 29, 2022 @11:10AM (#32277943)
Doing that in a database is easy. You just write your keys on the "/root/path/subpath" format, and search the strings starting with some text. Most database engines have this kind of search heavily optimized. (And the ones that don't cost hundreds of thousands per core, so who cares?)

The one thing you lose by using a real database is that filesystems are only locally coherent, while databases try very hard to be globally coherent. If it has heavy access, the database way will lose performance much faster.

Re:Why the Windows Registry sucks technically (2010) by gregmac on Friday July 29, 2022 @11:39AM (#32278347)
Agreed, and displaying this like a tree is then a UI concern.

I think you'd get slightly more performance if you were to store "Folder" and "Key" separately -- either three fields or using a parent-child table. You'd be able to index "Folder", and it would make building the tree structure itself easier and more efficient, and looking up all the values in a specific tree simpler.

Re:Why the Windows Registry sucks technically (2010) by cma on Friday July 29, 2022 @02:57PM (#32280540)
You could do the paths in reverse (root last), to speed up any string comparisons, since prefix almost always matches and is maybe more wasted work the other way.