db replication: build out of initial replication functions for use with deferred.defer.