Storing Data
The App Engine environment provides multiple options to store data for your application:
- App Engine Datastore: A schemaless object datastore with automatic caching, a sophisticated query engine, and atomic transactions.
- Google Cloud SQL: A relational SQL database for your App Engine application, based on the familiar MySQL database.
- Google Cloud Storage: A storage service for objects and files up to terabytes in size, and accessible to App Engine apps via the Google Cloud Storage client library.
| Name | Structure | Consistency | Cost |
|---|---|---|---|
| App Engine Datastore | Schemaless | Strongly consistent except when performing global queries. | The App Engine Datastore offers a free quota with daily limits. Paid accounts offer unlimited storage, read, and write operations. More information is available on the Datastore Quotas page. |
| Google Cloud SQL | Relational | Strongly consistent | Google offers two billing plans for Google Cloud SQL: Packages and Per Use. More information is available in the Cloud SQL price sheet. |
| Google Cloud Storage (GCS) | Files and their associated metadata | Strongly consistent except when performing list operations that get a list of buckets or objects. | There are no charges associated with making calls to Google Cloud Storage. However, any data stored in GCS is charged the usual GCS data storage fees. Cloud Storage prices are available on the Cloud Storage price sheet. |
Alternative storage solutions are also available, but they have been superseded by the options listed above.
App Engine Datastore
App Engine Datastore is a schemaless object datastore providing robust, scalable storage for your application, with the following features:
- Highly reliable and covered by the App Engine SLA.
- ACID transactions.
- Advanced querying features.
- High availability of reads and writes.
- Strong consistency for reads and ancestor queries.
- Eventual consistency for all other queries.
In addition, the Java SDK supports other frameworks designed to simplify Datastore usage for Java developers. Many Java developers use these frameworks, and the Google App Engine team recommends and encourages you to evaluate them.
- Objectify is a very simple and convenient interface to the App Engine Datastore that helps you avoid some of the complexities presented by JDO/JPA and the low-level Datastore API.
- Twig is a configurable object persistence interface with support for inheritance, polymorphism, and generic types. Like Objectify, Twig also helps you avoid complexities posed by JDO, JPA, and the low-level Datastore API.
- Slim3 is a full-stack model-view-controller framework that you can use for a wide variety of App Engine functions, including (but not limited to) the Datastore.
Google Cloud SQL
Google Cloud SQL is a web service that allows you to create, configure, and use relational databases that live in Google's cloud. It is a fully-managed service offering the capabilities of a MySQL database, allowing you to focus on application development.
For more information, see Google’s Cloud SQL Overview. To get started using Google Cloud SQL, read the Google Cloud SQL for Java SDK Documentation.
Google Cloud Storage
Google Cloud Storage is useful for storing and serving large files. Additionally, Cloud Storage offers the use of access control lists (ACLs), the ability to resume upload operations if they're interrupted, and many other features. The GCS client library makes use of this resume capability automatically for your app, providing you with a robust way to stream data into GCS.There are no charges associated with making calls to Google Cloud Storage. However, any data stored at GCS is charged the usual GCS data storage fees, which are listed on the Cloud Storage price sheet.
Applications connect to Google Cloud Storage using the Google Cloud Storage Client Library. To get started, read the GCS Client Library Getting Started Guide for Java.
Alternative Storage Solutions
The following solutions are supported by App Engine, but they have been superseded by the options listed above.