Here are some quick statistics I did using the idea that you have a entity
which consists solely of a key and no other properties. I called this entity
kind 'READ'. If a tweet has a matching key in this entity then the tweet has
been read. If it doesn't exist then the tweet is unread. I did a batch PUT
of 1000, 2000 and 10000 for comparison purposes and a batch GET of 2000 and
10000.

Results for batch put of 1000 was
1383ms 48493cpu_ms 48400api_cpu_msResults for batch put of 2000 was
1608ms 97030cpu_ms 96866api_cpu_msResults for batch put of 10000 was
7791ms 481290cpu_ms 480916api_cpu_msSo, each entity key cost was
consistently approx. 48ms. Which for the 10000 entity case costs
approximately 8 minutes of CPU. This seems like the worse case scenario
since someone will have tweets which have already been marked as read and a
PUT of these  keys would not need to be done.

Then performing a batch get of 2000 was:
181ms 16830cpu_ms 16666api_cpu_msAnd a batch get of 10000 was:
421ms 83870cpu_ms 83333api_cpu_msSo, cost for each entity key retrieval is
approx. 8.33ms.

So, it seems that this could work since I assume you're only going to be
showing a page of tweets at a time. Also, as another design tweak you could
put all tweets for a given hour or half hour or 15 minute increment, etc.
into one entity. Since tweets are a max. 140 characters you could fit over
7000 tweets in one entity for an hour and that's without compression. Then
instead of allowing marking read/unread of individual tweets you could mark
all tweets for a given hour or 30 minute increment as read or not read which
would significantly cut down on the number of entities that need to be
queried and read/unread key markers that need to be maintained.

Hope some of this helps,
Steve

On Sun, Jan 9, 2011 at 7:14 PM, nischalshetty <[email protected]>wrote:

> @Ernesto Thanks for the link, that's a good starting point.
>
> @Jay Thanks for some more pointers.
>
> Simply put here's what I want to do (a twitter app):
>
> 1. Pull all the tweets of a user
> 2. The user can selectively read tweets (which would be marked as 'Read')
> 3. Unread tweets would be well 'Unread'
>
> Here, the latest timestamp thingy won't really help because it can so
> happen that the user reads a few tweets that were say 5 days old then the
> user navigates to page one and reads a tweet that have appeared today. So
> all the tweets in between would still need to be Unread.
>
> Apart from this, I need to give users the ability to say, mark all tweets
> as Read in case they want to start fresh. But again, Mark All Read would be
> a checkbox against all tweets, so the user can 'deselect' a few tweets and
> then click the Mark as Read button :(
>
> Hope you're getting what I want to accomplish. I've marked more than 10,000
> emails as 'Read' in Gmail, how do they do it?
>
> -N
>
> --
> 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]<google-appengine%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>

-- 
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.

Reply via email to