new middleware-style keydb