Algorithms

JSON Merging with Verification

The server receives 2 separate JSON files each session: 1 from the Kinect, and 1 from the Apple Watch.
We need to merge the JSON files received by the server before displaying them.
We wanted to make sure that if any part of the system failed, no past sessions could be overwritten and we could not merge two files from two different sessions.
We started by choosing to delete the received JSONs after they'd been merged, but we were worried that if the system crashed before the files got deleted, it wouldn't be enough.
To remedy this, we added a user-entered session ID that needs to match in both JSON files in order for the merging process to happen:


The main problem with this algorithm is the introduction of the possibility of user error: if the user does not type the session ID properly, it could cause merging issues.