Question

Lets say I have two tables task and person.

//Create related data
todoDB.Todos.add({ 
    Task: "Your task", 
    Person: new Person({Name: 'Peter'});
});
todoDB.saveChanges();

I'm trying to implement a way of keeping all the client and server data in sync.

Lets say I changed the schema of person and need to rebuild that table --> I drop person and rebuild it with the new schema.... re-populate it with data including a person with name=Peter. Will "Your task"'s person attribute still link to that same person, or will that attribute need to be rebuilt. I plan use an id attribute in reality and not name, and Id will be a key value.

Was it helpful?

Solution

If your sync happens only one-way direction, you can use the IDs from the server, but if you create entities on the client and you want to sync back to server, the GUID reference types are the way to go to have the same identifiers on the client and the server without conflicts.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top