When/Where to create index for Search API - Java

29 views
Skip to first unread message

Akash Eldo

unread,
Dec 29, 2018, 12:34:29 PM12/29/18
to Google App Engine

I'm creating a Java web server on the Google App Engine to do full text search on my database. Before I can search, I have to add all my database entries to an index. I should only have to do this once because the index is stored in persistent storage. Even if GCP creates a new instance of my Java server, the index should still be there(right?).


My question is, how do I set up my program so it will only create the index once? I've tried using Warming Services, but as I understand it that will be called every time a new instance is created, so there'd be redundant calls to my index creation code

George (Cloud Platform Support)

unread,
Jan 3, 2019, 10:38:07 AM1/3/19
to Google App Engine
Hello Akash, 

Do you refer to a Java web server in App Engine Standard Environment, or Flexible? Do you refer to a MySQL server running in Compute Engine? If it's Standard or Flexible, you don't have access to the local file system, so you cannot store anything. You can't install database instances on your file system in an instance of your server in App Engine. To reply to your question: the index should not be there, because you cannot write it locally in the first place. 

If, by contrast, you refer to a Cloud SQL instance, you don't have to worry about storing indexes locally to your Java web server, as the instance is not local, but runs on a Compute Engine VM.  

Do you plan to install MySQL on a Compute Engine VM? In that case, the index is stored by the VM, so is not local to your Java web server. 
Reply all
Reply to author
Forward
0 new messages