Which API for App Engine and Datastore? - java

I'm using Java and I want to use Datastore with App Engine. Which API should I use?
There is
'com.google.cloud.datastore' and there is 'com.google.appengine.api.datastore'
More specifically there is 'com.google.cloud.datastore.Entity' as well as
'com.google.appengine.api.datastore.Entity'. How do I decide which one to use?
Edit: I'm using Java 8 and App Engine standard. I'm also using Eclipse and Cloud tools. When I add Library using 'Google Cloud Platform Libraries', jars for both are added. See: https://cloud.google.com/eclipse/docs/libraries

The endpoints you mentioned are for the API and the Client Library:
com.google.appengine.api.datastore -> The API is specifically designed to work from Apps deployed on AppEngine.
com.google.cloud.datastore -> The Client Library could be used form any Application.
You can see the main difference of them here. Nonetheless,the way of calling DataStore would be mostly based on your environment (i.e Java8, Java7, AppEngine Standards/Flex, external applications).
Same applies for the Entities. One is for creating Entities with the API, the other one with the methods from the Client library.

Related

Where can you run GAE application built with "integrated" Datastore?

Where can you run GAE application built with "integrated" Datastore? Meaning, those application that were build prior to Google platform making the Datastore a separate service from the "core" GAE service. That is without modifying the project.
Can the current Google App Engine run "legacy" applications?
According to the first question App Engine can use Datastore without problem, what do you mean about "integrated"?
But Apps that use these APIs can only run in App Engine and will need to upgrade to the recommended Google Cloud APIs before migrating to newer App Engine runtimes.
And regarding to the last question App engine still provide support to:
Python 2.7
Java 8
Go 1.11
PHP 5.5

Create Azure API App without Swagger.io

I'm using Azure for the first time and wanting to make a very simple RESTful API, but trying to follow the example using Swagger.io feels like a lot of work for what I want to achieve. Is there a way to just write Java code for JAX-RX without going through the Swagger.io generator process?
Service description stating that you can bring your API as is:
Bring your existing API as-is - You don't have to change any of the
code in your existing APIs to take advantage of API Apps -- just
deploy your code to an API app. Your API can use any language or
framework supported by App Service, including ASP.NET and C#, Java,
PHP, Node.js, and Python.
Swagger support facilitate ease of consumption, since you able to auto generate client sdks in various languages based on swagger spec. Nothing prevent you not having swagger and still use service.

Could the Google App Engine be used to drive a desktop application?

I have the impression that the Google App Engine allows an interface for developers to make use of Google's servers for storing custom application data in a highly scalable and cost effective way. Whilst working through their tutorials, it seems like tools are focused on aiding the development of 'web applications'.
I'm looking to take advantage of the GAE in order to serve data for a platform independent desktop application that I'm writing in Java, so my end product will not rest within the confines of a browser. Is this functionality supported by the GAE?
Yea! you can do that.
So basically, you are going to build a native application and use API calls to send/receive data from a server(GAE). I see a good solution will be to
Build your API endpoints using the Endpoints lib https://cloud.google.com/appengine/docs/java/endpoints
Then, depending on your application you can make API calls directly or build a client library

Can I use Google's Datastore for a desktop application?

I was asked to provide a quick and easy solution for storing data in Java, and since I had experience in working with Google App engine, I thought that I could just use their Google Cloud Datastore (https://developers.google.com/datastore/). But, the project that I'm working on now is a desktop application with a GUI. My question is, would I be able to use these services even though the application I'm developing isn't a web app, and uses Java's GUI components?
Yes you can. The Cloud Datastore gives you access to the normal App Engine Datastore but does not require you to be running a web app. You can then use all the normal Datastore tools that App Wngine provides to manage your data.
You'll want to follow these instructions for setting up your Cloud Datastore project to connect from your GUI app.
It depends. dev_appserver isn't a hardened environment, and simulating a deployed environment is a priority over performance. dev_appserver provides a simulated Datastore, not the real thing. That said, I've built several single-user, locally-served web apps using both the Java and Python dev_appservers, because it was a convenient way to get started and performed well enough for my purposes.
I don't see why not,
Not a java dude, but it says it exposes a HTTP interface, so this:
code.google.com/p/google-http-java-client/‎
should allow you to communicate with it I believe.
Also perhaps have a read of this question
Database for Google App Engine and desktop application

Alternatives of Google App Engine + Java

If I develop my web application on GAE using Java, in future would I have easy migration opportunities, or will I stuck to GAE?
What can be other alternatives of Google App Engine + Java?
Not:
An GAE you are pretty much developing inside a Google managed Container - against restricted Java and other APIs. This is the PaaS - Platform As A Service approach to cloud computing. This would be similar to the Salesforce, Facebook etc approach.
However for most flexibility you should look at IaaS - Infrastructure As A Service Cloud platforms (like Amazon/Rackspace/etc..) where you have most flexibility.
We currently use both Rackspace and Amazon and have machines as our elastic containers on top of which we can deploy anything we want (custom Ubuntu image etc..)
With some care, you can write a Java app such that it will work both on and off App Engine. A better option, though, would be to use AppScale if you choose to leave App Engine. AppScale provides an App Engine compatible environment on your own hardware.
right now most viable competitor of GAE is Windows Azure. You can easily build a site/application in Azure without getting dependent on Azure framework. There is /very/ little from Azure APIs that you have to deal with(mostly for diagnostics). If you decide to use other Azure services, like table storage services, you'll want to get real good at abstracting yourself away from the table storage to make your code portable. Dealing with SQL Azure (at least from utilization perspective) is no different then using SQL Server and you would need to make a simple abstraction from actual rdbms implementation (most data access libraries do that anyway) to later utilize MySQL or Oracle, etc.
You will probably be stuck to GAE (or a very similar platform you could replicate on your own).
Alternatives: Amazon EC2? Windows Azure?
Using GAE requires you to design the app around their system so migration could require a rewrite. Certainly their NoSQL db at the least. Some people are saying Amazon EC2 is a better bet, but I haven't tried it yet. Also I prefer python-based stuff like Django, rather than Java stuff. Try the pyjamas client-side toolkit also.

Categories