Database framework