Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What exactly is the throughput restriction on an entity group in Google App Engine's datastore?

The documentation describes a limitation on the throughput to an entity group in the datastore, but is vague on what exactly the limitation is. My confusion is in two parts:

1. What is being restricted?

Specifically, is it:

  1. The number of writes?
  2. Number of transactions that write to the datastore?
  3. Number of transactions regardless of whether it reads or writes to the datastore?

2. What is the type of the restriction?

Specifically, is it:

  1. An artificially enforced one-per-second hard rule?
  2. An empirically observed max throughput, that may in practice be better based on factors like network load, etc.?
like image 303
user2771609 Avatar asked May 01 '15 23:05

user2771609


People also ask

What is entity Group in Datastore?

Data objects in Firestore in Datastore mode are known as entities. An entity has one or more named properties, each of which can have one or more values. Entities of the same kind do not need to have the same properties, and an entity's values for a given property do not all need to be of the same data type.

What are the properties of entities in database?

Properties and value types The data values associated with an entity consist of one or more properties. Each property has a name and one or more values. A property can have values of more than one type, and two entities can have values of different types for the same property.

How do I update entity in Datastore?

Updating entities To update an existing entity, modify the attributes of the Entity object, then pass it to the DatastoreService. put() method. The object data overwrites the existing entity. The entire object is sent to Datastore with every call to put() .

Is Datastore transactional?

A transaction is a set of Datastore operations on one or more entities in up to 25 entity groups. Each transaction is guaranteed to be atomic, which means that transactions are never partially applied. Either all of the operations in the transaction are applied, or none of them are applied.


1 Answers

There's no throughput restriction per se, but to guarantee atomicity in transactions, updates must be serialized and applied sequentially and in order, so if you make enough of them things will start to fail/timeout. This is called datastore contention:

Datastore contention occurs when a single entity or entity group is updated too rapidly. The datastore will queue concurrent requests to wait their turn. Requests waiting in the queue past the timeout period will throw a concurrency exception. If you're expecting to update a single entity or write to an entity group more than several times per second, it's best to re-work your design early-on to avoid possible contention once your application is deployed.

To directly answer your question in simple terms, it's specifically the number of writes per entity group (5/ish per second), and it's just a rule of thumb, your milage may vary (greatly).

Some people have reported no contention at all, while others have problems to get more than 1 update per second. As you can imagine this depends on the complexity of the operation and the load of all the machines involved in execution.

like image 172
Hanuman Avatar answered Sep 28 '22 03:09

Hanuman