database layer and server