3

Near the end of the following document:

https://developers.google.com/appengine/docs/java/datastore/structuring_for_strong_consistency?csw=1

It says:

This approach achieves strong consistency by writing to a single entity group per guestbook, but it also limits changes to the guestbook to no more than 1 write per second (the supported limit for entity groups)

Does this mean that this write limit is on the specific guessbook? or across all guest books?

i.e. If for example I have "Logs" and "Log_entries" that use the Logs as ancestors and lets say I have 10 different Logs - and suppose I get 5 parallel requests to write to 5 different logs - will it be a problem ? or is the problem only if I get more then one request per second to write entries that belong to the same specific log?

[my app does not deal with logs or entries - it just an example....]

Dan McGrath
  • 41,220
  • 11
  • 99
  • 130
epeleg
  • 10,347
  • 17
  • 101
  • 151

3 Answers3

4

The limitation is PER ENTITY GROUP.

In your example that is PER LOG. So you can write 1 log entry per second per log. If you have 5 logs, you can write at most 5 log entries per second if and only if the log entries belong to 5 different logs.

koma
  • 6,486
  • 2
  • 27
  • 53
4

Answer: Write limit is on the guestbook (entity group). More info: Batch puts/transaction count as 1 write (limited per second) clarification: http://www.youtube.com/watch?v=xO015C3R6dw#t=335

jacek2v
  • 571
  • 4
  • 8
  • Thanks for the additional link. – epeleg Jan 12 '14 at 10:41
  • Yes, thanks! - Ive not found that vital info on batched writes within entity groups overcoming the 1 write/second limitation anywhere else in the docs, blogs, or questions. I presume they still occur sequentially, but at least it guarantees no contention as you would expect. While the basics are clear enough, the details on entity groups with or without transactions are rather poorly covered in the docs. – pwray Jun 11 '15 at 08:27
1

The one write per second rule is like the pirate code on parlay... is more what you'd call a "guideline" than actual precise rule. Transactions always get applied serially to an entitygroup (which takes some time) so if too many transactions get queued up for a single entitygroup bad things may happen, hence I do not think it would be good to ignore the 'rule'.

Google offers more information on this rule and a technique for working around it (in some cases) by using sharding here:

https://cloud.google.com/appengine/articles/sharding_counters

recnac
  • 3,744
  • 6
  • 24
  • 46
andrew pate
  • 3,833
  • 36
  • 28
  • related thread http://stackoverflow.com/questions/38277246/datastore-multiple-writes-against-an-entity-group-inside-a-transaction-exceeds – Dan Cornilescu Aug 22 '16 at 21:35