Can Objectify library be used outside GAE? - google-app-engine

I want to use the Google Cloud Datastore. However, I am not using GAE.
Can I still use the Objectify library? If so how? The documentation doesnt say anything about how to configure it to authenticate against Datastore.

No, you can't.
Here is a comment from the creator on the topic.

Objectify is meant for use within GAE only. Other ORM for Java which can interface with the Datastore, such as JDO, JPA, etc. are similar.
In order to access your Datastore from the outside world, you'll either want to write handlers within your GAE app's API which can do the Datastore interfacing for you, simply hitting those methods on your API which are meaningful in the context of your app, or you'll use the Google Cloud Datastore API Client Library for Java, allowing your external app to directly touch your Datastore.

Related

Does Cloud Python lib in GAE use caching or memcache for access to Cloud Firestore data?

Setup: Google App Engine application on Python standard environment.
Currently, the app uses the NDB library to read/write from its Datastore. It uses async tasklets for parallel, asynchronous reads from Datastore, and memcache.
If I would like to use Firestore as a replacement for Datastore, it seems that I would have to use the Google Cloud Client Library for Python. I believe that the google-cloud lib doesn't support a mechanism like tasklets. But I wonder: Does the lib use a thread-safe cache-mechanism for its requests to the Firestore API, and maybe even GAE's memcache?
The Cloud Firestore server-side client libraries are not optimized for App Engine Standard. They don't integrate with a caching solution like GAE's memcache; you'd have to write that layer yourself.

Connecting different microservices to same cloud datastore

Is it possible to have 2 different applications (one written in Python and one in Java) in the same App Engine environment (Standard) and have them view the same Datastore?
From my understanding, Google Cloud Datastore is the storage option that comes along with any AppEngine application, but also exists as an external service any application can use.
Is there a way for one application to view the other application's "embedded" Datastore (without one application exposing an API to it)? If not, how can 2 different applications use the same storage? I haven't been able to find any documentation regarding Cloud Datastore urls or using them as a third party database.
You probably can use the REST API version https://cloud.google.com/datastore/docs/apis. The real question is, why do you need to 2 different apps here? Micro service is usually implemented in appengine using module on a single app, https://cloud.google.com/appengine/docs/standard/python/microservices-on-app-engine.

How to access GAE datastore with Objectify and service account credentials?

Is it possible for one GAE application to access the datastore of another GAE application (both applications are hosted under the same Google account) using Objectify? If so, how can I pass service account credentials to Objectify (which API calls)?
It is not possible. Objectify is a very simple and convenient lightweight ORM that sits on top of a GAE Datastore, thus shielding the developer from most of the complexities of using JDO/JPA.
Nowhere in the documentation have I seen the scenario you describe mentioned because that is not the problem it is trying to solve.
I suspect what you will probably need to do is create a Web Service that exposes your GAE application (whose data you want) through an API. Then have your other GAE application call those service methods to obtain the data it needs.
Alternatively, you can use something called remote_api. It allows you to access and manipulate a GAE Datastore remotely.
Below are some links I just found to similar questions after posting my answer:
Can I access Datastore entities of my other Google App Engine Applications
Can one application access other applications data querying the key in Google App Engine?
A solution is to have only one "GAE application" but to make different Modules in your application. The Datastore will be shared between the modules.
Another solution is to use the Remote API (https://developers.google.com/appengine/docs/java/tools/remoteapi), but you won't be able to use Objectify, I think...

How do people create restful data services in Google App Engine?

Where do developers store their data? I heard that it can be hard to access S3 with the existing libraries and you need to update all URL calls using GAE's methods. Do developers typically find other ways to access S3 or do they use some other sort of storage (Google Storage is not public yet) such as databases? Does google provide anything for this, what is the "ideal" way that app engine would solve the problem of having users get and post data to persistent storage through app engine?
GAE provides the Datastore API, built on their Bigtable.
There's many good questions on the GAE Datastore here on stackoverflow.

App Engine Datastore access

Is it possible to query App Engine's Datastore from outside the cloud, i.e. a client application?
I could possibly write an app to be housed within AppStore and query the Datastore returning XML-formatted data; I want to know, however, if there are any Datastore endpoints which would allow me to do it directly.
Also, in case it is possible, am I able to do so via SSL?
Yes. The remote_api library supports exactly this use-case. If you're using Java, there's a Java remote_api handler available, and the client will be available at some point in the future.
You can use this over SSL in the same way as any other handler.
There's no reason you couldn't create your own app engine application that exposes the datastore as a web service (either http or https). In fact, here is a link to a python version.

Resources