Reputation: 647
I'm developing an app backend in Google App Engine with objectify, as would be the best way to model the entities of the following data (The following notation is only for purposes of exemplifying)
{user:{
userInfo:{...},
activities:{
activityByDay1:{
activityDescription{...},
tasks:{
task1:{"indexed by date"...},
task2:{...},...
}
},
activityByDay2:{...},...
}
}
}
Tasks can be up to 86400 records. And how do I build a query that returns this structure with the latest 20 tasks and a cursor on activityByDay?.
Thank you!
Upvotes: 0
Views: 48
Reputation: 13556
There is no single answer to this question. How you model it will depend on the amount of breadth at each 'level' of the tree and the type of queries you intend to perform. It depends on whether you need those queries to be strongly consistent, whether you need to edit lots of data in a single transaction, and how often various bits of data mutate.
If you want meaningful advice, expand your question to include as much of this information as possible. There is no such thing as "normal form" in the datastore like there is in SQL.
Upvotes: 0