I deployed my java app on app engine and created a separate vm instance in google compute engine that have mongoDB installed. So how can I use GCE hosted MongoDB with my AppEngine java application.
1 Answers
0
votes
In appengine standard environment you cannot use mongodb. Appengine does not provide or support drivers for mongo db. The mongo db driver requires a persistent socket connection to the database. This is something appengine does not offer (socket connections cannot outlive a request thread), thus it's not supported.
You have these options:
You can create a REST interface on compute engine for your mongodb queries and have your app engine app use the REST interface to communicate with the database.
You can use app engine flexible environment, which does not have the same restrictions as the standard environment.
Use appengine's own datastore