Best method of keeping data in Sync

I have a system comprising of SQL Server, Couchbase server and Couchbase Mobile. Data flows first from SQL Server to Couchbase server and then using the sync gateway, the data is replicated to mobile. I know that records on the Sync gateway have an auto updated revision id but what would be the best way to know which records to send back up to SQL Server from mobile and vice versa. Because I don’t want to be replicating all the documents from both sides every time. Only the new ones or those that have data changed.