Firestore full-text search - google-app-engine

I'm migrating an app from GAE/J Datastore to Cloud Firestore. The app uses GAE Full Text Search service. The Firestore docs recommend using Algolia/ElasticSearch for full-text search.
Is there anything that prevents using the search service with Firestore? Why is the docs recommending external search services esp. Google being known for search
Thanks

There's nothing that prevents you from using Cloud Firestore and the App Engine Search API together; it's just also possible to use Cloud Firestore outside of App Engine, so we don't want to constrain users to any particular environment.

Related

Firestore and Datastore in the same GAE project

I have a Google App Engine project and I use Datastore.
I see that under the firebase console, I also have the option to create a Firestore database.
Does this Firestore database use the underlying Datastore in the same GAE project? I'm guessing maybe it lives side by side with Datastore?
That being said, can I use Firestore and Datastore in the same project?
Let me know if I am missing something...
They are related.
But in addition to not being able to use both in the same project you should be careful if/when you decide to switch as the switch isn't reversible (or at least not yet). Take the time to dive into the documentation to make an informed decision.
From Choosing between Cloud Firestore and Cloud Datastore:
Cloud Firestore is the next major version of Cloud Datastore and a re-
branding of the product. Taking the best of Cloud Datastore and the
Firebase Realtime Database, Cloud Firestore is a NoSQL document
database built for automatic scaling, high performance, and ease of
application development.
and
Warning: Once your database option is set, you cannot switch. You can't use both Cloud Firestore and Cloud Datastore in the same
project.
You can not. From the documentation:
Cloud Firestore and App Engine: You can't use both Cloud Firestore and
Cloud Datastore in the same project, which might affect apps using App
Engine. Try using Cloud Firestore with a different project.

Beta Firebase Firestore won't work with projects using app engine

When I try to add the beta firestore to my Google cloud platform project I get the following message.
Cannot enable Firestore for this project
Currently Firestore cannot be enabled in projects already using Cloud Datastore or App Engine
Is this going to last forever?
I think I would like to replace some but not all of my datastore stuff with firestore to get realtime updates.
Perhaps firestore uses datastore and appengine in its backend?
Should I use two GCP projects to get around this problem?
Thanks,
Nathan
This is currently a technical restriction we hope to remove in the future.
Yes, currently you will need to use 2 separate GCP projects to use both Cloud Datastore and Cloud Firestore simultaneously.

Documents and Indexes/Memcache - how to use from GCE or GKE?

I've been wanting to use the "Documents and Indexes" feature of the Google Cloud platform, but due to the terribly constraints on AppEngine (e.g. I use gRPC, Cloud Endpoints etc etc). So instead I'm using GKE with Golang and it's all working good. My datastore is "Datastore" and I want to index some documents as I'm creating too many indexes that could result in exploding indexes.
How do we use the appengine search API from GKE? I get this error from Google Cloud Platform "not an App Engine context".. so does this mean that AppEngine standard gets the good stuff while users like me are left without these managed services and wondering if we will ever get these services?
So Google, will GKE/GCE users get:
Documents and Indexes (Search API)
Memcache service
Or do we have to roll up our own solution?
At this point you'll have to roll your own solution as App Engine search isn't available as a standalone product outside of App Engine Standard.
For caching you could follow the same advice given to App Engine Flexible users: https://cloud.google.com/appengine/docs/flexible/python/using-redislabs-memcache
Essentially use either Redis Labs Memcache/Redis Cloud offerings.

Can we access DataStore from google apps scripts?

I would like to import data from flat files stored in Google Drive into DataStore. Then use the full-text search and other query options to analyze the data using apps-script.
The script API doc shows how we can access Google Drive data from the apps-script.
Now, is there any API in apps-script to access DataStore from the scripts?
Google provides a (beta) REST API to access your data. Steps to enable are here.
However, BigQuery is usually better for the type of analysis you describe. See:
https://developers.google.com/apps-script/advanced/bigquery
At this point in time, you should consider writing your own Web Service to get you access to the DataStore. You can then access that Web Service hosted in your App Engine application from your App Scripts. A detailed example is provided over here.
Additionally, the Cloud DataStore is now provided under the Google Cloud Platform and while it is still in preview, there is an API available to interact with the Datastore. This API is exhaustive and allows for both read and write operations. But keep in mind that it is currently under Preview.

Google Cloud Datastore vs Google App Engine

I was having a look at the new Google Cloud Datastore and looks great. But there is something I could not understand... is it supposed to substitute Google App Engine Datastore? How can I use it inside GAE? What are the differences between both of them?
I have a GAE app in Java that uses 3 entities with thousands of rows each one, and I need to do joins quite often...
The cloud datastore is the App Engine datastore, for use outside App Engine. You won't get any benefit trying to use it with your App Engine app, unless you need other external apps to also have access to the data.
You certainly won't get more efficient joins. If you really need that, perhaps you should look into Cloud SQL, which is basically a version of MySQL you can use from App Engine.
They both are the same, in fact Google App Engine can use Google Cloud DataStore as one of its way to store data, the other options include Google Cloud SQL, Google Cloud Storage. You may select among these three according to the type of data you want to store and the way you want to access them.
From your question its clear that Google Cloud SQL would be right choice as no other options provide joins for retrieving results.
Cloud SQL is nothing but MySQL(the popular open source database) running on google platform. So you can perform your regular SQL-like queries to get your results.

Resources