Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Putting the same resource that already exists should not result in a change #44

Open
abalmos opened this issue Feb 12, 2020 · 2 comments

Comments

@abalmos
Copy link
Member

abalmos commented Feb 12, 2020

OADA should compute the difference between the put body and the existing result. Empty diffs should translate into a no-op, not update rev, nor create a change. This would make writing data sync microservices much easier / correct.

@aultac
Copy link
Member

aultac commented Feb 15, 2020

I think that would add a decent amount of overhead, especially for larger documents for which you are only updating a small portion. Maybe it could compare the current body with the current rev's change document instead? i.e. if it is an exact repeat of the previous change, then it is most likely a duplicate to be discarded?

@abalmos
Copy link
Member Author

abalmos commented Feb 17, 2020

I think getting the resource and saving a smaller patch is likely to be an overall save on processing as compared to committing an unnecessarily large change document (and, as currently written, committing the same document to the resource node too). It is also much smaller than many watchers GETting the full resource as the result of a small change. Finally, it seems too early to be worrying about performance over function. As is a common function is quite unfriendly and significantly complicates syncer services.

This should be somewhat "easy" to implement if we use what is already existing. They could be some issues around concurrency. Something like: https://www.npmjs.com/package/fast-json-patch 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants