Waleed Abdulla
Waleed Abdulla

Reputation: 1931

What does the ndb.EVENTUAL_CONSISTENCY option mean?

The documentation of the ndb.Query class, states that it accepts a read_policy option that can be set to EVENTUAL_CONSISTENCY to allow faster queries that might not be strongly consistent. Which implies that not using this option would return strongly consistent results.

However, global queries are always eventually consistent. So what does this flag actually do?

Upvotes: 2

Views: 326

Answers (1)

Greg
Greg

Reputation: 10360

You can choose to have an ancestor-query, which would normally be strongly-consistent, use the eventually-consistent policy instead for the stated speed improvement. The old 'db' module docs explain this. (If you've only ever used NDB, then the DB docs are definitely worth reading - there is a lot more detail on how things work, and how best to make use of datastore.)

Upvotes: 3

Related Questions