Search code examples
simperium

Atomic changes with Simperium?


Is there a way to ensure an ordered atomic change set from Simperium?

I have a data model that has complex relationships associated. It seems looking over things that it is possible for the object graph to enter in an invalid state if the communication pipe is severed. Is there a way to indicate to Simperium that a group of changes belong together? This would be helpful as the client or server would prevent applying those changes unless all the data from a "transaction" is present thus keeping the object graph in a valid state.


Solution

  • Presently it's expected that your relationships are marked as optional, which allows objects to be synced and stored in any order without technically violating your model structure. Relationships are lazily re-established by Simperium at first opportunity, even if the connection is severed and later restored.

    But this approach does pass some burden to your application logic. The code is open source, and suggestions for changes in this regard are welcome.