cancel
Showing results for 
Search instead for 
Did you mean: 

SMP replication management

0 Kudos

Hi all,

we developed our first iOS prototyp application with SUP 2.2. This application only

provide information without a CRUD (Create/Update/Delete) functionalty. Now we

are planning to make the next step, which means to implement such a CRUD -

functionality.

So the "doing" of the implementaion is basically clear. Currently, our considerations

go in for the replication of data.

For example, device A is changing a set of data while device B is changing the same

data set in the same time. Which changes will replicate to the backend ?

Or another example, what happen when a device change data offline and meanwhile

the set of data where deleted from a online device or a backend user ?

 

May be there are something like a replication management ?

Does somebody know something about this in the SMP ?

Regrads,

max

Accepted Solutions (1)

Accepted Solutions (1)

midhun_vp
Active Contributor
0 Kudos

What Jithendra assumed is wrong.

SUP is managing the scenario you mentioned as given below:

Lets say there are 2 devices, Device A and Device B. And a Backend DB with a data field "name". In that name lets say the data is "Sachin". Now in both devices the value "Sachin" is available.

In the devices two copies of data will be maintained. old_value and new_value. Now in both the devices old_value and new_value will be "Sachin".

From Device 1 the value is going to be changed from "Sachin" to "Dravid". So now the old_value will be "Sachin" and new_value will be "Dravid". Once the user request an operation to change the value from the device SUP will do a check whether the data in Backend DB and the old_value are same.

In the backend DB the value is "Sachin" and the old_value in the Device 1 is also "Sachin". So the condition is satisfied and the operation will be performed. As a result the value in the Backend DB will be changed from "Sachin" to "Dravid".

Now consider the Device 2. In that the old_value and new_value is "Sachin". From Device 2 the user want to change the value from "Sachin" to "Ponding". Once the user request for the change, SUP will check whether the old_value in the device is same as the value in the Backend DB.

In the current state the old_value("Sachin") is not equal to the value in the Backend DB ("Dravid"). So the SUP will give the exception.

- Midhun VP

Answers (2)

Answers (2)

0 Kudos

Thank you for the information, it was very useful.

So in summary, first come first served at the backend and after that it works like Midhun explained ?

I got another question, the old_key from the backend, does the SUP take this value directley from

the backend or will be the cached value used ?

midhun_vp
Active Contributor
0 Kudos

So in summary, first come first served at the backend and after that it works like Midhun explained ?

Yes


I got another question, the old_key from the backend, does the SUP take this value directly from

the backend or will be the cached value used ?

The old_key I mentioned is the one stored in the device DB. This value will be compared with the respective key value in the SAP before performing the operation.

Hope you that helps.

- Midhun VP

0 Kudos

Thank you, this helps a lot.

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

HI Max,

for 1st scenario,

since you are doing changes in same data from 2 different devices and making sync request at same time. what i believe is there would a different of few milisec for reaching the data at backend.

which ever reqeust goes at last would be final one.

for 2nd scenario,

for example you are changing in customer name (working offline) but that customer name has already been deleted from backend. when you try to sync that changed customer name from device, it will look for primary key for that customer but in real that PK is not available at backend. you might get sync error/app might crash.

Regards,

Jitendra