Storing Data
http://goo.gl/5KZ3AQ
Storing Data
● Enable Billing
● Using Google Cloud SQL
● Google Cloud Storage
Storing Data
● Enable Billing
● Using Google Cloud SQL
● Google Cloud Storage
Using Google Cloud SQL with App Engine PHP SDK1. Creating a Cloud SQL instance
2. Build a starter application and database
3. Connect to your database
4. Size and access limits
Creating a Cloud SQL Instance
Using Google Cloud SQL with App Engine PHP SDK1. Creating a Cloud SQL instance
2. Build a starter application and database
3. Connect to your database
4. Size and access limits
Build a starter application and database1. Create your App Engine sample application
○ Hello GAE!
2. Grant your App Engine application access to
the Google Cloud SQL instance
3. Create your database and table
Build a starter application and database1. Create your App Engine sample application
○ Hello GAE!
2. Grant your App Engine application access to
the Google Cloud SQL instance
3. Create your database and table
Grant your App Engine applicationStep 1
Step 2
Step 3
Build a starter application and database1. Create your App Engine sample application
○ Hello GAE!
2. Grant your App Engine application access to
the Google Cloud SQL instance
3. Create your database and table
Create your database and table1. Connecting MySQL
● Use the MySQL command-line tool
● Sequel Pro
2. Create database and table
Using Google Cloud SQL with App Engine PHP SDK1. Creating a Cloud SQL instance
2. Build a starter application and database
3. Connect to your database
4. Size and access limits
Connect to your database
1. Using PHP common connection methods
PDO_MySQL, mysqli, MySQL API
2. Test Example (http://goo.gl/b2YkmD)
3. Update your configuration file
4. Deployment!
Using Google Cloud SQL with App Engine PHP SDK1. Creating a Cloud SQL instance
2. Build a starter application and database
3. Connect to your database
4. Size and access limits
Size and access limits
60 seconds
HTTP request timer
10 mimutes
Offline requests & Backend requests
Storing Data
● Enable Billing
● Using Google Cloud SQL
● Google Cloud Storage
Google Cloud Storage
● Reading and Writing Files
● Publically Accessible Files
● User Uploads
● Serving Images
Reading and Writing File
Two ways to write files to GSC
1. Write files from your app
● Simple file write
● Streamed file write
2. Let the user upload files to GCS
Writing files from your app
gs://bucket_name/desired_object_name
You can obtain a default bucket for it by clicking
Create within the Cloud Integration section in
the Application Settings page of the App
Engine Admin Console
Simple file write
Streamed file write
http://goo.gl/LZESqj
Google Cloud Storage
● Reading and Writing Files
● Publically Accessible Files
● User Uploads
● Serving Images
Publically Accessible Files
Create a public-readable file containing some
random numbers, writing it to a GCS bucket,
and redirect to that file form GCS.
Example
Google Cloud Storage
● Reading and Writing Files
● Publically Accessible Files
● User Uploads
● Serving Images
User Uploads
Create the applicaton specific upload URL, using the method
CloudStorageTools::createUploadUrl()You must start uploading to this URL within 10 minutes of its creation.Use this URL as the action for the form you use to accept uploads.
Example
Google Cloud Storage
● Reading and Writing Files
● Publically Accessible Files
● User Uploads
● Serving Images
Serving Images
CloudStorageTools.getImageServingUrl()CloudStorageTools.deleteImageServingUrl()
My Github example
http://goo.gl/zQkq5U