What happens when multiple people edit the same record at the same time?

When two or more people edit the same record at the same time, the edits are written in chronological order based on the time that each user pressed save.  

In the unlikely event that multiple users save the same item at exactly at the same time, Crisisworks implements a back off algorithm to convert simultaneous writes into a sequential queue using a randomised retry approach.

The result of a simultaneous edit is that all changes by all users are recorded into the audit history, and the most recent save becomes the current values of the record.

Scenario one: multiple users editing different parts of the record

Crisisworks intelligently compares the proposed data against the existing record in the database and only processes the changes, which means that multiple users working on the same record at the same time will not conflict with each other if editing different fields.

Scenario two: multiple users adding sub-records to the same record

When adding sub-records (such as adding new affected people into an existing recovery case record), both saves will successfully create new records, and this will result in a duplication of records if the new records independently contained the same data. Crisisworks has a merge feature to clean up data duplication. 

Scenario three: users editing the same fields of the record

When editing the same fields, Crisisworks records the changes sequentially, so the edit processed last will be the final value on the record, and all values will appear in the audit log as prior versions.

Although uncommon, it is possible that the server may block processing a user's save if this results in an inconsistency — for example, if two users change the status field, and the second user's status value results in an incompatible change following the first user's save, then the server will return an error message to the second user and ask them to select a different status. 

Scenario four: Offline edits via the mobile app

When editing records offline via the mobile app, the saves are processed in the order they are received at the server (i.e. when the device reconnects), even though the edit itself will be back-dated to the time the user originally pressed save in the field.

Example

To illustrate, let's assume two users are editing the same case at the same time.

If they both work together as a team and are working on different parts of the case and change different things then there will be no overwriting of data the data will be nicely “merged” together.

  •  at 12:01 Fred set YYY to Severity
  •  at 12:02 Mary set ZZZ to Priority

If they both edit the same field like “Damage Summary”, both transactions will succeed but the 2nd save will update the value of the first save.

  •  at 12:01 Fred added YYY to Damage Summary
  •  at 12:02 Mary changed Damage Summary from YYY to ZZZ

If they both add one “related data item” e.g. a recovery need/task, then there will be 2 needs & tasks added to the case.

  •  at 12:01 Fred added Fred Smith to Affected Persons of Case 123
  •  at 12:02 Mary added John Smith to Affected Persons of Case 123