1
votes

I am using breezejs in a offline first manner, executing query’s initially against a server and stashing the entities in local storage where I query the entity manager cache.

When data changes on the server (by means of another app changing it using breeze) the client app synchronizes by just getting a new copy of the entities from the server.

This works great but I am wondering if there is a way that I can get only the changes from the server, I was thinking maybe set a revision GUID or timestamp on each record and then checking the metadata if it needs updating but I really have no idea on how to proceed.

So my question is can breeze be tweaked to allow for such a use case?

And is there maybe a beter way that I am overlooking?

1
Wouldn't it take even more time to go through all of the entities and find which ones are different? Why not just return all of them and let Breeze decide which ones need to be updated? - PW Kad
I hear what you are saying, but I was thinking in terms of saving bandwidth by just getting changes and not the hole entity. - qorsmond

1 Answers

1
votes

I think your direction is correct .If you had a column with a TimeDate in every table e.g "LastModified" and that column would get updated on every record update. then you could add a filter to every breeze query after the first that says that that date must be later than the last time you did this "rebase" query or the initial loading. so It's not supported out of the box, but you can get it to work yourself. the guid per version will not really be a good idea, as you will have to send all these guids on every request, and then check all of them. time stamp makes more sense.