update db for replication

Add replication API for db