7
Windows relies a lot on registry to store small pieces of information such as the IP address of the machine. Unix, and so Linux and OS-X, store everything in ordinary files.
When it comes to registry, I see several problems with it:
Accessing the information is not that easy. For instance, if the machine fails to boot and I try to solve the issue by mounting the disk on a different machine to access it from a different OS (would it be another Windows or Linux), I can access all the files with ease (with the exception of permissions and encryption), but with registry, although it's theoretically possible to read (and probably change) it, it requires additional applications.
Command-line access (in a context where the machine won't boot any longer) is impossible (unless there are apps for that too, but I'm pretty sure installing and using those apps is much more difficult than simply accessing files on disk).
Information can be located either in files or in registry, so one has to juggle two locations.
Common tools which are used when working with files (such as
findstr
, the Windows' little brother ofgrep
) are non-existent when working with registry keys.
I'm sure that if Microsoft originally implemented the registry, it was for a good reason and gave (even slight) competitive advantage to Windows over other operating systems of that time.
I thought about performance and space constraints, particularly important at the times Windows was born, but I can't see how storing something in registry improves performance or reduces the space used (storing DWORD as an actual DWORD in registry versus storing its string representation in files will save space, but would that matter that much, even in 1985?
Security-wise, it looks like there is no difference either. I'm not sure if this was the case in 1985, but today's file-based permissions look as—if not more—powerful as the ones implemented for registry keys.
Organization is similar as well: a tree-based structure, with no indexing/searching capabilities (while later versions of Windows implement indexing on files).
So what are or were originally the benefits of registry, compared to storing everything in files?
2You can use
find
orfindstr
( along with the rest of the command line tools.) together withreg
... for examplefor /f "tokens=3 usebackq" %a in (\
reg query "HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer" /v version ^| find "version"`) do echo IE version: %a` – DavidPostill – 2015-07-15T08:59:03.0831Also the registry can be exported to a plain text file ...
reg export ...
– DavidPostill – 2015-07-15T09:05:23.5871To my way of thinking, it's ironic that the Registry is basically just another file-system in it's own right. Keys are like directories, values are like files. I wish MS implemented the Registry as a set of known directories and text files (perhaps under the Windows directory), it would have made things easier. I imagine in the old days of FAT-based storage it wouldn't have been efficient or scalable to do so. – misha256 – 2015-07-15T09:05:57.843
1Registry is a database and this looks like "why everyone uses db instead of xml/ini"? Otherthan not (directly) human-readable, a database/registry is miles ahead of plain text/xml files. You just need a right tool -- a proper PE build. – Chris.C – 2015-07-15T09:29:45.270