0

I want to read events happened in my system in the order. But there is a chance that thousands of events could happen at same time. So, I cannot sort based on event created time. Is there a way that can I read in insertion order. If I can read in insertion order I can store the cursor and retrieve the events in order.

Dan McGrath
  • 41,220
  • 11
  • 99
  • 130
Pokuri
  • 3,072
  • 8
  • 31
  • 55
  • 4
    No. You only other option would be to pre-allocate/create sequential keys and use them in order, which would be hard to do in appengine datastore. There historically good reasons not to do this sort of thing for performance reasons. This will be slow. A sequential set of id's meant a pathological case for key distribution. Have a look at the other questions on this topic . e.g - http://stackoverflow.com/questions/3985812/how-to-implement-autoincrement-on-google-appengine – Tim Hoffman Nov 05 '16 at 06:38
  • @TimHoffman your comment should be put as an answer! – marcadian Nov 07 '16 at 19:08

1 Answers1

2

No. You only other option would be to pre-allocate/create sequential keys and use them in order, which would be hard to do in appengine datastore. There historically good reasons not to do this sort of thing for performance reasons. This will be slow. A sequential set of id's meant a pathological case for key distribution. Have a look at the other questions on this topic . e.g - How to implement "autoincrement" on Google AppEngine

Community
  • 1
  • 1
Tim Hoffman
  • 12,976
  • 1
  • 17
  • 29