I was just wondering if I store some data chronologically, will it be returned back in the order of most-recent to least-recent OR least-recent to most-recent? For e.g. If I input data in the following order: A[1], B[2], ...
, if I do a simple select
query of the table, will it return the list as {A, B, ...}
or {..., B, A}
? Assume that I haven't set any indexes i.e. indexing is automatically set by appengine. A critical part of my system's design depends on this information, so I want to confirm this information before I proceed. Any help will be highly appreciated. I need the data retrieval to be in LIFO format, how can I ensure this?
- FIFO - first in first out
- LIFO - last in first out
I'm pretty sure that the app engine datastore doesn't specify any guaranteed order, and that the persistence framework you use (JPA? JDO?) doesn't either. So if it's critical, then store a timestamp along with every data you insert, and add an
order by
clause to your queries to make sure you retrieve the objects in the appropriate order.