tags:

views:

175

answers:

4

If i want to develop a registry-like System for Linux, which Windows Registry design failures should i avoid?
Which features would be absolutely necessary?
What are the main concerns (security, ease-of-configuration, ...)?

I think the Windows Registry was not a bad idea, just the implementation didn't fullfill the promises. A common place for configurations including for example apache config, database config or mail server config wouldn't be a bad idea and might improve maintainability, especially if it has options for (protected) remote access.

I once worked on a kernel based solution but stopped because others said that registries are useless (because the windows registry is)... what do you think?

+3  A: 

the first one that come to my mind is somehow you need to avoid orphan registry entries. At the moment when you delete program you are also deleting the configuration files which are under some directory but after having a registry system you need to make sure when a program is deleted its configuration in registry should be deleted as well.

Numenor
Exactly. If your data structure's size is monotonic-increasing (like the Windows registry), then the whole operating system will need to be reinstalled occasionally just to get rid of the junk. That's a pretty lame design.
Jeffrey L Whitledge
Ok, i see the problem and agree that it really is one. It would be neccessary to change package managers so they remove the key-tree on deletion or i'd have to add an expiry date (Key expires after 30 days unless accessed in the mean time) like HTTP cookies. Good point.
dbemerlin
How are configuration files going to solve this? Sure, the package manager can remove system-wide files, but plenty of junk will remain in users' home directories.
Thomas
Yes, configuration files in home aren't solving it. The home on my server (more of a remote development and experimentation system) includes directories and files like .irssi, .tmp, .sqlite_history, .usermin, .wapi, .cpan for which i can't even remember when i used those programs (timestamps say about 2 years ago) or what the folder ever was for (.tmp? .wapi?). Half of the programs aren't even installed anymore. A registry might worsen it but the problem already exists.
dbemerlin
+5  A: 

If you must have a single repository, at least use a proper database so you have tools to restore, backup, recover it etc and you can interact with it without having a new set of custom APIs

Martin Beckett
+5  A: 

I once worked on a kernel based solution but stopped because others said that registries are useless (because the windows registry is)... what do you think?

A kernel-based registry? Why? Why? A thousand times, why? Might as well ask for a kernel-based musical postcard or inetd for all the point it is putting it in there. If it doesn't need to be in the kernel, it shouldn't be in. There are many other ways to implement a privileged process that don't require deep hackery like that...

If i want to develop a registry-like System for Linux, which Windows Registry design failures should i avoid?

  • Make sure that applications can change many entries at once in an atomic fashion.
  • Make sure that there are simple command-line tools to manipulate it.
  • Make sure that no critical part of the system needs it, so that it's always possible to boot to a point where you can fix things.
  • Make sure that backup programs back it up correctly!
  • Don't let chunks of executable data be stored in your registry.
Donal Fellows
Kernel based because this would allow: 1. Filesystem based access (like /proc or /sys). 2. To read the configuration on boot time so it would allow operating system based settings. 3. Tighter control for security (A file on disk might be read without using the API). Still, i agree, a kernel module might be wrong but that was 3 years ago, shortly after i bought a book about developing modules for the linux kernel :)
dbemerlin
@dbemerlin You can use LUFS go generate a filesystem look without putting it in the kernel.
nategoose
+3  A: 

IMHO, the main problems with the windows registry are:

  • Binary format. This loses you the availability of a huge variety of very useful tools. In a binary format, tools like diff, search, version control etc. have to be specially implemented, rather than use the best of breed which are capable of operating on the common substrate of text. Text also offers the advantage of trivially embedded documentation / comments (also greppable), and easy programatic creation and parsing by external tools. It's also more flexible - sometimes configuration is better expressed with a full turing complete language than trying to shoehorn it into a structure of keys and subkeys.

  • Monolithic. It's a big advantage to have everything for application X contained in one place. Move to a new computer and want to keep your settings for it? Just copy the file. While this is theoretically possible with the registry, so long as everything is under a single key, in practice it's a non-starter. Settings tend to be diffused in various places, and it is generally difficult to find where. This is usually given as a strength of the registry, but "everything in one place" generally devolves to "Everything put somewhere in one huge place".

  • Too broad. Its easy to think of it as just a place for user settings, but in fact the registry becomes a dumping ground for everything. 90% of what's there is not designed for users to read or modify, but is in fact a database of the serialised form of various structures used by programs that want to persist information. This includes things like the entire COM registration system, installed apps, etc. Now this is stuff that needs to be stored, but the fact that its mixed in with things like user-configurable settings and stuff you might want to read dramatically lowers its value.

Brian