An NDB model contains two properties: email
and password
. How to avoid adding to the database two records with the same email
? NDB doesn't have UNIQUE option for a property, like relational databases do.
Checking that new email
is not in the database before adding—won't satisfy me, because two parallel processes can both simultaneously do the checking and each add the same email
.
I'm not sure that transactions can help here, I am under this impression after reading some of the manuals. Maybe the synchronous transactions? Does it mean one at a time?
See Question&Answers more detail:os