Suppose you have to design a high traffic forum site (let's simplify
it assuming you don't need topic replies). So, you'll need two kinds.

Topic
  title
  body

User
  name


1) How to avoid contention for new topics? Should the ancestor of a
new Topic entity should be the User entity? I assume that that way I
avoid the contention for locking the unique ancestor root, which will
be case if all Topic entities had no ancestor. Can someone confirm
this?

2) How do I order topics? Documentation says that unique autogenerated
Key ids are not guaranteed to be sequential, although that's
"generally the case". In one of the google IO presentations, there is
an example for Comment entity that uses timestamps and also username
to break ties. My worry is that different front end server clocks
might be off by minutes or hours, not seconds, in which case the user
experienced will be ruined, since a new topic will be "lost to the
user", that is, it won't show last. Another idea might be to use the
sharded counter approach, and keep the last_id memcached. With Sharded
counter I might get same last_id from memcache and therefore will
create two Topics with same id. If a topic is a descendant of the user
that created it, then the datastore will not bark at having two topics
with same id. So, I might be overly cautious here, preparing for a
situation in which front end servers will have clocks off by minutes
or hours, which might never happen, but on the other hand, the docs
documentation doesn't say hey won't. So, how would you order topics?

Disclaimer: I'm a newbie to python, distributed systems, etc.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to