I've GAE application which creates some data in the Google Cloud Datastore and stores some binary files into the Google Cloud Storage - let's call the application WebApp.
Now I have a different application running on the Google compute engine. Let's call the application ComputeApp.
The ComputeApp is a backend process which is processing data created by the WebApp. I asked here in this question previously which API can I use to communicate with Datastore from the ComputeApp. As suggested by #proppy, I implemented the Datastore communication using of the Google Cloud Datastore API.
Everything works fine as far as I'm communicating with the Datastore in the Google cloud. I'm using the service account authentication.
Now I need to run my ComputeApp locally, on my development PC so I'll take data created by my local WebApp and stored into the local debug Datastore. I need it because I want to have a testing environment so I can debug may GAE app locally.
How should I modify my ComputeApp code to force it to connect to my local debug Datastore instead of connect to the Google cloud?
I googled a lot and didn't find any advice nor example. Only possible way I found that I should rewrite my code completely and use a different API to do that. Such is Datastore Remote API.
Is this really only way? Should I really rewrite whole ComputeApp to connect to the local DB?
Really?
I hope that I just overlooked something important and It's not true...
Google Cloud Datastore has a local development server that you can use: https://developers.google.com/datastore/docs/tools/devserver
You can create and start the local datastore using the gcd tool which is linked to in the doc above.
If you use DatastoreHelper.getDatastoreFromEnv(); to build your Datastore, you can tell it to connect to your local database by exporting the env variable DATASTORE_HOST:
export DATASTORE_HOST=http://localhost:8080
Related
I am using Java Client Library to use google Dialogflow. My questions is what happens when we use "appEnginedeploy" using gradle? Where is the code stored and more importantly how the implemented database and other files of code stored and accessed by our agent?
Thanks!
appEngineDeploy is setup to deploy the code to App Engine, a computing platform on Google Cloud. Code and associated project files are stored as they are in your project.
It's not entirely a VM, so you shouldn't necessarily think of App Engine as locating filepaths. If the project can make the links locally, then it should behave the same way in App Engine.
With regards to databases, it would depend if you're using an embedded database or using a hosted solution through another Google Cloud service. Presumably you'd use the database APIs for a Cloud service as shown in the documentation.
I am new to AWS , want to develop a cloud ready java application REST API.
The application will hit the MySQL database and produce output as JSON after querying the database.
IP:port/application?q=<query> response is JSON.
How to achieve it ? the data in MySQL is mostly static 100MB data but used very frequently.
It is very straight forward. if you already have same application running in your local system , then you can just move it to AWS , using below steps :-
spin up new ec2 instance, if you are using a free-tier then you can spin up lots of AWS resources for free , more information on https://aws.amazon.com/free/ .
install all the required s/w like Java, maven , tomcat and mysql and whatever your application is using on Ec2 instance . you can even have a free RDS (Database) instance in free tier which you can use for your application , instead of having the database installed locally on your application server.
while creating the ec2 server , configure instance security group properly for ex 8080 for http and 22 for SSH , 3306 for mysql etc. (This is important and try to be as restrtict as possible to make it safe from hackers).
build and deploy your application and access it using any REST client , by giving instance ip and application port number.
There are several resources online for AWS , you can refer https://www.youtube.com/watch?v=oS7VYX7LXUo which talks about deploying a java application to AWS.
Let me know if you need any other information.
Deploying Java apps (for example, a Spring BOOT APP) that interacts with the Amazon Relational Database Service (Amazon RDS) to the cloud is easy when using Elastic Beanstalk. An example of a Spring Boot database application that queries data from MySQL running on the cloud is documented here: https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/javav2/usecases/creating_secure_spring_app
I need to deploy neo4j in embedded mode to a cloud solution(such as heroku) and store the database somewhere else - i am thinking about multiple problems.
If i store in s3, i will have to retrieve the database, load it all in memory, and then send updates constantly with the new database. This is obviously not valid.
I am reluctant to using the neo4j add-on, because i can only use the REST calls, can only deploy in the US region, and i can't use server plugins.
Any ideas/solutions?
Best
I'm one of the founders of GrapheneDB. We don't support embedded mode, but we are about to release support for custom plugins and server extensions.
Our shared databases are hosted in the US and our dedicated servers can be setup in any AWS region.
You should check http://www.graphenedb.com/ which is a hosted neo4j service.
I am deploying a app in Google app engine. It has deployed successfully but database is not deploying.I have developed this app in java using Google app engine.
When i see the data in data store Viewer in app dashboard so it not showing any thing.
I haven't used Google App Engine in a long time, but I don't think it's MEANT to be deployed - after the initial deployment this is obviously an issue as you don't want to overwrite your production data.
This post may help: Google AppEngine database
Matt Salmon is right, your local datastore and the remote one are two different things. In order to start seeing stuff in the datastore viewer online you will have to interact with the deployed application and start inserting data. Since you manage to have some data locally, you should be able to do the same online.
Also your local datastore will be reseted from time to time, but if you want it not to be deleted then run your development server with an argument: --datastore_path= and if you're also using the blobstore: --blobstore_path=DIR.
I'm new to app engine, so bear it with me.
I've a App-Engine web app project that does multiple things and populates Database using JDO persistence. App takes long time to execute, so I prefer running it offline (as time limit is much higher).
Now where is this local JDO data persisted?
I can access it at http://localhost:8888/_ah/admin
How can I export this database to App Engine?
There is a bulk uploader for the appengine (written in python) that can be used to upload data stored in datastore for your app.
Unfortunately there is no equivalent tool (provided by google) in java.
On your second question, the local dev server stores data in
<app-dir>/WEB-INF/appengine-generated/local_db.bin
This forum suggests that you will have to write a script and use datanucleus's rest api to do that for your java appengine app.