Reputation: 485
I want to put tasks onto a push queue in my GAE java app to audit the status of my users, 1 user per task. I am struggling to find a good solution for how to keep track of and consolidate the results of the audit in a safe, efficient way, across each of the tasks.
Currently what I do is use a deferred task that has one parameter in its constructor: the string representation of the key of the entity representing the user I am trying to audit.
The types of data I need to hold for each user are yes/no things like are they active, are their connections to other services revoked/not revoked, etc. When I consolidate, all I want to do is add up all the yes's and no's for each question, so e.g. I have 1000 active users, and 200 inactive users, etc.
Approaches I have considered (please excuse naivety...) are:
Bottom line is all of these are my made up approaches, and I am sure there must be a standard approach / pattern for doing this type of thing... but I haven't been able to find it.
Any advice please...? Thanks!
Upvotes: 1
Views: 229
Reputation: 1806
There are a few common approaches:
DataStore counters https://developers.google.com/appengine/articles/sharding_counters
MemCache counters https://developers.google.com/appengine/articles/scaling/memcache#transient http://blog.notdot.net/2010/04/High-concurrency-counters-without-sharding
Pull queue and task tags http://www.youtube.com/watch?v=AM0ZPO7-lcE
Upvotes: 2