📜 ⬆️ ⬇️

Data storage in Google App Engine

This article is based on a blog entry by Nick Johnson. In addition to it, there are a few figures that are relevant at the moment and some notes have been added.

App Engine provides many ways to store information. Some (for example, data storage) are well known, but others are few, and all of them have different characteristics. This article will list the various possibilities and describe the advantages and disadvantages of each of them, so that you can make decisions with more information about the data storage options.

Data Storage (datastore)


The most famous, used and flexible data warehouse. Datastore is an App Engine non-relational database, it provides reliable long-term storage, and also provides maximum flexibility in storing, retrieving, and processing data.

Memcache


Memcache is known as a "secondary" data storage mechanism. The memcache API provides applications with the ability to optimistically cache data to avoid costly operations. Memcache is often used as a caching layer for other APIs, such as the datastore, or for caching the results of any calculations.

Instance memory


Application instances can also cache data using global variables or class members. This method provides the highest speed, but has some drawbacks.

Blobstore


BLOB storage allows you to easily and efficiently store and deliver large amounts of data uploaded by the user.

Local files


The application can read any files downloaded with the application and not marked as static content using standard file system operations. This adds read-only data that the application may need.

Load queue of tasks (Task queue payloads)


This is not a repository in its traditional sense, data that can eliminate the need to use other storage systems can be attached to tasks from a taskqueue.

Email


With App Engine, email can be used not only to communicate with users, but also for technical purposes. In this case, the data transfer method is similar to the use of taskqueue payload, but using email provides more options, such as transferring data to another App Engine application.

URLFetch


The URL retrieval API allows you to get information from other hosts using HTTP and HTTPS requests.

Application logs


Usually, this method is undeservedly forgotten and datastore is used to collect information about the operation of the application. However, if you do not want to reduce the application performance during the collection of technical and debug information, then this method will work much better.

Conclusion


App Engine gives much more ways to store data than it seems at first glance. Each of them has its own trade-offs, so it is likely that one or more of them will work for your application. Often the optimal solution includes a combination of methods, for example, datastore and memcache, or local files and instance memory.

Source: https://habr.com/ru/post/110901/


All Articles