Alice and Bob have two sets of ~10000 pieces of data (each smaller than 65536 bytes, usually much smaller), each with a 12-byte ID (timestamp + CRC32). They both would like to have a union of these sets. Their sets only differ slightly: perhaps Alice or Bob gained 10 new pieces, so they'd better determine which pieces of data to send to each other and send only them.
Alice and Bob have established a TLS connection (with somewhat complex access control invonving client certificates and own CA). How do they carry out the replication?
So far, they've been:
- building an array of IDs
- using
librsync
to replicate it to the other party - the other party, having both arrays, would determine the appropriate actions and send/request missing data pieces
If the connection breaks, they account for any pieces of data already received and restart the procedure until no changes need to be sent.
Is there a better way to do that? An existing protocol, maybe?