Refactor buddy db code to use runtime feature flag