Add database support

Signed-off-by: Lance Chen <cyen0312@gmail.com>