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

Improve atomicity of operations #13

Open
mitar opened this issue May 19, 2012 · 1 comment
Open

Improve atomicity of operations #13

mitar opened this issue May 19, 2012 · 1 comment

Comments

@mitar
Copy link
Member

mitar commented May 19, 2012

Current implementation is really badly implemented as it is based on code which assumes transactions. For MongoEngine (and MongoDB) this is of course not true, so some improvements to operations should be done to implement them through atomic operations. And not through current fetch-update-save cycle.

Even worse is for subresources (lists), especially because we use indexes so things could move around and something would not be anymore on its place. You want to delete n-th element, but that element could be already something else at the time it is processed. Maybe we should introduce some dummy UUID/PKs to make sure we know what we are operating on. Operations on subresources should be really implemented through MongoEngine/MongoDB atomic operations on list and not changing list in the code.

@mitar
Copy link
Member Author

mitar commented Mar 29, 2013

Tastypie has some update_in_place function now. Is this the place to use MongoDB atomic operations to update documents?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant