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

Already on GitHub? Sign in to your account

Improve atomicity of operations #13

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

Comments

Projects
None yet
1 participant
Owner

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.

Owner

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