How to connect Swift to a postgresql database hosted on Google Cloud - swift

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

Related

Is there a way to host an app that uses MongoDB Atlas on Heroku without paying for an addon?

I am in the process of teaching myself deployment to Heroku, and trying to host a simple MERN stack application to Heroku. So far, every tutorial I've worked on (at least four so far) has told me to use the addon mLab, which is 1) being depricated and 2) currently requires payment.
I've also now tried to use object Rocket which also requires a monthly payment. Is it possible to connect my Heroku app to MongoDB without payment? Perhaps without an add-on? I'm looking to turn around and teach others how to deploy their applications to Heroku, but if there is payment involved, that would be a real issue.
Edit: just to clarify, I am aware that MongoDB atlas is free, but what I'm not aware of, is way to connect Atlas to my Heroku app in a way that is free.
Use the Atlas free tier. No addons are needed.
To connect to your MongoDB Atlas db is best achieved using Mongoose - a node module - at least that is what I am doing with my recently created React/Atlas application. Mongoose is available for Angular as well and makes working with Atlas very easy. A google search will provide many tutorials, I'm sure.

How to connect the back end and the front end and use the Discovery API in IBM cloud app services?

I am very new to using APIs so please excuse me. I am currently using a Python-Django App service from IBM cloud app services and the IBM Watson Discovery resouce. I have followed all the steps given here:
https://console.bluemix.net/docs/apps/tutorials/tutorial_web.html#before-you-begin
I have a machine that has docker and so the app got built successfully. However I am lost as to how I am supposed to get the front end ( which I am writing in bootstrap, javascript ) to connect to the backend and link the API.
EDIT
For example : I want my app to accept documents, feed them in Discovery, extract the keywords and sentiments and display them in the UI. How do I know what to access from the server side code and what to link where in the UI.
It is a very broad question but its a compulsory project I need to do and I am clueless. Pleaassee Help !
Before you try to integrate an API, you will need to be familiar with Python and Django. If that is not the case, then you really need to go through a series of tutorials.
Then before deploying to the cloud, you will be better off running your Django app locally on your laptop. Use pip to install the watson-developer-cloud pypi module and use the API documentation to build the python code in your Django application - https://www.ibm.com/watson/developercloud/discovery/api/v1/python.html?python#query
If none of this makes sense, then you need to brush up on your knowledge of Python, Pip, and Django.
When you have the app running on your machine, then you will be ready to package it up into either a docker image or cloud foundry container and deploy to the cloud.

Swisscom Cloud DB Backup fails

We are using a MariaDB and a MongoDB (single instance) service in the Swisscom App Cloud.
If i try to create a backup with the backup button, it starts to create one, but fails after a few minutes.
Also, if i try to delete the failed entry, the deletion fails as well.
The interface provides no further information about the reason.
This happens for MariaDB as well as for MongoDB.
What could be a possible reason and how am I able to debug this error? Where can I get further information about the error?
screenshot of Portal:
Simon here from the App Cloud Team.
There was an issue in the backend which we fixed this morning, so your backups should now work again.
Sorry for the inconvenience.
I developed a CF CLI plugin for DB backups (MariaDB) in Cloud Foundry, called "cf-mariadb-backup-plugin", that also works in the Swisscom App Cloud. Check it out here, and give it a star. ;-)
If you use such plugin it presents the error message catch directly from the Cloud Foundry API. This might provide you, at least, better reasons on why such actions are failing.

How do I set-up Rest API to the Mongodb installation on my Mac Pro

I'm developing a Google Apps Script application and I want to have a MongoDB backend to the application. Currently I am using a Mongolab sandbox account and successfully interacting with the collection on the Mongolabs servers. The performance is very good and the support at Mongolabs has been excellent.
That said, long-term I've decided to host my own Mongodb on my Mac Pro that is currently running Yosemite. I already have Mongodb installed and its working fine.
My Question: How do I use (install/configure/establish) a Rest API (or other means) to connect with my locally installed Mongodb database. I have spent a couple hours on 10gen's site and on Google trying to figure it out, but I have not quite gotten there. Does anyone have experience doing this or something similar that might be able to share your experience or at least refer me to a good resource.
Thanks in advance for you help.

Access control in Google Cloud SQL: Authorized apps

I have been using an instance of google Cloud SQL with several App Engine Applications for a while, and today I noticed the following announcement "You have not authorized any App Engine Applications and you do not have an IP Address assigned to your Cloud SQL instance. You will no be able to connect to your database in any way." But that's no true, actually it's running properly with the apps. Anyone has the same announcement in the Access Control or Google is having an issue? Or I should change the settings?
This is a bug, and we're currently working on a fix.