Compare the registry and configure files
2009-07-17 02:53:45| 分类：
We all know there is a registry in Windows platform, and we all know that there is lots of configure files on Unix or similar systems, what's the difference? how about the advantage and disadvantage?
1, If you keeps all your configure information in one file(Such as registry does), it will be less safety, as this large file maybe broken down, or maybe deleted wrongly. When the applications need to access these information, how about the lock? Does the apps can access the configure info they have none privilege to read or write? If there is 2 process want to access the registry at the same time, how to resolve it? And, the format of different configure info will var largely form one to another, how to resolve this issue too? For example, the configure information for Apache, NFS, FTP, Iptables will not the same as Vim and Gdm, how should we design the format of the data? Seems really hard. If there is none solution but we still want to store all the info in only one file, we will cut the configurability of these applications, as the Microsoft Windows does.
But on the other hand, we will store almost all the information into Database in almost all the morden Enterprise systems, what's the difference? How could we known it's will be better when we stores all the info or data together?
2, There is also disadvantage for Unix configure files. All the apps need to read the and write the configure files themselves, but why write some library or some tool to do the file reading job?
And, is there really there is any difference between /etc directory and registry file? I think we can treat the /etc directory as a single file if we like, they have none difference, infect.
Of course, the good thing is that the application will be more configurable and more extensible, then the application will be more powerful.
Then, I really don't know which method is good and which is bad.....(This article have not finished, to be continue ....)
Please do not just say that registry is urgly as you hate Microsoft Empire, and also please don't judge the configure files as deadly complex enough to use just because of your lazy. We need to think about the difference between the two kinds of idea, then, we can get a more deeper understanding.
The ms registry is a rubbish, but we still need to think over why we don't store all the configure info or data into to a single database? which method is better and which is worse?
Of course, the answer is: File will be simple to use than database, it will cost less cup time and memory when we access a file than a database. And we need to maintain the configure info of the database itself, too. Then, why don't we try a more light weight database, similar as registry?
If we treat registry as a file(but i don't what registry really is, and not care about too), we still need to access this file via the C lib file operate functions. To keep the application extensible, we need to allow applications vary when they need, then, it's still need the application deal with the configure info itself. As we have a PCRE library and other libs, it's easy for the application deal with these info themselves, and there is none additional difficult than deal with the single configure file by some app dealing a single but whole configuration file.
If we like, we can treat the /etc directory as a single configure file, that will be ok.
There is an ugly feature on Unix too, why don't save the user configure file to ~/etc/*, as the system does, but saves them as ~/.* , just a history reason?
To compare the "separated unix configure files" vs "keeps data together for all the modern Enterprise system." when times free.