Revert "Revert "Database""

This reverts commit 2335788c105a88348f31c6d24be6591d177bcff5.