I need to deploy a web app with its postgreSQL db on google cloud platform.
How can I connect to this db from mobile devices? I'm not allowed in this project to connect to db direct via mobile devices but via REST API.
So will I need to deploy also a REST API ex. in PHP, or Google Cloud has a REST API to access db from client devices?
Related
I'm new to working with back-end, but have been running into issues trying to get my iOS app to connect to my PostgreSQL DB.
I have developed an app with Swift which is a game that I want to run locally on iOS devices. I have a PostgreSQL DB set up in Google Cloud Platform but I cannot figure out how to get the Swift app to connect to my PostgreSQL DB.
I've read some about using Vapor or Perfect to run the application using Googles App Engine but I'm not sure that is what I want to do since I want the app to run locally but there are a few aspects of my app that I need a global database for.
Would anyone be able to point me in the right direction of how I need to connect my Swift application with Google Cloud's PostgreSQL?
Your question is pretty much very similar to this one.
In short, the correct answer is you shouldn't connect your client side application directly to the database. Instead, you should build a service that can connect to the database, and act as a service between your application. This helps prevent any unauthorized queries to your database and provides better performance. If you wanted to do this on GCP, you could look into something like Google Cloud Functions or Google Cloud App Engine to act as a service.
An alternative would be to use a "Database-as-a-Service" like Cloud Firestore. This is a scalable, pay-as-you-go service with great mobile support.
Yeah sure you need a server, ruby on rails to connect to your Postgres database.
The server will facilitate data back and forth from the Google cloud Postgressql
I have a Raspberry Pi3 device which has Android Things dev preview 0.6.1 installed. On completing certain operations, the device needs to send data to Google Cloud Storage. To do so it must have an API key to authenticate itself.
In Android devices it could be done easily using by integrating Google Sign in Option but since my Android Thing device doesn't have any interface, Google Sign In could not be implemented in it.
I have gone through github project Android Things Weather Station Sample which is using Google Service Account to publish data to PubSub. To do so, it generates and imports a credential.json file into the project and somehow generates credentials from it.
So my question stands is, without user consent, can we use Google Service Accounts to authenticate with Google Cloud Storage? If yes, how can we generate access token from it ? If no, is there any other method to authenticate with GCS?
The simplest and most secure way to authenticate your IoT devices with Google Cloud is using Cloud IoT Core to publish data over MQTT or HTTP into Cloud Pub/Sub. Cloud IoT Core is a bridge designed to securely manage large fleets of devices and authenticate them with your cloud project.
Take a look at the SensorHub sample app on GitHub, which is similar to the weather station, but uses Cloud IoT Core to authenticate and publish instead.
As Shubham stated, using a service account is one way to authenticate devices. Otherwise you'd need to build a mobile companion app which you use to authenticate the user. Then you would have to transfer that token to the IoT device.
In case anyone faces the same issue, I found this document which has explained the way to authenticate devices with Google Cloud without the consent of a user.
Azure App Services Mobile Apps can provide a Custom API hosting service which looks very similar to API Apps.
What is the real difference between the two?
Is it possible to consume Mobile Services from API Apps Node Backend ? Is there any Mobile Apps SDK available for NodeJS ?
https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-node-backend-how-to-use-server-sdk/
Azure API Apps is for hosting APIs that will be consumed from a variety of clients, and where it is acceptable to codegen a client, or make direct REST calls.
Azure Mobile Apps defines a client and server SDK with a protocol for communication that adds additional functionality for things such as offline sync. Offline sync is not possible with API apps, because there is no actual client SDK, just tools for generating one for different platforms.
Is it possible to host an Azure Mobile Service? (Published on my own server)
I only want to use the Mobile SDKs to sync tables on mobile applications, I don't need push notifications.
I also want to have a Web API controlling this data in the same project, is it possible without having NuGet Packages problems?
Other question, do I need the Azure Mobile Backend to make it work with the Mobile SDKs (iOS, Android, etc)?
If those solutions don't work, I'll be hosting this on Azure and probably managing the data with another Web API self-hosted.
You may want to consider Azure Mobile Apps which allows full control of your deployed site.
The Mobile Services backend, or Mobile Apps server SDK is required for the Azure Mobile client libraries to work.
I'm using Google Cloud Datastore and I'm ok with it, but I have faced with an issue: is it possible to access Google Cloud Datastore (not GAE) through JDO, JPA or Objectify?
If yes, how to authenticate and connect them?
The Cloud Datastore API does not currently provide client libraries that support JDO, JPA, or Objectify. However, we are working on porting the App Engine Java client library to work on the Cloud Datastore API, and that should enable JDO/JPA/Objectify as well.
https://github.com/GoogleCloudPlatform/google-cloud-datastore/issues/34