abstract db and log