tbh .. I recommend getting MWL's ZFS storage books for a more complete ZFS base ..
https://mwl.io/nonfiction/os. chapter 4 in the advanced book goes over replication specifically.
In a nut shell .. replication allows you to create an exact backup of an entire dataset or zvol .. it doesn't matter if its on the same machine, same network or across the internet .. there are several advantages such as zfs only sends changed blocks, so its very fast and super efficient compared to rsync.. most of the time it may take rsync a few mins just to generate a list of files to send .. in that time zfs is done.
replication, snapshots and the combination of commands that are needed are controlled by zfs properties .. essentially you delegate access to the datasets and assign permissions as needed. then run simple zfs commands
replication has a few basic use cases ..
you can replicate a data set, ie make a backup of the entire data set somewhere else .. a good example .. I have a laptop with a 1tb drive .. when ever I join my wifi part of the process checks a 1tb dataset on my file server . if essentially checks for changes.. if the laptop is out of date it does a receive .. if the backup is out of date it sends the changes to the store ..
********
DO NOT COPY PASTE commands they are for example only.. as well I highly recommend going through those books and actually mapping out datasets, pools and zvols .. this is a super basic example .. a life production system will be MUCH more complicated, but the concept is the same.
********
behind the scenes
I created a replication user on the laptop and server .
local: pw user add replicator -m -s /bin/sh
remote: pw user add replicator -m -s /bin/sh
zfs allow -u replicator send,snapshot zroot/backup/bsd-laptop-42
su replicator
ssh-keygen
ssh-copy-id -i .ssh/id_rsa.pub bsd-laptop-42
then on the server something like
zfs create -o mountpoint=/backup zroot/backup
chown replicator:replicator /backup
sysctl vfs.usermount=1
if your automating the process you may consider adding destry so it can clean up after itself.
then allow the user
zfs allow -u replicator compression,mountpoint,create,mount,recieve zpool/backup
you could also manually do the same thing once permissions are configure with something like this
zfs send zroot/usr/homedirectory@2020-02-26_06.15.00--2d | ssh user@host zfs receive remotepool/backup
so in summary
you create your storage datasets, give user permissions to it.. generally the first time you would copy the entire data set into the target backup.. then on the machine you want to replicate you use a snapshotting tool like zfSnap and zfs send your snapshots to the storage server.
this is also incredibly handy for replication offsite .. for example the cost is minimal to replicate to tarsnap
again, highly recommend the MWL books as a solid base ..
cheers