Minimalistic DB abstraction layer with replication support (master preference detection, per-user slave up-to-date check etc.)