Do Google Cloud SQL use Google Compute Engine? - google-compute-engine

Do Cloud SQL depend on Compute Engine to run? As I create cloud SQL it's said needed Compute Engine to be created but as I checked for the billing report, the compute engine cost 6-7 times more than cloud SQL.
Is it ok to disable Compute engine?

Yes, Cloud SQL depends on the Compute Engine API for the machine type, vCPUs and memory size of your Cloud SQL instance.
If you will try to disable the Compute Engine API with a Cloud SQL instance deployed, your Cloud SQL instance might not work and can get deleted.

Related

GCP Cloud Functions with GPU access or Compute Engine instance

I have created a Google Cloud Function to do Image Processing, I am using a Deep Learning model for one part of the process, but It uses GPU so I could unable GPU to change CPU and it is working well. After reading many links.
My question is: how can enable use of GPU for Cloud Functions? How could I send one image to be processed in a Compute Engine instance with GPU from Cloud Functions? Finally, I read something about Atheros but it looks expensiver more than 1k/month.
Thanks for your comments and ideas.
GPU are expensive, there is no real solution for that. You need to have a small VM with a small GPU to limit cost, but it's still expensive.
The communication between Cloud Functions and the VM is up to you. It can be through HTTP rest API, gRPC, custom protocol on custom port. If you use the VM private IP, you need to add a serverless VPC connector to your Cloud Functions to bridge the serverless world managed by Google with your own VPC where live your VM

Connect to GCP Cloud SQL from Compute Engine (not from App Engine)

Typical issues for teams that are migrating from AWS to GCP. How to properly connect to Cloud SQL from Compute engine.
In short that what you should know about Cloud SQL service at GCP.
As I see SQL Cloud more API rather clean MySQL socket tend to work with App Engine rather as plain DB.
List of options that you have to validate and use Cloud SQL without involving developers:
Connection using mysql-client or SQL protocol from external machine or even from Compute Engine requires to add your IP to whitelist. Keep in mind that Compute Engine you will be forced to use static IP due security limitations.In production you should use IP address with SSL
To validate connection from Compute Engine you should use Cloud Shell and gcloud utility
gcloud sql connect [INSTANCE_ID] --user=root
Other option that works only with Second Generation of instances and can be (should be) used in production is SQL Proxy that should be installed on client Compute engine and run as service. You need:
Enable SQL Cloud API
Create and use Service Account with MySQL Client permissions for your instance
Install and run SQL Proxy
Connect to localhost to use proxy as bridge to your SQL Cloud Instance
As result there open questions about "best practices" for production use:
How to automate it in the way that new instances in autoscaling group would be able to connect to Cloud SQL after start? My approach: create template that will start SQL Proxy as service. Is there another way?
How to connect to multiple Cloud SQL instances form the same Compute Engine?

Issues while setting up objectify with The Datastore

I have an application which uses objectify which i want to deploy in a Google Compute engine to access google datastore. I have been able to test this application in local development server using Objectify. I am also able to access the cloud datastore from the compute engine by following the documentation in https://cloud.google.com/datastore/docs/getstarted/start_java/.
But when I deploy my application in the google compute engine I am not able to communicate with the google cloud datastore and am getting the following exception:
No API environment is registered for this thread.
I should be missing something. Kindly help me out.
As far as I can tell, Objectify currently only works with Datastore if you are running in Google App Engine (GAE), not for Datastore Access via Google Compute Engine (GCE). There is an open issue https://github.com/objectify/objectify/issues/203
The reason it does not work on Google Compute Engine is apparently because the API for Datastore access in GCE is apparently different from the one used for GAE.

Google Cloud SQL monitoring

I am wondering what are the current/existing possibilities of monitoring mysql instances on Google Cloud SQL? What I need is:
define alerts and trigger actions (send via http) for set of mysql metrics
retrive metrics via http
There is not much I see in Google Cloud SQL dashboard for my mysql instance. When I go to Monitoring -> Dashboard & alerts I see that it is disabled due to Stackdriver migration. Am I doing something wrong here or what I want/looking for is not possible at the moment?
Although the dashboard & alerts are not yet available, there is an API to access monitoring statistics: Cloud Monitoring. You would need to build your own alerting/trigger system on top of this at the moment.

Google Compute Engine as an alternative to Amazon Web Services (EC2, ELB, etc...)

I am trying evaluate Google Compute Engine (GCE) for a cloud project in our company. We have some experience in working with Amazon Web Services but would like to know if GCE is a better alternative for our project.
I have following questions. Our choice for the project will be based on the answers for the questions so please help me with these queries.
Is there an equivalent of AWS Route53 and Elastic Load Balancer on Google cloud? If they are not available then how do we load balance GCE instances?
Is there a concept like regions? (such as us-east-coast-1, us-west-coast-1, etc…). Helpful in making sure that the service is not affected during natural calamities.
Is there an equivalent of Cloud Watch to help us auto scale compute engine instances based on load?
Can we setup a private cloud on Google cloud platform?
Can we get persistent public IP addresses for GCE instances?
Are there any advantages (in terms of tighter integration OR pricing) when using Google services such as Google Analytics, YouTube, DoubleClick, etc?
Load Balancing
Google Cloud Platform's Compute Engine (GCE) recently added a Load Balancing feature. It's lower level than ELB (it only supports UDP / TCP, not HTTP(S)).
Regions
GCE has feature parity. AWS Regions correspond to GCE Regions, and AWS Availability Zones to GCE Zones
Autoscaling (CloudWatch)
Google Compute Engine does not have autoscaling, but Google App Engine does. Third party tools such as Scalr or RightScale are however compatible with Google Compute Engine
Disclaimer: I do work at Scalr.
Private Cloud
Did you mean dedicated instances? Those are not available in GCE.
If you meant VPC, then you can use GCE networks to achieve isolation. You'll also wish to disable ephemeral external IP addresses for the instances you want to isolate.
Persistent IPs
GCE has persistent IPs, they are called "Reserved Addresses"
Integration with other services
You will likely get better latency to Google services you use in your backend (I recall a couple presentations at Google I/O talking about Google App Engine + BigQuery).
For frontend services (Google Analytics), you'll likely see not benefit, since this depends on your users, not your servers.