What are the advantages of using Google Cloud Endpoints, explained in non-technical terms with examples? - google-app-engine

I have previously used
#app.route('/mypage/<int:myvariable>/')
to create rules for what should happen when users land on different urls on my website. I have done this on local machines that have been running on my own virtual servers.
Now I am learning to publish my first web app to Google App Engine. I have heard that I should be using Google Cloud Endpoints instead of the route decorator.
#endpoints...
I've read a few articles about endpoints and some of the benefits of endpoints that they list are:
Endpoints makes it easier to create a web backend for web clients and mobile clients
Endpoints free you from having to write wrappers to handle communication with App Engine
Even if I have read this I can't wrap my head around what this means. I don't understand it. Can you explain in non-technical terms with examples what the advantages of using #endpoints is compared to alternatives? The alternative that I am familiar with is #app.route.

Google Cloud Endpoints can be thought of as a subset of #app.route. They are intended to solve the API backend problem for mobile and javascript clients. They are not intended to serve web pages and other hypermedia. You can use the normal routing methods of your framework of choice to create a web service for your application but Google Cloud Endpoints takes care of a lot of boilerplate for you.
There are a lot of limitations with Google Cloud Endpointsso be sure to familiarize yourself with them before committing. For one, you cannot host Google Cloud Endpoints on a custom domain name. They are only accessible via <app_id>.appspot.com/_ah/api/*

Endpoints makes it easier to create a web backend for web clients and
mobile clients
What this means is that you can create one backend and then iOS, Android and Web-apps (via Javascript for example), can execute your API methods with specific client generated libraries.
This is convenient if you are building a backend that you want to be easily accessed via smartphones or through a web browser.
Endpoints free you from having to write wrappers to handle
communication with App Engine
With Endpoints you can generate client libraries (e.g. Android, iOS, Javascript) that you can then execute your API methods. You don't have to worry about writing a bunch of additional code to do that.
My Opinion:
I have never used Cloud Endpoints to make a web-app but it is very convenient if you are making a mobile app for iOS and Android because you can access your backend with both platforms.
One reason you might want to use Cloud Endpoints for a web-app instead of something else is because of Datastore. Datastore is the way Cloud Endpoints stores data. It is a NoSQL storage method which is kinda tricky to wrap your head around at first if you come from a relational database background, but once you get it, it makes a lot of sense.

Related

how can I use google app engine with an application in phonegap

I have been developing a Phonegap client application, I need to create a web service that storage all the data that i will be sending through the app.
I want to use google app engine to create the database and the web service.
I have read a lot, but i don't find a concrete example of how to do it and how to call the web service then from the application with phonegap.
Anyone have an example of how to do this?
You can use Cloud Endpoints with your app:
Google Cloud Endpoints consists of tools, libraries and capabilities
that allow you to generate APIs and client libraries from an App
Engine application, referred to as an API backend, to simplify client
access to data from other applications. Endpoints makes it easier to
create a web backend for web clients and mobile clients such as
Android or Apple's iOS.
For mobile developers, Endpoints provides a simple way to develop a
shared web backend and also provides critical infrastructures, such as
OAuth 2.0 authentication, eliminating a great deal of work that would
otherwise be needed. Furthermore, because the API backend is an App
Engine app, the mobile developer can use all of the services and
features available in App Engine, such as Datastore, Google Cloud
Storage, Mail, Url Fetch, Task Queues, and so forth. And finally, by
using App Engine for the backend, developers are freed from system
admin work, load balancing, scaling, and server maintenance.
It is possible to create mobile clients for App Engine backends
without Endpoints. However, using Endpoints makes this process easier
because it frees you from having to write wrappers to handle
communication with App Engine. The client libraries generated by
Endpoints allow you to simply make direct API calls.
Available in Python | Java
we have done similar thing for our Cordova/ionic based application. Its very simple and straight forward using javascript client of google cloud endpoint.

how to connect Google App Engine PaaS to DaaS

I want to connect my GAE Java project (Paas) to third party Cloud SQL (DaaS), I just want to know is it possible or not!
Details:
With my basic fundamental knowledge on J2EE I'm doing some hacks onGoogle App Engine (Java) PaaS, since Google cloud-sql for GAE is paid I want connect the GAE to any third party cloud SQL service (DaaS) like nuvola which offers free service for limited time period. Developers pain point is Google Cloud storage/ sql doesn't allow free space for developers unlike other platforms like Parse, kinvey etc will do.
update: URL Fetch API we can do that, I'm not sure it's the right way or not! also URL Fetch API Calls are Outgoing Bandwidth are billable!!
If you want to connect to external systems, the recommended way to integrate with them would be via Web Services.
You have 2 options:
Look out for a Web Service (typical REST with JSON/XML data) for your chosen data service provider in the cloud. You can then integrate your GAE app via URL Fetch API.
There is also a likelihood that your data provider also provides client libraries (Java, Python, etc) which you can easily integrate into your application. That would ease the integration.
App Engine also supports Sockets, but they are currently in Preview and available only for Paid Applications.

GWT and Google Docs API

I'm using GWT to create a simply app that allows teachers to create easily their own lessons.
The App is going to be on Google App Engine but I want to store lessons in user's Google Docs space .
Is it possible?
As far as I know gwt transforms java into javascript but google docs api is java, do i have to upload the java library to de app engine storage?
any place to start? any advice?
Thanks...
You need server side proxy for GWT client.
Your GWT client communicates with the servlet. The servlet is the actual agent using the google docs API.
Please read my explanation at http://h2g2java.blessedgeek.com/2010/05/accessing-google-userservice-from-gwt.html.
It explains how to get a GWT client could communicate with a Java based Google API. It explains that since GWT requires all Java source involved to be available to the GWT compiler, there are cases that you simply cannot get GWT client to do the task directly.
http://h2g2java.blessedgeek.com/2009/08/tablemgr-gae-gwt-gdata-with-rpc.html similarly explains how to combine gae + gwt + google docs, using the proxy approach. The posting is quite old and therefore the web site it points to does not work anymore because I have not updated the gae app with google mandated authentication measures. But it should work on your local machine.
The above subscribes to a webserver flow paradigm.
However, Google APIs are essentially REST APIs, which allows you to access them directly using your javascript or GWT client. So, instead of using the Java docs for Google APIs, you need to read the Google REST API docs.
http://code.google.com/more/, among other whatnots, provides a list of all the Google cloud APIs. To avoid using the webserver-proxy flow paradigm, choose the javascript or REST version of the API docs.
Here is the google docs/data API:
http://code.google.com/apis/gdata/docs/client-libraries.html.
Choose the javascript API:
http://code.google.com/p/gdata-javascript-client/
I advise you to first practice using these APIs by coding in javascript. Then you would get a good grasp of what you need to do in GWT.
You should use the GWT API for authentication prior to accessing the Google REST APIs.
http://code.google.com/p/gwt-oauth2/.
Essentially, you are obtaining an authenticated token which your client could use to access Google's data thro their REST APIs.
FYI, REST APIs are, in plain speak, URLs in a defined specification, where data transmission is by convention mostly in JSON or XML.

Does Google App Engine Support JAVA Proxy API's?

I have a question surrounding the REST service. I have an application written in C# , i want to put this application onto the cloud. I have a small problem, My Application has a built in C# API. I want to interact with my application and Google app engine. I want to develop a JAVA PROXY on top of GAE so that it can interact with my application using REST protocol and performs CRUD operations on Cloud and returns back data to my application.
Is it possible to do this ? to what i know is that SANDBOX feature doesn't allow us to directly interact with the App Engine.
Any suggestion on this.........
Thanks Heaps
Suraj
You don't need Java Proxy API in order to make http requests to another server (I guess you did not have java's Proxy class in mind?).
Yes, AppEngine can make HTTP/REST requests to other servers via URL Fetch java API.

How to Build a Facebook-like Platform on Google App Engine?

I am interested to build a platform on Google App Engine where one Master App provides common functionality to several child Apps (Web portals).
Master App:
Offers Common Social Networking features
Common user database
Interacts using Web services API
Child Apps (Web Portals):
Connects to Master App for user database and social networking features
Uses Local business logic for local features
My Design plan is:
Master and Child Apps will be
individual Apps on GAE Appspot (for
easy management)
All will communicate via REST/JSON?
I will enable billing for all Apps so
nothing is against Google's usage
policy.
Will use SSL for login into Master App, later use a token
(cookie) for further interactions
Could anyone kindly spot risks and suggest any improvements?
Your "Master/Child" concept will be hard to maintain, introduce issues with cross-site-scripting and most importantly be completely against Google App Engine's terms of service for combining multiple apps into one.
4.4. You may not develop multiple Applications to simulate or act as a single Application or otherwise access the Service in a manner intended to avoid incurring fees.
You could use multiple app versions (defined on app.yaml) to deploy different codebases to the same appspot.com subdomain, and access them like http://app1.myapp.appspot.com, http://app2.myapp.appspot.com for "versions" app1 and app2. You could even have one version running on Java and another one on Python.
They'll all share the same datastore, although you'd be able to use namespaces to separate them if necessary.
For the distributed nature of the architecture you proposed, I'd suggest having a deep look at Facebook's graph API and Twitter's API. They both use oAuth for authentication/authorization and already have a proven implementation of what you're trying to accomplish.

Resources