Live data from Hacker News

Why the Windows Registry sucks technically (2010)

rwmj.wordpress.com

51–60 of 342 posts

Re: Why the Windows Registry sucks technically (2010)

#51

>The Registry binary format has all the aspects of a filesystem: things corresponding to directories, inodes, extended attributes etc. Like? Always thought it was an hierarchical database.

>> The Registry binary format has all the aspects of a filesystem: things corresponding to directories, inodes, extended attributes etc. > Like? Always thought it was an hierarchical database. A filesystem is a hierarchical database.

I probably miss something then. The article also states that it is not a database.

Re: Why the Windows Registry sucks technically (2010)

#52

Earlier quoted context omitted.

It sounds you misunderstood at least parts of the article. The ext3 comparison doesn't support or dismiss anything, it's to explain how there can be a filesystem in a file. They then go ahead and say how it could be a good single-file format if it were more database-like instead of filesystem-like. Other criticism of the format clearly take into account that it's a historically grown format which explains some of its…

I didn't misunderstand anything. I read this in 2010 and just re-read it. The ext3 example is used exactly as I describe, to hand wave away "having a file system in a single file" as a criticism and just move on to talking about nitpicks with the Registry's implementation of a filesystem in a file, while ignoring that all of the problems with the registry spawn from the choice to have it be a filesystem in a file. Th…

> while ignoring that all of the problems with the registry spawn from the choice to have it be a filesystem in a file.

The whole point of that paragraph is that the problems it has as a filesystem do not spawn from the choice of having a filesystem in a file.

Re: Why the Windows Registry sucks technically (2010)

#53
post #39

A point being overlooked by article and commenters: the records in the registry probably use in the order of 10-100 bytes each, while every actual file takes up at least around 1024 (EDIT: maybe more like 4096?) bytes. Putting tiny 'files' into a special format is a no-brainer on the older computers that existed when the Registry was first created. I am assuming this was one of the motivations to create the Registry…

Nobody in their right mind would put every field into a separate file though. (Yes, I do know about qmail.)

Re: Why the Windows Registry sucks technically (2010)

#54
post #32

I really appreciate when people use technical facts to criticize something, like with this. It is a well written take-down of the implementation of the Windows Registry as of both today and 2010. I suspect if the concept of the registry was created today it would look more like a database (e.g. Sqlite), although organizing it like a virtual FileSystem does have a certain appeal, and unfortunately I don't know of a da…

> and there's no format agnostic API to access that information (you can open it, but can you understand it?). One of the critiques in this article is that, because you have to know/guess/assume what encoding is used for various strings, there isn’t one for the registry, either. If so, both approaches suffer from that (but Unix a bit more because it tends to store multiple items under a file system ‘key’, while Windo…

I do wonder what RegEdit.exe does here. Does it infer encoding, have a long list of key-to-encoding mappings, or a combination of the two?

I did a bit of experimentation on this too and we think it has a heuristic to guess encodings of strings. (Which to be fair isn't a terrible idea - it's very easy and almost entirely reliable to determine if a string is ASCII/UTF-8 or UTF-16LE which are the major encodings found.)

Re: Why the Windows Registry sucks technically (2010)

#55
post #39

A point being overlooked by article and commenters: the records in the registry probably use in the order of 10-100 bytes each, while every actual file takes up at least around 1024 (EDIT: maybe more like 4096?) bytes. Putting tiny 'files' into a special format is a no-brainer on the older computers that existed when the Registry was first created. I am assuming this was one of the motivations to create the Registry…

Extracted from the "Rationale" section of https://en.wikipedia.org/wiki/Windows_Registry

1) Since file parsing is done much more efficiently with a binary format, it may be read from or written to more quickly than a text INI file.

2) Strongly typed data can be stored in the registry, as opposed to the text information stored in .INI files.

3) Because user-based registry settings are loaded from a user-specific path rather than from a read-only system location, the registry allows multiple users to share the same machine, and also allows programs to work for less privileged users.

4) Backup and restoration is also simplified as the registry can be accessed over a network connection for remote management/support,

5) It offers improved system integrity with features such as atomic updates.

These points are mostly bogus IMO, but apparently this was their initial rationale for implementing it.

Re: Why the Windows Registry sucks technically (2010)

#56
post #14

Earlier quoted context omitted.

That was a deliberate attempt to make it impossible for competitors to read and write their format wasn’t it?

I attended a seminar on the office binary file formats about 10 years ago at MS. The reason it was done was for performance reasons, including the wonky layout that made it quicker to save and read the file from slow media like floppy discs.

I also remember reading about that somwhere, sometime... loading... ah, here it is: https://www.joelonsoftware.com/2008/02/19/why-are-the-micros...

> The file format is contorted, where necessary, to make common operations fast. For example, Excel 95 and 97 have something called “Simple Save” which they use sometimes as a faster variation on the OLE compound document format, which just wasn’t fast enough for mainstream use. Word had something called Fast Save. To save a long document quickly, 14 out of 15 times, only the changes are appended to the end of the file, instead of rewriting the whole document from scratch. On the hard drives of the day, this meant saving a long document took one second instead of thirty. (It also meant that deleted data in a document was still in the file. This turned out to be not what people wanted.)

Re: Why the Windows Registry sucks technically (2010)

#57

I really appreciate when people use technical facts to criticize something, like with this. It is a well written take-down of the implementation of the Windows Registry as of both today and 2010. I suspect if the concept of the registry was created today it would look more like a database (e.g. Sqlite), although organizing it like a virtual FileSystem does have a certain appeal, and unfortunately I don't know of a da…

AIX has a registry-like database for configuration called ODM that is like you’re describing.

Re: Why the Windows Registry sucks technically (2010)

#59
post #24

Earlier quoted context omitted.

Is there any "way" at all that doesn't suck though? Not having "a way" in this sense is more like a feature, a single source of truth works well if it really is treated as such by all actors. Configurations under unix are a mixture of stdin, config files, env variables and bespoke solutions. Under Windows, you have all of the above and on top of that the registry. Any attempt at a solution in this regard risks being…

On a more philosophical level, the Unix convention is the "liberal" one, giving application writers more freedoms. Liberty enables more flexible applications and more chaos at the same time. A highly structured approach might be beneficial in the short run, but it might prove to be burdening beyond its due date.

Application writers are free to use which ever format they choose on Windows, as well. The Registry is just yet another option -- Microsoft does not force developers to use it. I don't see the Unix convention as the more "liberal" one, here. It typically has _one less_ option.

Re: Why the Windows Registry sucks technically (2010)

#60

Earlier quoted context omitted.

> The UNIX way is undeniably more flexible since it isn't a virtual filesystem, it is just a filesystem. Unix simply doesn't have a "way" in that regard, other than a loose convention to put text files in "/etc". Every application comes up with its own format. Parsing that file is application-specific. Updating a value in a text file means re-writing the whole file again. It is a technically-inferior approach that ha…

> Unix simply doesn't have a "way" in that regard, other than a loose convention to put text files in "/etc". So? The registry doesn't have much of a way either - the actual fields are simply a loose convention. > Every application comes up with its own format. Same with Windows applications - one application might store an IP address as a dotted-octet string, another might store it as a single 32 bit integer. > Pars…

I can’t and shouldn’t be able to write to /etc as an ordinary or guest user.

Er-readying values isn’t done usually with apps.

You can get corrupted files if two instances fight for the same file. If that’s your thing, please use mongo. Also, please provide support to all the users.

Lastly, if you messed up certain configuration or data files, your system won’t boot either on ANY system.

Sounds like you’re just one of many anti-windows people, exactly what was pointed out about people bashing the registry.

Post reply on HN