Implementaiton of core database engine