6 ms·
I like that the configuration language is a sqlite database; sounds far easier than parsing ini files, for example.
by lsb 16y ago
I like that the configuration language is a sqlite database; sounds far easier than parsing ini files, for example.
- rincewind 16y agoini files are 1. a straw man. The Format is very generic, only sections and key-value-pairs. A fairer comparison would be against httpd.conf, or other languages actually used for web server config. 2. Easy to parse, because there are tony of implementations already. 3. Static, like a SQL database, although Zed[1] and others[2] argued we need Turing-complete extension and configuration languages like Ruby. [1] http://vimeo.com/2723800 http://vimeo.com/2723800 [2] http://lambda-the-ultimate.org/node/3606 http://lambda-the-ultimate.org/node/3606
- awt 16y agoAn even fairer example would be ngnix.conf
- rlpb 16y agoHe says that a config file is half-turing, but an sqlite database can have no turing. Won't this make the configuration far more complex?
- mdg 16y agoJust wait till someone uses an ORM library for configuration.
- rlpb 16y agoBut how would one represent a configuration like "don't require auth for /, but do require auth for /foo/*.jpeg" in a table? It would be great to just use a row for each possible URL, but with overlapping wildcards, folder hierarchies and multiple levels of allow/deny it gets very complicated very quickly. Granted, the allow/deny and order that Apache uses isn't great, but at least a configuration is understandable by reading it because the admin can lay out the configuration file with whitespace and comments in a way that makes sense. The equivalent might be achievable in sqlite, but it would be very challenging. It's basically a step backwards towards a poorly featured, confusing GUI configuration mechanism like the old IIS configuration used to be.
- grandalf 16y agowell you could always just represent it as: insert into rules (rule) values('don\'t require auth for /, but do require auth for /foo/*.jpg') The use of a db is more to create a standard networkable interface for other clients to read/modify the config than a statement about the semantics of the config syntax.
- rlpb 16y agoYou could do that, but would it really be much different from this? data = config_file.read() "insert into config (config) values ('%s')" % data
- rue 16y ago> But how would one represent a configuration like "don't require auth for /, but do require auth for /foo/.jpeg" in a table?* Are you confusing offline representation with a runtime structure?
- mdg 16y agoI was only being half serious (or half joking, depending on how you look at it).
- viraptor 16y agoI don't like that idea, because of one simple limit. You cannot diff databases (easily). Of course you can dump them, make sure the linebreaks are there between records, make sure they're sorted, etc. etc. But checking the whole config in or out of a VCS is much more useful in general. It also provides an easy to browse record of changes.
- stcredzero 16y agoIf diffing is important, why not use Git as the repository back-end, then?
- viraptor 16y agoIt doesn't matter which VCS. If you check in text, you can review the changes. If you checkin databases, all you get is a blob. Git is not magic and will not solve this problem.
- wizard_2 16y agoThe sqlite database might get stored as a blob, but a json, xml, or sql dump of the database would be just as plain text as anything else.
- adamtj 16y agoThink of it like this. Zed is combining Apache's nonstandard configuration language with it's internal runtime representation of such. He's doing it in a way that's standard and manipulable at runtime. So changes to the runtime configuration are persistent. You can fix that. That's the beauty of it. It's an incredibly simple and flexible idea that builds upon existing, robust, and standard software. If you want to diff config files, then you could slap together an XML, JSON, or any other representation of your config data and write a loader for it.
- stesch 16y agoIsn't reading from sqlite all the time a bit bad for the performance?