media-insights-on-aws
media-insights-on-aws copied to clipboard
Improve isolation of users editing data in the application
For edit flows, the VOD Subtitle Application is a single user.
Right now, intermediate edits for subtitles are stored in the MIE data plane as operator results (via the front end calling MIE storage APIs). MIE doesn't provide any locking mechanism outside of workflow executions (i.e. only one workflow can execute on the same asset at a given time). Since edits occur outside a workflow, the application is implementing a crude locking mechanism by blocking edits while a workflow is running on an asset.
Other possible solutions:
- pessimistic locking on workflows (either by starting a workflow for editing or implementing a separate locking system). Pessimistic locks would need to timeout eventually to handle abandonment from web app users. We have the wait part of this available by using the Wait operator. But, we would need to be able to implement a reasonable timeout mechanism. Or, just create an entirely separate lock service for MIE objects.
- optimistic locking on edits - versioning is checked on save of edits and fail if a new version was added. This could be implemented by storing intermediate edits in a separate back-end table with a version attribute and update constraint.
- merge edits - show edits from multiple users working on a document at the same time. Not sure how to implement this.
Step functions offers another possible solution for locking assets: https://aws.amazon.com/blogs/compute/controlling-concurrency-in-distributed-systems-using-aws-step-functions/