Skip to content
Shai Gabai edited this page Oct 9, 2017 · 11 revisions

Jacksync

Creating and applying sync patches (sync, merge, patch, diff)

Jacksync provides a library for synchronization by producing and applying a JSON patches to Java objects. Inspired by RFC 6902 (JSON Patch) and RFC 7386 (JSON Merge Patch) written in Java, which uses Jackson at its core.

Features overview

  • synchronization - enables an efficient data synchronization between clients and masters (or any set of nodes that share a resource).
  • allows you to update a JSON document by sending the changes rather than the whole document.
  • RFC 6902 (JSON Patch) - add, remove, replace, move, copy, test.
  • RFC 7386 (JSON Merge Patch) - merge patch document.
  • JSON "diff" with two optional strategies:
  • enables simple commit and audit all JSON Patch changes in your data, and later on browse the detailed change history.
  • enables "reverse" patches using diff processor.

Jacksync Data Structure

  • version - client received version.
  • masterVersion- master version after committing all patch operations.
  • targetChecksum - target object after applying all patch operations.
  • operations - all patch operations.
{
	"version" : 5,
	"masterVersion" : 6,
	"targetChecksum" : "Checksum",
	"operations" : [
		{ "op" : "replace", "path" : "/title", "value" : "How To Use Sync Jacksync Data" },
		{ "op" : "add", "path" : "/author", "value" : "shagaba" },
		{ "op" : "add", "path" : "/tags/3", "value" : "sync" },
		{ "op" : "replace", "path" : "/version", "value" : 6 },
		{ "op" : "test", "path" : "/version", "value" : 6 }
	]
}