add scratch db class

Signed-off-by: wenpin.cui <wenpincui224@gmail.com>