简体   繁体   中英

Modeling Objectify data in Google App Engine

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM