Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



Storing Data in Java

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.

The Java Datastore SDK includes implementations of the Java Data Objects (JDO) and Java Persistence API (JPA) standard interfaces, as well as a low-level Datastore API.

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.

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.

  • Blobstore API: Google Cloud Storage is recommended over using the Blobstore API.
  • Authentication required

    You need to be signed in with Google+ to do that.

    Signing you in...

    Google Developers needs your permission to do that.