Accessing a Google Cloud mySQL DB

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
simon.schvartzman
Posts: 641
Joined: Tue Jul 29, 2014 12:52 am
Location: Brazil

Accessing a Google Cloud mySQL DB

Post by simon.schvartzman » Tue Dec 03, 2019 2:26 am

Hi fellows, I was able to successfully run a simple CRUD App connected to a mySQL DB hosted on Google Cloud. To be able to connect to the DB I had to define the IP address of my workstation as an "Authorized Network" in the DB Connection Configuration.

Now I want to be able to be able to connect from "any network" (a LC app running on a mobile) and in order to do so (according to the Google Cloud documentation) I had to use a Proxy which seems a rather complicated (for me) process and therefore I wonder if any of the experienced developers in the forum has done this and is willing to share the recipe...or at least give some hints (besides the GC documentation)

Many thanks in advance
Simon
________________________________________
To ";" or not to ";" that is the question

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9833
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Accessing a Google Cloud mySQL DB

Post by FourthWorld » Tue Dec 03, 2019 3:20 am

Do they offer a REST API?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

simon.schvartzman
Posts: 641
Joined: Tue Jul 29, 2014 12:52 am
Location: Brazil

Re: Accessing a Google Cloud mySQL DB

Post by simon.schvartzman » Tue Dec 03, 2019 11:20 am

Hi Richard, thanks for jumping in. Could you please tell what is your idea?

I'm not sure if there is such option but in searching for the answer to your question I found this article "Authenticating users with PHP" (https://cloud.google.com/php/getting-st ... cate-users) which I guess points out in the same direction. I will explore this option further because it seems very interesting (even though it is billable...)

EDITED: it seems this solution wouldn't work a LC mobile app because according to Google Documentation
However, this can only be used for computing services that support Cloud IAP, such as App Engine and load balancers. You cannot use Cloud IAP on a local development machine.
So I'm back to the starting point
Simon
________________________________________
To ";" or not to ";" that is the question

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9833
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Accessing a Google Cloud mySQL DB

Post by FourthWorld » Tue Dec 03, 2019 9:01 pm

It's very rare that we'd want to expose the full power of MySQL to the open Internet. More commonly, the DB is protected from the Internet by an API accessed over HTTP, often using REST style. Depending on the cloud service, an API may be provided. Or they may expect you to provide your own, which would be written in PHP, Python, Perl, or just about any other general purpose scripting language commonly used on the web - even LiveCode Server.

This would explain why they require entering specific IP addresses to be able to touch the DB. Those are assumed to be administrators.

So the question is: What interface does Google provide for public access to its MySQL containers? If not HTTP-based, what is it?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

simon.schvartzman
Posts: 641
Joined: Tue Jul 29, 2014 12:52 am
Location: Brazil

Re: Accessing a Google Cloud mySQL DB

Post by simon.schvartzman » Tue Dec 03, 2019 9:57 pm

Hi Richard, in this article https://cloud.google.com/sql/docs/mysql ... on-methods all the options are explained.

All of them are too complicated for me, and I guess are very complicated as well to any "normal" LC developer trying to get the most out of the easy of use and power of LC together with a standard SQL DB.

In my case using LC Hosting is not a good option (beside the extra $$$) because as there is no Data Server in my region (Brazil) I'm afraid performance will be impacted. That's why I was thinking on Google Cloud because they do have a huge Data Server locally.

Still looking for alternatives...

Many thanks for taking your time to answer
Simon
________________________________________
To ";" or not to ";" that is the question

Post Reply

Return to “Talking LiveCode”