Also, In addition to the other suggested solutions, classic UNIX dogma includes signals. You could add a signal handler to your code. That re-reads and applies the configuration info stored in db. The hangup signal is, by tradition, usually chosen for reloading configs.