How to use Datastore and Cloud SQL together

103 views
Skip to first unread message

Jonathan Solorzano

unread,
Sep 30, 2014, 3:03:07 PM9/30/14
to google-a...@googlegroups.com

I need an scalable database, and i know that NoSQL is the best option for that, but i also need an interface that will help me observe my data with some complex sql query, and SQL is the way to do so, but i don't know how to use SQL & NoSQL together.

According to Google I/O 2012 - SQL vs NoSQL: Battle of the Backends it's possible (min 30:32) it's possible to use both Cloud Dastore and Cloud SQL together... BUT HOW?, i mean what will be the connection between them both?, also how to manage that data from PHP?

Probably the connection will be the app, so that i'll store huge amounts of data in Datastore & analize aspects of it via SQL engine, but if i have the data in Datastore how will i use Cloud SQL to analize it via complex querys?

Here's an image taken from Battle of the backends representing what i want to know to do. 

enter image description here

Vinny P

unread,
Oct 2, 2014, 5:55:30 PM10/2/14
to google-a...@googlegroups.com
On Tue, Sep 30, 2014 at 2:03 PM, Jonathan Solorzano <jonathanfelixs...@gmail.com> wrote:

I need an scalable database, and i know that NoSQL is the best option for that, but i also need an interface that will help me observe my data with some complex sql query, and SQL is the way to do so, but i don't know how to use SQL & NoSQL together.

According to Google I/O 2012 - SQL vs NoSQL: Battle of the Backends  it's possible to use both Cloud Dastore and Cloud SQL together... BUT HOW?, i mean what will be the connection between them both?, also how to manage that data from PHP?

Probably the connection will be the app, so that i'll store huge amounts of data in Datastore & analize aspects of it via SQL engine, but if i have the data in Datastore how will i use Cloud SQL to analize it via complex querys?

 
 
 
The intent of that piece is to show how Cloud SQL and the Datastore can be used to complement each other - for example some use cases need a type of query that is available in Cloud SQL, but not in the Datastore. Other use cases may find it cheaper to store short term data in Cloud SQL, but keep long-term data in the datastore. It's easy to envision other use cases where storing data in both Cloud SQL and the Datastore makes economic or technical sense.
 
But you as the developer have to come up with your data schema, and how to store/maintain that data. It's up to you to decide how to connect that data, and what the relationships will be. The connections aren't automatically done; the video is explaining how to make the right decisions. Note that you can get some external tools to help you manage the data such as phpmyadmin: https://gae-php-tips.appspot.com/2013/05/26/setting-up-phpmyadmin-on-app-engine/ 
 
It seems to me that you're focused on analyzing data. If so, I'd suggest trying out BigQuery: https://cloud.google.com/bigquery/ . Store your data however you like, and then you can import it into BigQuery and run queries/analyze the dataset using SQL syntax.
 
 
-----------------
-Vinny P
Technology & Media Consultant
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com
 
Reply all
Reply to author
Forward
0 new messages