create and sync database