SQL Tables for Querying
TBD
Asynchronous Update of Content
To copy annotations to the query tables, the system leverages the asynchronous worker mechanism described here. As shown in the diagram below, when creating, updating or deleting a SubmissionStatus object, the repository services locks the SubmissionStatus etag as well as the Evaluation-SubStatus etag for update, updates the SubmissionStatus content, and queues a Change message. The Change message contains the evaluation Id, but not the Submission ID, i.e. it does broadcast which SubmissionStatus has been changed.
The Change message triggers the Annotations worker, which runs asynchronously with respect to the Client's request. It checks that the etag in the message matches the one in the repository service, to prevent against acting on "stale" Change messages. If the etags match, it runs a diff between the true state of the Evaluation's submission annotations (stored in the SubmissionStatus tables) and the state within the annotation query tables. Any differences are corrected in a single transaction.
Batch Updates