Our application has many configuration directives. Things like "are multiple languages enabled?" or "which CSS template should be used?" or "how many items should be shown per page?".
We need to store the configuration directives in DB. Currently we have table for each "area" of configuration and the table has only one row containing the values in columns. This approach allows us to put constraints on the values - let it be ENUM, INT, VARCHAR, etc. But it's huge PITA when we need to add new config directive -- we need to update and redeploy DB schema. It also pollutes the table space with many setup_something tables.
My idea was to replace the tables with MySQL based key-value store (we use shared hosting with little configuration options, so we cannot use NoSQL). Some of the values MAY depend on locale or other variables, but I think that it can be solved by something like fallback (find key begining with "lang:fr" and if not found try one begining with "lang:default" (which will be always ready).
The constraints would be checked only in PHP using concrete setup classes, but there will be no DB checks.
- Are there any ready-made solutions for this (prefferably working well with Zend Framework).
- What are the pitfals of this solution (except the obvious - that I can't fetch the whole "row" at once or many rows at once - which is not a problem)
- [Have you used|Would you use] similar solution or something completely different?