Re: [google-appengine] How to prevent overwriting an entity simultaneously?

2013-10-19 Thread Alejandro González Rodrigo
In few words: whats you need are transactions.

Transactions are there to solve your problem. stop making rutines and
subrutines to solve a problem that si already solved.

Using a framework usually mitigates the learning curve. I don't know if you
are already using a framework or library to handle datastore stuff or if
you are using Java, phyton or PHP but you have a lot of examples out there.

If you give us more info about technologies and librareis used maybe we can
give you some code or links to good tutorials to solve your problem or
learning about transactions.

Cheers.


El sábado, 19 de octubre de 2013, Kaan Soral escribió:

> I've implemented routines to handle contention at a large level, a custom
> pipeline implementation, there also also basic checks to prevent
> overwriting an entity.
>
> However there are some operations that require no overwrite to occur, for
> example:
>
>- Signup related updates, email, external_user_id etc
>- Email verification
>- User information updates
>
> When these get overwritten by another update simultaneously, it creates a
> really disturbing experience
>
> I've done a lot to prevent these, yet they do still happen rarely, and by
> rarely it seems >1%, a lot
>
> My plan is to dive into more custom routines to implement "make sure"
> routines / prevention routines
>
> I'm wondering whether there is something really basic I'm missing that
> achieves what I want to do
>
> For example I've never used transactions, without actually using it,
> learning from the use cases, the documentation of transactions were
> meaningless to me
>
> I would appreciate any advice
> (I'm also extremely unlucky, or lucky, tested my new app with ~10 users,
> all of them experienced unique problems, some issues that occurred probably
> have <1/1 probability of occurrence, a user triggered a second signup
> request, probably by page refresh, it would only cause an issue if the last
> part of the routine would execute around the same millisecond, and it did)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-appengine+unsubscr...@googlegroups.com  'cvml', 'google-appengine%2bunsubscr...@googlegroups.com');>.
> To post to this group, send email to 
> google-appengine@googlegroups.com 'google-appengine@googlegroups.com');>
> .
> Visit this group at http://groups.google.com/group/google-appengine.
> For more options, visit https://groups.google.com/groups/opt_out.
>


-- 
Alejandro González 
+34 666 57 79 13



If you have a dream * we can write the *
code 

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [google-appengine] How to prevent overwriting an entity simultaneously?

2013-10-19 Thread Gopal Patel
Simplest is to do it in task queue in sequence
On Oct 19, 2013 7:45 PM, "Kaan Soral"  wrote:

> I've implemented routines to handle contention at a large level, a custom
> pipeline implementation, there also also basic checks to prevent
> overwriting an entity.
>
> However there are some operations that require no overwrite to occur, for
> example:
>
>- Signup related updates, email, external_user_id etc
>- Email verification
>- User information updates
>
> When these get overwritten by another update simultaneously, it creates a
> really disturbing experience
>
> I've done a lot to prevent these, yet they do still happen rarely, and by
> rarely it seems >1%, a lot
>
> My plan is to dive into more custom routines to implement "make sure"
> routines / prevention routines
>
> I'm wondering whether there is something really basic I'm missing that
> achieves what I want to do
>
> For example I've never used transactions, without actually using it,
> learning from the use cases, the documentation of transactions were
> meaningless to me
>
> I would appreciate any advice
> (I'm also extremely unlucky, or lucky, tested my new app with ~10 users,
> all of them experienced unique problems, some issues that occurred probably
> have <1/1 probability of occurrence, a user triggered a second signup
> request, probably by page refresh, it would only cause an issue if the last
> part of the routine would execute around the same millisecond, and it did)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-appengine+unsubscr...@googlegroups.com.
> To post to this group, send email to google-appengine@googlegroups.com.
> Visit this group at http://groups.google.com/group/google-appengine.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.


[google-appengine] How to prevent overwriting an entity simultaneously?

2013-10-19 Thread Kaan Soral
I've implemented routines to handle contention at a large level, a custom 
pipeline implementation, there also also basic checks to prevent 
overwriting an entity.

However there are some operations that require no overwrite to occur, for 
example:

   - Signup related updates, email, external_user_id etc
   - Email verification
   - User information updates

When these get overwritten by another update simultaneously, it creates a 
really disturbing experience

I've done a lot to prevent these, yet they do still happen rarely, and by 
rarely it seems >1%, a lot

My plan is to dive into more custom routines to implement "make sure" 
routines / prevention routines

I'm wondering whether there is something really basic I'm missing that 
achieves what I want to do

For example I've never used transactions, without actually using it, 
learning from the use cases, the documentation of transactions were 
meaningless to me

I would appreciate any advice
(I'm also extremely unlucky, or lucky, tested my new app with ~10 users, 
all of them experienced unique problems, some issues that occurred probably 
have <1/1 probability of occurrence, a user triggered a second signup 
request, probably by page refresh, it would only cause an issue if the last 
part of the routine would execute around the same millisecond, and it did)

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.