On Thu, Oct 1, 2009 at 4:20 PM, mably <fm2...@mably.com> wrote:

>
> In fact my update rate might be pretty high.
>
> In the case of a timestamp field : are the servers/instances clocks
> perfectly synchronized (millisecond/precision of a date object in
> java) ?
>

No. It's not possible to get clocks 'perfectly' synchronized, and short of
dedicated hardware, millisecond precision is likewise impractical.
Distributed monotonic counters are a great unsolved problem in computer
science.

Clocks on machines App Engine apps run on are synchronized with NTP, as
reliably as is practical.

-Nick Johnson


> On 1 oct, 17:10, "Nick Johnson (Google)" <nick.john...@google.com>
> wrote:
> > Hi mably,
> > If your update rate is low (less than 1 QPS), you can use a counter
> entity,
> > updating it in each transaction. If you don't need your sequence IDs to
> be
> > unique - only incrementing - you can do a best effort fetch for the
> highest
> > existing ID, and set your new entity to one more than that value.
> Otherwise,
> > your best option is a timestamp field.
> >
> > -Nick Johnson
> >
> >
> >
> >
> >
> > On Thu, Oct 1, 2009 at 4:08 PM, mably <fm2...@mably.com> wrote:
> >
> > > Thanx for your answer, so no way to get a kind of sequence besides
> > > using Date fields I guess...
> >
> > > On 1 oct, 17:04, "Nick Johnson (Google)" <nick.john...@google.com>
> > > wrote:
> > > > Hi mably,
> >
> > > > On Thu, Oct 1, 2009 at 4:00 PM, mably <fm2...@mably.com> wrote:
> >
> > > > > Hi everybody,
> >
> > > > > Is there any way to create/emulate a "sequence" with the datastore
> ?
> >
> > > > > I first thought that entity IDs where sequentially created, I was
> > > > > wrong : old IDs can be reused.
> >
> > > > Old IDs are never reused. IDs allocated by the datastore are always
> > > unique,
> > > > but may not be sequential - so IDs could be numbered in the following
> > > order:
> >
> > > > 1
> > > > 2
> > > > 1001
> > > > 3
> > > > 1002
> >
> > > > -Nick Johnson
> >
> > > > > So no way to sort by IDs to fetch the last inserted one.
> >
> > > > > I could sort by a Date field but could get some conflicts, I could
> had
> > > > > a suffix in such cases though.
> >
> > > > > Does anybody have a better idea ?
> >
> > > > > Thanx in advance.
> >
> > > > > François
> > > > > Bordeaux, FRANCE
> >
> > > > --
> > > > Nick Johnson, Developer Programs Engineer, App Engine
> > > > Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
> > > Number:
> > > > 368047
> >
> > --
> > Nick Johnson, Developer Programs Engineer, App Engine
> > Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
> Number:
> > 368047
> >
>


-- 
Nick Johnson, Developer Programs Engineer, App Engine
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number:
368047

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

Reply via email to