Robert Peach
Robert Peach

Reputation: 73

Can a second GAE application access the datastore of a primary application?

If I had an application that stored information in its datastore. Is there a way to access that same datastore from a second application?

Upvotes: 1

Views: 60

Answers (3)

Peter Knego
Peter Knego

Reputation: 80340

You can not directly access datastore of another application. Your application must actively serve that data in order for another application to be able to access it. The easiest way to achieve this is via Remote API, which needs a piece of code installed in order to serve the data.

If you would like to have two separate code bases (even serving different hostnames/urls), then see the new AppEngine Modules. They give you ability to run totally different code on separate urls and with different runtime settings (instances), while still being on one application sharing all stateful services (datastore, tasks queue, memcache..).

Upvotes: 1

Andy Dennie
Andy Dennie

Reputation: 6062

You didn't mention why you wanted to access the datastore of one application from another, but depending on the nature of your situation, App Engine modules might be a solution. These are structurally similar to separate applications, but they run under the same application "umbrella" and can access a common datastore.

Upvotes: 1

Deviling Master
Deviling Master

Reputation: 3113

Yes you can, with the Remote APIs.

For example, you can use Remote API to access a production datastore from an app running on your local machine. You can also use Remote API to access the datastore of one App Engine app from a different App Engine app.

You need to configure the servlet (see documentation for that) and import the appengine-remote-api.jar in your project (You can find it ..\appengine-java-sdk\lib\)

Only remember that Ancestor Queries with Remote APIs are not working (See this)

Upvotes: 1

Related Questions