Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Versioning tables to control attempted stale updates #30

Open
tristan3214 opened this issue Nov 13, 2020 · 0 comments
Open

Versioning tables to control attempted stale updates #30

tristan3214 opened this issue Nov 13, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@tristan3214
Copy link
Collaborator

With concurrent sessions we are likely to read data and have it become stale later on. When we have highly independent and isolated sessions then we can't easily notify these sessions when their data has gone stale. One way to solve this, is to simply add a version to the database tables. When you go to update a value we can check the table version and if there is a mismatch then read the new value and update again. Each update then gives a new table version. This can just be done for the tables where you expect you'll will need to read and update concurrently and avoid putting this extra work on tables you won't concurrently update.

Here is an example of how to do this in SQLAlchemy.
https://docs.sqlalchemy.org/en/13/orm/versioning.html

@tristan3214 tristan3214 added the enhancement New feature or request label Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant