Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Appengine Search API vs Datastore

Tags:

I am trying to decide whether I should use App-engine Search API or Datastore for an App-engine Connected Android Project. The only distinction that the google documentation makes is

... an index search can find no more than 10,000 matching documents. The App Engine Datastore may be more appropriate for applications that need to retrieve very large result sets.

Given that I am already very familiar with the Datastore: Will someone please help me, assuming I don't need 10,000 results?

  • Are there any advantages to using the Search API versus using Datastore for my queries (per the quote above, it seems sensible to use one or the other)? In my case the end user must be able to search, update existing entries, and create new entities. For example if my app is a bookstore, the user must be able to add new books, add reviews to existing books, search for a specific book.
  • My data structure is such that the content will be supplied by the end user. Document vs Datastore entity: which is cheaper to update? $$, etc.
  • Can they supplement each other: Datastore and Search API? What's the advantage? Why would someone consider pairing the two? What's the catch/cost?
like image 494
Katedral Pillon Avatar asked Apr 26 '14 22:04

Katedral Pillon


People also ask

What is the data store used by Google App Engine?

App Engine's Go standard runtime connects to Datastore using the Go Datastore API. For a complete list of the contents of the datastore package, see the datastore package reference. You cannot use the Cloud Datastore client library with Go applications in the App Engine standard environment.

Does Google have a search API?

The Google AJAX Search API is designed to make it easier for webmasters and developers to do two things: Add a dynamic search box to your site that includes Google Web, Video, News, Maps, and Blog search results. Build powerful web apps on top of Google search. See some samples.

What type of service is App Engine?

Google App Engine (GAE) is a platform-as-a-service product that provides web app developers and enterprises with access to Google's scalable hosting and tier 1 internet service.

Why is Google Appengine important?

Google allows you to add your web application code to the platform while managing the infrastructure for you. The engine ensures that your web apps are secure and running and saves them from malware and threats by enabling the firewall.


2 Answers

Some other info:

  1. The datastore is a transactional system, which is important in many use cases. The search API is not. For example, you can't put and delete and document in a search index in a single transaction.
  2. The datastore has a lot in common with a NoSql DB like Cassandra, while the search API is really a textual search engine, very similar to something like Lucene. If you understand how a reverse index works, you'll get a better understanding of how the search API works.
  3. A very good reason to combine usage of the datastore API and the search API is that the datastore makes it very difficult to do some types of queries (e.g. free text queries, geospatial queries) that the search API handles very easily. Thus, you could store your main entities in the datastore, but then use the search API if you need to search in ways the datastore doesn't allow. Down the road, I think it would be great if the datastore and search API were more tightly integrated, for example by letting you do free text search against indexed Text fields, where app engine would automatically create a search Document Index behind the scenes for you.
like image 78
adevine Avatar answered Sep 17 '22 06:09

adevine


The key difference is that with the Datastore you cannot search inside entities. If you have a book called "War and peace", you cannot find it if a user types "war peace" in a search box. The same with reviews, etc. Therefore, it's not really an option for you.

like image 33
Andrei Volgin Avatar answered Sep 18 '22 06:09

Andrei Volgin