[google-appengine] ndb, get_by_id can not get an entity with a parent key only by id?

2014-07-20 Thread saintthor
 

model( parent = ndb.Key( model2, 4993981813358592 ), 
id='google:a...@gmail.com' ).put()

model.get_by_id( 'google:a...@gmail.com' ) #get None


how to get the entity only by itself's id? it has a parent, but i do not 
know the parent key.




-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: ndb, get_by_id can not get an entity with a parent key only by id?

2014-07-20 Thread Kaan Soral
I've also tested utilizing parent's recently, don't remember the exact 
reason

I've found out that you can't get an entity only by id, if it has a parent, 
you have to know the parent too, that's why I utilized a different method 
to achieve whatever I was after at that time (don't remember)

I also like to simply get entities by their id's - so I almost never give 
them parent's

I would suggest not utilizing parent's unless you exactly know what you are 
doing

I suspect you are learning ndb, I would suggest reading 
https://developers.google.com/appengine/docs/python/ndb*/ *fully

AppEngine documentations are really easy to read and pretty fun, it 
shouldn't take 3 hours to grasp all concepts related to ndb

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Quota Details/Search - What does Safety Limits do?

2014-07-20 Thread Kaan Soral
These seem a bit restrictive if they are daily, the UI doesn't give much 
information, the linked documentation also doesn't go into detail much

Search API Search Minutes 
[image: 0%] 
 0%  0.00 of 100.00 Search Minutes  Search API Documents Indexed 
[image: 0%] 
 0%  0 of 15,000  Search API Documents Deleted 
[image: 0%] 
 0%  0 of 15,000 

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: NoSQL vs Relational DBs - pros and cons

2014-07-20 Thread Kaan Soral
Relational databases also require indexes, however NoSQL indexes are much 
harder to generate and costly

You generally have to build with precision when developing with NoSQL, 
always knowing what you want and how you want it, build the models and 
indexes / systems for that

There are also many other gotchas you learn with NoSQL - or AppEngine 
specifically

But I will say this, I've never felt hopeless while using AppEngine, there 
is always someone out there to help with issues, or an efficient 
documentation

Long story short, I've been using AppEngine at large scale for a while now, 
I would suggest it
(The taskqueue system is also pretty strong, you can easily build a mapping 
task (map of mapreduce) and iterate over all entities in a relatively short 
time, so if costs are not a big issue, you can always iterate over 
everything instead of running a flexible relational db query that you would 
do otherwise)

(Issues also happen, but there is always the soothing fact that someone 
else solves them at scale, however, since you are intending for a corporate 
usage, you might take the responsibility yourself and build a custom 
system, would be much harder, much more costly)

I'm guessing this isn't the detailed reply you were looking for, but just 
my .02

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.


Re: [google-appengine] Re: Datastore eventual consistency

2014-07-20 Thread Jeff Schnitzer
The answer to your question is no.

Queries are eventually consistent because index changes are replicated
between datacenters asynchronously and queries are served by any
datacenter. Strongly consistent get-by-key operations require a quorum of
datacenters; they have no effect on query index replication.

Note that while get-by-key is strongly consistent by default, you can
explicitly request an eventually consistent get-by-key. Since it returns
the first result as-is (without waiting for a quorum), it is quite a bit
faster.

Also: You may be experiencing cache behavior; ndb caches at both session
and memcache level.

Jeff


On Fri, Jul 18, 2014 at 2:17 PM, Dan uvico...@gmail.com wrote:

 Apologies Chad, I didn't make myself clear. I was using Python ndb
 terminology with 'get', 'put' and 'query'.

 What I want to clarify is if an entity will always be returned from a
 fetch by kind if it has previously been fetched by key.

 This is what I experience in testing. I also remember reading that an
 entity's indexed properties are written to their respective indexes, if not
 done already, on its first fetch by key.

 Therefore can you effectively get strong consistency by adding a fetch by
 key after adding an entity to the datastore?

 Example 1:
 1) Put entity A.
 2) Query for entity A by kind. // This does not always return entity A due
 to the eventual consistency nature of the datastore.

 Example 2:
 1) Put entity B.
 2) Fetch entity B by key.
 3) Query for entity B by kind. // Always appears to return entity B.

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-appengine+unsubscr...@googlegroups.com.
 To post to this group, send email to google-appengine@googlegroups.com.
 Visit this group at http://groups.google.com/group/google-appengine.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.