As we know, in Google App engine, for each registered email account, we are allowed to make 10 applications. Now, I need to share entities among the applications. Is this possible? If yes, how is it implemented?

- 41,220
- 11
- 99
- 130

- 4,132
- 10
- 47
- 53
-
4Why do you need to share datastore entities between your application? Please remember that the app engine Terms of Service section 4.3c prohibits us to `use multiple Applications to simulate or act as a single Application or otherwise access the Service in a manner intended to avoid incurring fees`. – Ibrahim Arief Jan 22 '12 at 00:23
6 Answers
No, this cannot be done. However, as Nick Johnson points out, you can use remote_api to do what you need.

- 1
- 1

- 30,138
- 7
- 37
- 54
-
thanks for the quick reply, I just make a quick ran threw the site, and I want to ask you (might be heard silly), can that be used with application implemented in Java as all the coding there is done in Python.. – VISHAL DAGA Jan 21 '12 at 20:19
-
1@VISD [Here's](http://code.google.com/appengine/docs/java/tools/remoteapi.html) the Java version. – Marvin Pinto Jan 21 '12 at 20:22
Are you sure you really need to do this? Don't forget, you can have multiple versions of an application running against the same datastore. Only 1 version of the app is your "default" and gets your non appspot.com domain name, but you can have completely different codebases running against the same datastore/memcache addressable with ..appspot.com
I don't know if this satisfies your needs but thought I'd throw it out there.

- 3,761
- 1
- 14
- 17
-
I could not understand you. Sorry, may be coz being newbie but I have never heard of non "appspot.com" domain name for GAE application. Please link the resource from where you got the information. – VISHAL DAGA Jan 30 '12 at 20:39
-
1In appengine you can alias a "normal" domain (www.foo.com) that you've registered to point to your appspot.com domain. So if your appengine domain is foo.appspot.com you can have this visible to your users as www.foo.com. But this domain will always point to the "default" version of your application. You could also have something like cms.foo.appspot.com that points to another version of your code living on appengine. These two codebases share the datastore, memcache, etc. but only 1 can be aliased in this way. – Rick Mangi Feb 09 '12 at 18:38
-
1Here's a link for more info.. http://stackoverflow.com/questions/817809/how-to-use-google-app-engine-with-my-own-domain-not-subdomain – Rick Mangi Feb 09 '12 at 18:41
Yo can do it using Cloud Datastore API access. Until now, I can't be able to do it using ndb library.
This is the code (Python) in your current app:
from google.appengine.api import app_identity
scope = "https://www.googleapis.com/auth/datastore"
authorization_token, _ = app_identity.get_access_token(scope)
headers = {'Content-Type': 'application/json', "Authorization": "Bearer " + authorization_token}
payload = {"gqlQuery": { "queryString": "SELECT * FROM Entities"} }
url = "https://datastore.googleapis.com/v1beta3/projects/otherAppName:runQuery"
result = urlfetch.fetch(url, payload=json.dumps(payload), method=urlfetch.POST,
follow_redirects=True, headers=headers)
just change "otherAppName" with the short name of the other App Engine app whose datastore you want to access. Change "Entities" with the name of the Model you want to access. Remember to give access to yourCurrentApp in the otherNameApp (IAM menu in the cloud console), set permissions to yourcurrentapp@appspot.gserviceaccount.com to access the datastore/project
In result you will get the response, you must json-parse it and you will get a very low level detail of the datastore entities from the query (including keys, paths, field names, types and value for each field and each row of the results). If you have ndb.JsonProperties you will receive a BLOB value (DATABLOB in the next example code) , you must transform it :
from google.appengine.ext.bulkload import transform
b = json.loads(transform.blobproperty_from_base64(DATOBLOB))
Hope this can help you. I'm waiting for the answer using ndb in my other post: GAE NDB Datastore new feature: Access Datastore entities from other GAE app

- 1
- 1

- 531
- 4
- 14
There's a new possibility: if one of the applications can be "part of" another, you can have it be a "module".

- 8,739
- 4
- 36
- 32
By activating Cloud Datastore access in App Engine's settings it's possible to share a datastore with other App Engine applications (or third party applications).

- 3,131
- 1
- 30
- 23
Check the ISSUE with GAE before going to implement as stated in documentation. I had tried to implement as stated there but with fail because of the issue. Your request to the remote API will reach the target server but won't perform anything. Hope that the issue be solved soon.

- 4,132
- 10
- 47
- 53