Database abstraction layer