Re: [appengine-java] Re: elegant way of implementing sequence generator

2010-05-17 Thread Ikai L (Google)
Memcache is shared across your application instances. It's a separate
process.

On Fri, May 14, 2010 at 7:01 PM, Thomas  wrote:

> Hi Jaroslav:
>
> GAE is currently single-homed
> according to
> http://groups.google.com/group/google-appengine-java/browse_thread/thread/cccb943347b3c6a7/338eede3100f366
>
> On 5月14日, 下午7時41分, Jaroslav Záruba  wrote:
> > ...I just want to be sure. I had the impression that two 'my' JVMs
> > might not even reside in the same 'data-center', which would make the
> > sharing quite a challenge, at least according to my n00b measures. :)
> >
> > Regards
> >   J. Záruba
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>


-- 
Ikai Lan
Developer Relations, Google App Engine
Twitter: http://twitter.com/ikai
Delicious: http://delicious.com/ikailan


Google App Engine links:
Blog: http://googleappengine.blogspot.com
Twitter: http://twitter.com/app_engine
Reddit: http://www.reddit.com/r/appengine

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: elegant way of implementing sequence generator

2010-05-14 Thread Thomas
Hi Jaroslav:

GAE is currently single-homed
according to 
http://groups.google.com/group/google-appengine-java/browse_thread/thread/cccb943347b3c6a7/338eede3100f366

On 5月14日, 下午7時41分, Jaroslav Záruba  wrote:
> ...I just want to be sure. I had the impression that two 'my' JVMs
> might not even reside in the same 'data-center', which would make the
> sharing quite a challenge, at least according to my n00b measures. :)
>
> Regards
>   J. Záruba

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: elegant way of implementing sequence generator

2010-05-14 Thread Jaroslav Záruba
Does it mean Memcached === the Memcache we use within AppEngine?
I'm particularly interested in whether AppEngine Memcache is shared
among all the JVMs that have been started for my application. Based on
this I assume yes:
"High performance scalable web applications often use _a distributed_
in-memory data cache in front of or in place of robust persistent
storage for some tasks. App Engine includes a memory cache service for
this purpose."
...I just want to be sure. I had the impression that two 'my' JVMs
might not even reside in the same 'data-center', which would make the
sharing quite a challenge, at least according to my n00b measures. :)

Regards
  J. Záruba

> http://code.google.com/p/memcached/wiki/FAQ
>
> 
>
> On Sat, Apr 3, 2010 at 12:59 AM, aswath satrasala <
>
>
>
>
>
> aswath.satras...@gmail.com> wrote:
> > Hello Ikai,
> > I am interested in Sequences, sequence starting from a initial value and
> > increments.
> > Can you little bit elaborate here on what is the risk with volatile here
> > when using memcache.
>
> > Regards
> > -Aswath
>
> > On Sat, Mar 6, 2010 at 1:05 AM, Ikai L (Google)  wrote:
>
> >> Have you looked into Memcache's INCR?
>
> >>http://code.google.com/appengine/docs/java/javadoc/com/google/appengi...
> >> ,
> >> long)
>
> >> This'll do it atomically, but you run the risk of it being volatile,
> >> so you'll have to account for that in your client code.
>
> >> On Tue, Mar 2, 2010 at 11:40 PM, legendlink  wrote:
> >> > hi, i wanted to have a sequence generator that increments by x value
> >> > everytime it generates a value. if i would create the sequence
> >> > generator by using the datastore, it is likely that data contention
> >> > would occurr if there is high access times.
>
> >> > i have looked into the sample code of max ross in the google code
> >> > repository (SequenceExamplesJDO.java) and  think this is limited to
> >> > increment by 1 only and not increment by x value.
>
> >> > if sharding technique is used, my concern is that i might not get the
> >> > right sequence.
>
> >> > what is the best/elegant way of doing sequence generator that
> >> > increments x value?
>
> >> > --
> >> > You received this message because you are subscribed to the Google
> >> Groups "Google App Engine for Java" group.
> >> > To post to this group, send email to
> >> google-appengine-j...@googlegroups.com.
> >> > To unsubscribe from this group, send email to
> >> google-appengine-java+unsubscr...@googlegroups.com >>  unsubscr...@googlegroups.com>
> >> .
> >> > For more options, visit this group at
> >>http://groups.google.com/group/google-appengine-java?hl=en.
>
> >> --
> >> Ikai Lan
> >> Developer Programs Engineer, Google App Engine
> >>http://googleappengine.blogspot.com|http://twitter.com/app_engine
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "Google App Engine for Java" group.
> >> To post to this group, send email to
> >> google-appengine-j...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> google-appengine-java+unsubscr...@googlegroups.com >>  unsubscr...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/google-appengine-java?hl=en.
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine for Java" group.
> > To post to this group, send email to
> > google-appengine-j...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-appengine-java+unsubscr...@googlegroups.com > unsubscr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.
>
> --
> Ikai Lan
> Developer Programs Engineer, Google App 
> Enginehttp://googleappengine.blogspot.com|http://twitter.com/app_engine

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: elegant way of implementing sequence generator

2010-03-18 Thread legendlink
thanks for the link.

have tried the @version with shards. the output counter seems not to
be unique... i think there is no other way to mimic the sequence
generator like other rdbms without using normal transactions with
optimistic locking of the entity.

On Mar 12, 1:49 am, datanucleus  wrote:
> > could you give me simple example on how to use the @version,
>
> The DataNucleus docs define that, and much 
> morehttp://www.datanucleus.org/products/accessplatform/jdo/orm/versioning...

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: elegant way of implementing sequence generator

2010-03-11 Thread datanucleus
> could you give me simple example on how to use the @version,

The DataNucleus docs define that, and much more
http://www.datanucleus.org/products/accessplatform/jdo/orm/versioning.html

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: elegant way of implementing sequence generator

2010-03-11 Thread legendlink
Hi blake,

could you give me simple example on how to use the @version, or any
reference material?

thanks!

On Mar 9, 11:35 pm, Blake  wrote:
> You could also go with the sharded counter strategy.  The more shards
> you have, the less the chance that you'll have a collision, and you'd
> use @Version for optimistic locking on each shard.
>
> On Mar 9, 7:18 am, legendlink  wrote:
>
> > Thanks for the reply.
>
> > If memcache is used, how do I implement it so that the counter would
> > always be updated and not be deleted?
>
> > On Mar 6, 4:35 am, "Ikai L (Google)"  wrote:
>
> > > Have you looked into Memcache's INCR?
>
> > >http://code.google.com/appengine/docs/java/javadoc/com/google/appengi...,
> > > long)
>
> > > This'll do it atomically, but you run the risk of it being volatile,
> > > so you'll have to account for that in your client code.
>
> > > On Tue, Mar 2, 2010 at 11:40 PM, legendlink  wrote:
> > > > hi, i wanted to have a sequence generator that increments by x value
> > > > everytime it generates a value. if i would create the sequence
> > > > generator by using the datastore, it is likely that data contention
> > > > would occurr if there is high access times.
>
> > > > i have looked into the sample code of max ross in the google code
> > > > repository (SequenceExamplesJDO.java) and  think this is limited to
> > > > increment by 1 only and not increment by x value.
>
> > > > if sharding technique is used, my concern is that i might not get the
> > > > right sequence.
>
> > > > what is the best/elegant way of doing sequence generator that
> > > > increments x value?
>
> > > > --
> > > > You received this message because you are subscribed to the Google 
> > > > Groups "Google App Engine for Java" group.
> > > > To post to this group, send email to 
> > > > google-appengine-j...@googlegroups.com.
> > > > To unsubscribe from this group, send email to 
> > > > google-appengine-java+unsubscr...@googlegroups.com.
> > > > For more options, visit this group 
> > > > athttp://groups.google.com/group/google-appengine-java?hl=en.
>
> > > --
> > > Ikai Lan
> > > Developer Programs Engineer, Google App 
> > > Enginehttp://googleappengine.blogspot.com|http://twitter.com/app_engine

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: elegant way of implementing sequence generator

2010-03-09 Thread Blake
You could also go with the sharded counter strategy.  The more shards
you have, the less the chance that you'll have a collision, and you'd
use @Version for optimistic locking on each shard.

On Mar 9, 7:18 am, legendlink  wrote:
> Thanks for the reply.
>
> If memcache is used, how do I implement it so that the counter would
> always be updated and not be deleted?
>
> On Mar 6, 4:35 am, "Ikai L (Google)"  wrote:
>
> > Have you looked into Memcache's INCR?
>
> >http://code.google.com/appengine/docs/java/javadoc/com/google/appengi...,
> > long)
>
> > This'll do it atomically, but you run the risk of it being volatile,
> > so you'll have to account for that in your client code.
>
> > On Tue, Mar 2, 2010 at 11:40 PM, legendlink  wrote:
> > > hi, i wanted to have a sequence generator that increments by x value
> > > everytime it generates a value. if i would create the sequence
> > > generator by using the datastore, it is likely that data contention
> > > would occurr if there is high access times.
>
> > > i have looked into the sample code of max ross in the google code
> > > repository (SequenceExamplesJDO.java) and  think this is limited to
> > > increment by 1 only and not increment by x value.
>
> > > if sharding technique is used, my concern is that i might not get the
> > > right sequence.
>
> > > what is the best/elegant way of doing sequence generator that
> > > increments x value?
>
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "Google App Engine for Java" group.
> > > To post to this group, send email to 
> > > google-appengine-j...@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > google-appengine-java+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/google-appengine-java?hl=en.
>
> > --
> > Ikai Lan
> > Developer Programs Engineer, Google App 
> > Enginehttp://googleappengine.blogspot.com|http://twitter.com/app_engine

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: elegant way of implementing sequence generator

2010-03-09 Thread legendlink
Thanks for the reply.

If memcache is used, how do I implement it so that the counter would
always be updated and not be deleted?

On Mar 6, 4:35 am, "Ikai L (Google)"  wrote:
> Have you looked into Memcache's INCR?
>
> http://code.google.com/appengine/docs/java/javadoc/com/google/appengi...,
> long)
>
> This'll do it atomically, but you run the risk of it being volatile,
> so you'll have to account for that in your client code.
>
>
>
> On Tue, Mar 2, 2010 at 11:40 PM, legendlink  wrote:
> > hi, i wanted to have a sequence generator that increments by x value
> > everytime it generates a value. if i would create the sequence
> > generator by using the datastore, it is likely that data contention
> > would occurr if there is high access times.
>
> > i have looked into the sample code of max ross in the google code
> > repository (SequenceExamplesJDO.java) and  think this is limited to
> > increment by 1 only and not increment by x value.
>
> > if sharding technique is used, my concern is that i might not get the
> > right sequence.
>
> > what is the best/elegant way of doing sequence generator that
> > increments x value?
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Google App Engine for Java" group.
> > To post to this group, send email to google-appengine-j...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > google-appengine-java+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/google-appengine-java?hl=en.
>
> --
> Ikai Lan
> Developer Programs Engineer, Google App 
> Enginehttp://googleappengine.blogspot.com|http://twitter.com/app_engine

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.