This is a mirror of official site: http://jasper-net.blogspot.com/

Why is the registry a hierarchical database instead of a relational one?

| Thursday, September 8, 2011
Commenter ton asks why the registry was defined as a hierarchical database instead of a relational database.

Heck, it's not even a hierarchical database!

The original registry was just a dictionary; i.e., a list of name/value pairs, accessed by name. In other words, it was a flat database.

.txt txtfile
txtfile Text Document
txtfile\DefaultIcon notepad.exe,1
txtfile\shell open
txtfile\shell\open\command notepad %1

If you turned your head sideways and treated the backslashes as node separators, you could sort of trick yourself into believing that this resulted in something vaguely approximating a hierarchical database, and a really lame one at that (since each node held only one piece of data).

When you choose your data structures, you necessarily are guided by the intended use pattern and the engineering constraints. One important engineering constraint was that you have to minimize memory consumption. All of the registry code fit in 16KB of memory. (Recall that Windows 3.1 had to run on machines with only 1MB of memory.)


Read more: The old new thing
QR: 10206968.aspx

Posted via email from Jasper-net

0 comments: