Your model won't work if one message can have several recipients. Is this OK? And is there a particular reason why you create an entity group for a user and its messages ? You only need an entity group if you plan to update different entities transactionally.
Also, you might be interested by this parallel thread: http://groups.google.com/group/google-appengine/browse_thread/thread/51dd2e2fbfd76900 On Jan 10, 3:27 am, "sameer.mhatre" <[email protected]> wrote: > I need suggestion for the database model designed by me for the app I > am going to develop. > > Requirement: > I am going to fetch messages (belongs to a particular user) and insert > into the datastore and update the unread count for that user > accordingly. Later on user can do operations like marking all/some > read/unread to his/her own messages. > > Database Model: > Entities: User, Message, Count > Entity Group: list of messages (belongs to a single user) and count > (to keep trac of read/unread) entity. Entity group is per user > specific (kept user's email id as parent for the entities to keep them > in a single group). > > Operations: > Insert: I want to add list of messages by making a makePersistsAll > method call and update count for a user accordingly. I think I have to > do this in a single transaction. Messages to be added belongs to a > entity group (means belongs to a single user). > Update: Updating status for the list of messages (could be more than > 1000 entities) and update Count accordingly. Again doing it in a > single transaction. Messages to be updated belongs to a single entity > group (means belongs to a single user). > > May be possible that more than one user's requests comes in and have > to add/update entity groups per user simultaneously. > > Is there any problem with this design model? Anything you can suggest > to me. > > Thanks > Sameer -- 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.
