Using structured data with PHP

On this page of the PHP Bookshelf app tutorial, you choose a database for storing structured data. The Bookshelf sample app uses a structured data model for storing information about books. You can explore the sample app by using one of four different backing databases: Cloud SQL for MySQL, Cloud SQL for PostgreSQL, Cloud Datastore, or MongoDB.

This page is part of a multipage tutorial. To start from the beginning and read the setup instructions, go to PHP Bookshelf app.

To get started, choose an option from the following table.

Database Why use this option? Configuration
Cloud SQL for MySQL
Managed MySQL
Use MySQL >
Choose this option if you're familiar with MySQL or if you're interested in a managed relational database.

Benefits:

  • Create and configure your databases. Cloud SQL handles all other management tasks such as replication and patch management.
  • Access your data in Cloud SQL databases by using all the tools and apps built for MySQL.
  • Use your favorite MySQL tools and apps because Cloud SQL is MySQL in the cloud.
Create a Cloud SQL instance and configure access.
Cloud SQL for PostgreSQL
Managed PostgreSQL
Use PostgreSQL >
Choose this option if you're familiar with PostgreSQL or if you're interested in a managed relational database.

Benefits:

  • Create and configure your databases. Cloud SQL handles all other management tasks like replication and patch management.
  • Access your data in Cloud SQL databases by using all the tools and apps built for PostgreSQL.
  • Use your favorite PostgreSQL tools and apps because Cloud SQL is PostgreSQL in the cloud.
Create a Cloud SQL instance and configure access.
Cloud Datastore
Managed NoSQL database
Use Cloud Datastore >
Choose this option if you want a zero-configuration, fully managed, highly scalable, non-relational database.

Benefits:

  • Automatically scales based on your app's users and traffic, so you don't have to worry about provisioning or load anticipation.
  • Query your data with SQL-like queries that support filtering and sorting.
No additional configuration needed.
MongoDB
Run MongoDB on Compute Engine
Use MongoDB >
Choose this option if you're familiar with MongoDB or if you want to learn how to run your own database on Compute Engine.

Benefits:

  • Deploy a MongoDB cluster on virtual machines that you provision and control. Alternatively, you can use a managed service such as mLab
  • Take advantage of the MongoDB knowledge you have.
  • Get support from MongoDB's rapidly growing community.
Deploy and configure a MongoDB cluster.
Was this page helpful? Let us know how we did:

Send feedback about...