As far as I know, the main problem here is how to cache the configuration, keeping it mostly updated when it changes.
Well, the best option here is obviously to store it in a database and update from the database, say, every 15 seconds. Having a large load on the application, a query to the database every 15 seconds will not change anything. Loading data from the database is pretty fast, since you only need a couple of fields.
Another option that may work here is to use a separate memcached :) Seriously, just cache the configuration downloaded from the database by clearing this cache key when updating the configuration.
To summarize: any temporary expiration scheme will work. The simplest solution is to maintain it yourself (keep the latest update time and check it with every function call); a bit more advanced - use something like memcached.
update : DB is the best solution, because it scales quite well: you do not need to copy configs to 20 servers with every configuration update.
source share