On Tue, Jul 14, 2009 at 5:03 AM, Mark Jones<[email protected]> wrote:
>
> I know I'm going to have LOTS of small data records from LOTS of
> people. I want to get this right so I don't have to fix it later.
> Basically, my plan was to have it structured like this:
>
> Account/Year/Month/Day/Item
>
> What I haven't quite figured out is how to get the indices and
> database to cluster around those items. I know I will want to query a
> list of all items by year, by year and month, and possibly by day
> within an account. Most day's will consist of 5-20 items per
> account, so I guess it would be possible to blend day and item
> together. without whole lot of grief since that would still only leave
> me with 600 or so items per Month.
If you don't need your inequality query for something else (eg,
sorting or filtering items within a given time period), you can simply
use a DateProperty and filter based on that (Eg,
MyModel.all().filter('date >', somedate).filter('date <',
someotherdate).all()).
If you do need the inequality, you can create separate year/month/day
IntegerProperties, and do equality filters on each. You will need
indexes for each combination (year/month, year/month/day, etc).
>
> This is sort of hierarchical and I was planning on using the parent
> key for zoom out and the individual key for zoom in. What is the best
> way to lay this out?
Unless you need to be able to update multiple items transactionally,
don't do this. All entities with the same root parent are in a single
entity group, and updates to an entity group are serialized, which
limits the rate at which you can update them.
-Nick Johnson
>
> There is one other thing that may/may not be an issue and that is the
> grouping of Accounts as well, so that some individuals could have
> multiple accounts. Again though, wanting to cluster all of this
> around the date layout above.
>
> Thanks for any pointers.
>
> PS I tried creating classes for Account/Year/Month/Day/Item and then
> creating them with parent relationships. This seems to mean that I
> have to create and save Account() then Year(), then Month() then Day()
> before I can create Item. That doesn't seem efficient to me though.
>
> >
>
--
Nick Johnson, App Engine Developer Programs Engineer
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---