Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for eventual consistency for ancestor queries [datastore] #2599

Closed
irri opened this issue Sep 11, 2017 · 2 comments
Closed

Support for eventual consistency for ancestor queries [datastore] #2599

irri opened this issue Sep 11, 2017 · 2 comments
Assignees
Labels
api: datastore Issues related to the Datastore API. type: question Request for information or clarification. Not an issue.

Comments

@irri
Copy link

irri commented Sep 11, 2017

In the documentation for Data Consistency under Consistency guarantees and Datastore read policy respectively (https://cloud.google.com/datastore/docs/concepts/structuring_for_strong_consistency#datastore_read_policy) it says:

Ancestor queries (those that execute against an entity group) are strongly consistent by default, but can be made eventually consistent by setting the Datastore read policy (discussed below).

To improve performance, you can set a query's read policy so that the results are eventually consistent.

However, in the Node.js tab it says:

// Read consistency cannot be specified in google-cloud-node.

I have a use-case in where a particular query to an entity group doesn't require strong consistency. Setting eventual consistency for ancestor queries is currently supported by the C#, Go, Java, PHP and Ruby libraries. Is there any future plans on incorporating this option in Node.js?

@irri irri changed the title Support for eventual consistency for ancestor queries Support for eventual consistency for ancestor queries [datastore] Sep 11, 2017
@stephenplusplus stephenplusplus added api: datastore Issues related to the Datastore API. type: enhancement type: question Request for information or clarification. Not an issue. labels Sep 11, 2017
@stephenplusplus
Copy link
Contributor

Thanks for asking! I'm wondering if that doc is out of date. Our runQuery method allows you to switch consistency to "eventual" (https://googlecloudplatform.github.io/google-cloud-node/#/docs/datastore/1.1.0/datastore/query?method=run):

query.run({ consistency: 'eventual' })

Let me know if that's not what you're looking for.

@irri
Copy link
Author

irri commented Sep 14, 2017

Thanks! That was exactly what I was looking for!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

2 participants