abstracting db from server