2

I may sound noob while asking this.

I want to build a mechanism where, when a value of property of Google Datastore's entity changes, the corresponding user(email is present in some another property value for same entity) should be notified of the change. Does Google Datastore support this kind of mechanism, which is similar to Redis PubSub?

Any ideas how to integrate Google PubSub or webhooks with Google Datastore?

Also how to determine that the user is currently active i.e. how to check if the user has my gae application open in his browser?

2 Answers 2

2

Google Datastore doesn't have such mechanism. The only way is to send notification from your app, when your code updates datastore.

Sign up to request clarification or add additional context in comments.

2 Comments

How to determine the emails of user who are online in our application using Java?
I second this statement and i don't understand why this was downvoted. What Igor says is correct. Of course you can wrap some code around your data access layer to trigger events upon certain events but that is not something the datastore offers itself. The datastore does not have trigger mechanisms. The NDB datastore API implements software-side triggers but it is wrong to assume that this is something the datastore itself provides.
0

Totally possible. If you are using the NDB datastore and Python, for example, you would define in your model a _post_put_hook function. Every time an entity of this model changes, your code will be called. Your code can then look up the user and send them an email (or take whatever other necessary action).

Here is the relevant Python documentation for Model Hooks:

https://cloud.google.com/appengine/docs/python/ndb/entities#hooks

I hope that answers your question.

2 Comments

Is it possible with Java? How to determine the emails of user who are online on our application and notify them of changes?
As a matter of fact the NDB datastore API (note the API) has triggers but they are implemented in the API not in the datastore. Triggers would not be triggered if for example you'd access the datastore via remote api. @AbhijeetKumarGaur I'm sorry to say but it is as Igor said it, the datastore does not offer triggers. Luckily, you can always create a wrapper for your datastore calls which does that for you. That solution works universally independent from the language you code in.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.