On Fri, Jun 24, 2011 at 4:04 PM, Jeff Schnitzer <j...@infohazard.org> wrote:

> Thanks, this clarifies much!  Questions below:
>
> On Thu, Jun 23, 2011 at 11:49 PM, Gregory D'alesandre <gr...@google.com>wrote:
>
>>  Datastore APIs Q: Which operations are being charged for?
>> A: There are 3 categories of Datastore operations:
>> - Write operations (Entity Put, Entity Delete, Index Write), each of these
>> operations will cost $0.10 per 100k operations
>> - Read operations (Query, Entity Fetch), each of these operations will
>> cost $0.07 per 100k operations
>> - Small operations (Key Fetch, Id Allocation), each of these operations
>> will cost $0.01 per 100k operations
>>
>>  Q: Under the new scheme, is it more economical to do a keys-only query
>> that fetches 1000 keys, and then do a get on the 500 of them that I need, or
>> just do a regular (non keys-only) query for all 1000 directly?
>> A: The first is more economical.  Fetching 1000 keys + fetching 500
>> entities = $0.0001 + 0.00035 = $0.00045; fetching 1000 entities = $0.0007.
>>
>
> This makes sense, and encourages more use of memcache. to hold entities.
>  One question that I've been wondering a while - presuming no caching, does
> this query-keys+batch-get approach produce higher latency than a simple
> query, and if so, by how much?
>

a db.Get will force strong consistency in the High Replication Datastore,
which will introduce higher latency depending on how many entity groups you
are fetching from (see other threads about this problem). If you set the
read_policy to EVENTUAL_CONSISTENCY (or you are still using M/S Datastore)
you will only pay the additional RPC latency. This is the not taking into
account the 1000 entities vs 500 entities part of this question, which is
hard to predict.


>
> Also, is there any way we can get the transaction timestamp out on
> datastore writes?  This would *dramatically* improve the robustness of code
> that tries to keep memcache in sync with the datastore during contention.
>  I've spoken with Alfred and Max about this, but I don't know if it's a
> priority.  This could potentially reduce datastore bills by orders of
> magnitude.
>

:-), Ya it will save you the gets to populate the cache.


>
> Thanks,
> Jeff
>
> --
> 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
> google-appengine+unsubscr...@googlegroups.com.
> 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 google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to