Queue database engine