Google App engine with external app? - php

Is it possible to use the Google App Engine with datastore only and keep your application on an external traditional server?
I'm interested in the GAE for Business SQL service coming soon but I only want to use GAE for the database. I would like to keep the php application on a traditional server for a variety of reasons.
Is this possible?

Yes it is possible and GAE is fairly used in this specific scenario; think about the hundreds of Iphone/Android applications that use GAE as back-end.
A simple common design would have:
A Web API to communicate with GAE datastore since you can't connect directly to it from your php application. Have a look to restlet for a cool RESTful Java web framework that supports GAE or the new Appengine-rest-server Python project .
A security check to validate that the requests are coming from the php application (HMAC / SSL).

Related

Can you combine multiple Google App Engine to work as a single application?

My web app has multiple App Engines. Each App Engine has its own function. Apps were created with PHP as backend in Google App Engine and uses Cloud SQL and Google Cloud Storage for database and storage respectively.
The following Google App Engines are needed to be combined:
Client Database App
Permission Database App
Transactions Database App
Fields App
Reports App
Performance App
Data Entry App
Pattern Matching App
They are all coded in PHP and run in Google App Engine. They use Cloud SQL and Google Cloud Storage for storing data. Can they be binded together to function as one?
An App Engine application is made up of one or more "services." Many developers only use the "default" service. You can split your app into multiple services and each service has its own app.yaml configuration file and its own settings. In fact, an App Engine app could be comprised of services running in different languages (Python for one, PHP for another), and even both runtime environments (Python on flexible environment, PHP on standard environment).
One of the nice things about this "microservices" approach is that you can deploy or rollback the code for each service independently of each other. You can also share resources across them like Datastore or memcache (Memcache and a few others aren't currently supported in the flexible environment though). You can also pick different instance types or scaling options for different services, which could help you optimize costs or performance.
So yes, this is possible and can be a very good practice for many applications.

Mobile App - Communicating with an external server

I'm building a mobile project that needs to be in constant communication with a server and i need some information . I know how to build local apps but this is the first time that i'm building an app that requires external call to a server / authentication service .
I'm asking for guidance how to proceed and which services/servers to use.
What type of server/database do i need ?
I'm guessing i will be requiring an API service but no idea how to choose/make one.
I want to use azure services/database but i also don't want to be dependent on it. I want to have my own url that i send request to and interact with a server/db that i can later move to another host fairly easily.
I develop websites mostly and i'm familiar with php/laravel + Mysql but i think in this case it will be overkill to create a laravel app simply for the server backend .
The app will be mobile only so i don't expect to have a webpage for it . simply an external server/database where the data will be saved.
First i need an authentication service - where each user will register on the phone which will then be saved in my external server/database . Then when they need to login - they will input the login details on the phone , which will query the esternal server/database and if validated - get their details from the server.
First, you need to decide which kind of server communication you'll need. it's in real time and constant? then you'll need a websocket. It's in bursts when you need to send or get data? then you'll need some kind of webservice (REST, RPC, SOAP). Then you have to evaluate the user load you'll have. And finally, the human resources you'll have.
Based on your question, I think a REST webservice will be more than enough. You may:
-Create a REST service for every group of related resources. Example: the /user URL should handle the signup, login, logout and user update operations.
-Create a method for each one of those operations and handle them. Then, call the method from the REST service class.
-Depending on the amount of users and the technology you're using, create a server to handle the requests, or upload your REST project to a server (tomcat, for example).
-Create an app and consume the REST services from there.
There are tons of tech you can choose for these things. PHP allows creating REST services, I think. Java is a very good choice too, since you can use the same code in both server and android apps. Node.Js is pretty popular, too, since you don't need servers and uses NIO (althought java can do both things using jetty and also has multithreading); golang and scala both have superb performance (golang is a lot more easier to learn, though, and it has no need to use external webservers).
Hope this helps.
For mobile applications the best will be REST (representational state transfer),becouse is lightweight and flex to use in other technology. I had project which include REST and mobile app and web app and it working very well.
In this scenario, we usually will build a REST API service for client end. As you are familiar with Laravel, you can refer to http://www.programmableweb.com/news/how-to-build-restful-apis-using-php-and-laravel/how-to/2014/08/13#apiu for how to build a REST API service with Laravel. Also you can leverage other light 3rd part PHP frameworks to build REST API service.
You can create and develop the application on local and then deploy to Azure Web Apps. Please refer to https://azure.microsoft.com/en-us/documentation/articles/app-service-web-php-get-started/ for more info.
And there several vendors provide MySQL services on Azure. ClearDB is a BaaS on Azure for MySQL. You also can use the VM to host your MySQL Service. E.G. MySQL by Bitnami and MySQL by Docker.

Sending data to Google App Engine/Datastore

I have an Android app a Simple form consist of some fields, I also have a Web server using Google App Engine in PHP. I was confused by This, should i send the Data from my Android app directly to my webserver, display the data in web server using local and then later on update thus data in datastore or should i send the data from my android app directly to the datastore and display in my webserver? I'm new with this Android and with this Google App Engine/Datastore, I hardly can't find proper Tutorials on Google App Engine using php. I think only few uses this thing.
Any Suggestion well do.
The typical solution would be to provide an API for your app. I'm not familiar with PHP these days but there are bound to be plenty of REST frameworks that will take care of all the JSON conversion for you.
Your API (assuming it's PHP) can then take care of doing any necessary validation, authentication, performing queries, etc, against Datastore. This may help.
If you're familiar with Java (you're writing an Android app) or Python, you can look at Cloud Endpoints.
If you want a PHP library to access Datastore from GAE, check this out:
https://github.com/tomwalder/php-gds

Mobile application sharing the same data with the website

I'm totally new about mobile application development and i'm getting really confused about few things.
I'm actually developing web application under zend framework 2 (php framework) and Zend studio (IDE).
So to not starting all over again i want to make a mobile app (for learning purpose) with ZF2 and Zend studio.
I've been following that tutorial.
So i'm not sure to understand how the data are stored. Until now i have used MySQL with phpmyadmin for my web applications.
From what i understand, i need to use a cloud server such as Parse, phpcloud or else, am i right?
My question is, how the website and the mobile app will share the same data?
typically you will have to write web services that will expose a few methods which in turn will get the required data you want to share.
So your connectivity should look like Mobile APP --> Web Service --> DB
Make sure to thrown in some kind of authentication to avoid abuse of your web services. The webservice can be deployed on the same server that is hosting the website
One more way is to access the mysql database directly from your mobile application . This is NOT recommended because essentially you are exposing your DB to the world. This is OK in case of a corporate application which will only work within your company network or with a controlled environment.
You can use a PaaS like Heroku or Openshift to host your web application. But The web application must also expose a set of web services, which can be used to send and receive information to and from the mobile app.
I think the tutorial you mentioned explaining about building a mobile web site. That is you need to support your web site for small screens like mobile phones or tablets.
If you are planing to build a native mobile application, best approach would be to expose core services using RESTful web services.
using the same database... you have 2 options.... either make a php script to attend the mobile request, or creating a special mysql user that has access to the same database your website uses...

iOS Application, Website, and Web Service - Should I use a framework?

I am developing an iOS application that will be communicating with a PHP/MySQL web service to send/receive data. My plan is to also have a website that has similar functionality to the iOS application and will also interact with the web service. Should I be using a framework to build this web service (I am thinking about Laravel)? Is it a good idea to have the web service separate from the website?
Thanks.
If you are building a native application and requires connection to your website or collecting info, I suggest you to build you own API to access the data from ios using json.

Categories