How to port a PostgreSQl database to Google App engine - google-app-engine

i am currently doing a project as one of my university projects and it uses Google maps and right now i am using a postgresql database which is on my localhost but i want to host it some where else i couldn't find any free hosting for postgres and i don't know whether i can use Google App engine or Fusion tables to do it. i am using postgres and php to manipulate data and generate KML files. Google Maps V3 javascript API as the front end
any suggestions ?
Thanks !!

PHP is one of the most requested features, but it is not yet supported in GAE, so your PHP code is useless. In the future, hosted SQL databases seem to be part of Google plans to provide "Enterprise features" in GAE, stay tuned because that could simplify what you need to do.
Currently, in case that:
your site is implemented as a Java EE or Python web appliaction
you are already using JPA/JDO (only in the Java EE case)
you are not doing JOIN statements (not supported in GAE)
Or even if your service/dao layers are already well isolated, it would be possible to host your "denormalized" database (it would not be a postgres service) and your frontend in GAE without too much effort.

Related

MERN app - how does someone run it locally with a database connection

So I have 2 assignments for different job applications. I can deploy on Heroku by using the free Cluster in Mongodb Atlas, but how would they get the second application to work on their computer? I want it to be as easily done as possible for them, but it seems that they will need to download Node.js and MongoDB compass to their computer.
Any other suggestions?
have you considered using a PaaS?
If you build the app only for the purpose of the interview then it means the webapp should be "accessible/live" only for a few hours at max while it's being reviewed.
The major cloud providers have some free tiers which should help host your app for the interview for free.
(for DB MongoDB Atlas should be good enough)
There are many articles on that since the cloud is very popular nowadays.
Services like: Azure Web Apps, Azzure App Service, Google App Engine and so on should work.

Connecting to AppEngine datastore in development via Cloud Datastore API

We are currently running a combined AppEngine / GCE app and thus far have kept all of our datastore access on the AppEngine side of things. Now we are exploring also allowing our GCE instance to make some queries into the (shared) datastore. To start, I'm trying to figure out how to run things locally. What we have so far:
A Go devappserver running
A Go standalone binary that wants to issues queries to the devappserver datastore.
We installed ('go get') google-api-go-client/datastore/v1beta2 so that we can use an API instead of issuing direct HTTP calls. However we are definitely willing to issue direct HTTP calls if this API library won't work in development.
We have service accounts set up (we already access GCS from GCE) but I doubt that's relevant for running locally...
I've seen some docs but they (a) only talk about Python & Java, and (b) discuss connecting to the (standalone) development datastore server, as opposed to the datastore embedded in AppEngine's devappserver (if those are even different?). There is also the following answer here on StackOverflow, but again it discusses connecting to the standalone development datastore server:
How to connect to the local google cloud Datastore db?
Any pointers would be much appreciated!
Ian
Currently this is not possible in the development environment for several reasons. The Google Cloud Datastore tool (gcd.sh) uses the java development server. However when developing go for App Engine you use the python development server, which has different underlying storage. There is a bug to track this issue on the github page.
You can still develop a Google Cloud Datastore application in go however there are many bugs in the current go client library. Unfortunately, the development server does not currently support the JSON API, which the go library uses (see the note at the top of the page).
Update: I wanted to make sure proppy's comment was seen as part of the answer. His suggestion does provide a way to use the protocol version of the API, which is probably more stable than the go client library above. It could also let you use the gcd.sh tool to test this in the development server. You will have to craft the HTTP requests yourself though, and you won't be able to share the data in the datastore between your application and the Cloud Datastore in development. However it is definitely a good workaround and lets you use the Cloud Datastore API, which as it develops will be easier to work with than other workarounds.
From proppy:
Note that you can still use Cloud Datastore Protobuf HTTP API with Go. The protobuf definition is available on GitHub, you can compile it to Go code using the Go protobuf compiler plugin and then send POST HTTP requests to /datastore/{version}/datasets/{datasetId}/{method}.
If the use case from your "GO" app server is straight forward enough, you may want to implement access by using an API call to your GAE service (perhaps extending the service to receive the API calls).
This has the added benefit of only having to make changes in one place if your datastore definitions or functions change.

google web engine SDK as a local web server?

I'm thinking of building a dynamic web site using Google web engine Technology, however I would like to use it in a local network without internet . Can I use the Google web engine SDK as a LOCAL SERVER.In other words, is the SDK just for development and testing purposes or it can be used as a server?
Should I worry about long-term use of SDK as a local web server, is there any scalability issues I should be aware of.
Thank you.
You probably could, but there'd be no point.
GAE makes all sorts of tradeoffs which only make sense in terms of the benefits you get by running on Google's infrastructure: for example, the limited querying you can do with the datastore, or the strict timeout on requests.
Plus, the development server is extremely limited in what it can serve, so you'd need to put a proper web server in front of it anyway.
If you're using Python, you can use webapp2 as a standalone WSGI application, although you might be better off going directly for something like Django. I don't know much about serving Java apps directly but I guess you can use Tomcat.

Salesforce's Database.com and Google App Engine via JPA

Currently i try to connect (via JPA/Datanucleus) with an application, hosted by Google App Engine, to the database service of database.com (Salesforce)
After many hours of reading and trying, i could not find any solution.
So, is it even possible??
Some Information....
Database.com provides JPA: http://forcedotcom.github.com/java-sdk/jpa-provider, but i could not found any sdk on this side, but i found a jar-file hosted by grepcode http://grepcode.com/snapshot/repo1.maven.org/maven2/com.force.sdk/force-jpa/22.0.7-BETA/ - Possibly there is currently no official release ...
The problem is that this SDK from Salesforce needs datanucleus 2.0, but Google App Engine includes only datanucleus 1.1.5. So i try to update theses libaries and found this.... code.google.com/p/datanucleus-appengine/ . I tried a few hours to replace the old libaries and to use the newer, but unsuccessfully. The error was that eclipse could not find some libaries, because the newer libaries, provided by the side above, have different package structure -
I am thankful for any help...
Kotake
The official release of the JPA provider is available on Maven Central:
http://search.maven.org/remotecontent?filepath=com/force/sdk/force-jpa/22.0.7-BETA/force-jpa-22.0.7-BETA.jar
The external connection restriction won't be a limiting factor because the JPA adapter connects to Database.com over https using a SOAP API.
I can't speak to the challenges around getting DN 2.0 running on GAE. Perhaps GAE support can help with that?
As stated here in the App Engine docs, you cannot make direct connections to external servers from GAE (except over http or https using the app engine specific url APIs). You will need to find some other way to get data out of your remote database.
This link describes how to solve your problem:
How to use Force.com Database SDK on Google APP Engine
(He has updated the Saleforce SDK source code to allow it to work without problem on GAE.)

Hosting/transferring a web site on Google App Engine

I have my website currently hosted on paid server, but i want to transfer it on GAE.
How can i do it? Can anyone please help me in this case.I'd appreciate your help.
Thanks:)
1) First you will have to adapt your website to the GAE framework (python with django or the new Java environment). You can test your work by downloading the SDK of GAE which offer a local server.
2) Then create an account on appengine.google.com and upload your application on something.appspot.com, test it.
3) If you have a domain name, create a google apps account on this domain, and finally bind this domain with your GAE website. Here is the Google doc.
If it is just a static website which does not need server side scripts or a database, then you might want to look into Google Sites instead of Appengine. You can find out more about Sites here: http://www.google.com/sites/help/intl/en/overview.html
If you do have some server side logic going on, you will need to convert it to either python or java and convert your relational database to Google's Data API which does not support the SQL your current database uses. You can read more about the APIs and what is supported with the Data API and tutorials at: http://code.google.com/appengine/
In response to sanorita's comment "Actually, it's generated html and not plain html. and google appengine is for static data... right?":
AppEngine can host static data, but that is far from its intent.
The purpose of AppEngine is to allow developers to easily deploy their dynamic applications on Google's infrastructure. In the end, assuming you have programmed your app in effective ways to handle scaling (basically just noting that writes to the database are expensive, and contention is the root of all evil) you can handle nearly any amount of traffic.

Resources