Skip to Content

SMP replication management

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 -


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 ?



Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on May 21, 2013 at 08:51 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 17, 2013 at 12:22 PM

    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.



    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 22, 2013 at 06:22 AM

    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 ?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.