Update:
What I am looking for is some kind of auto trigger mechanism that will do the job as I desire.
Use case:
A ranking based on the scores of posts. The total score of a post is a).the score of this post plus b).the sum of score of all its comments. Both a and b are have initial score 10, and will decrease one point every 24 hours since creation until it becomes 0. When the total score of a post becomes 0, it is regarded as inactive thereafter, removed from the rank but remains in the database for other purpose. This inactive post will no longer active even users comment on it in the future.
I've got a problem implementing a timer for each record in neo4j database.
Assume we have 1 million records, they are either a post or a comment of a post. They both have 10 points when created, and will decrease one point every 24 hours since creation until it becomes 0 and is regarded as inactive (set off the timer).
My naive thought is that we create an attribute of score and update the attribute every 24 hours. But given the size of the data (is growing when users create posts and comments), the intensive database operations are really slow.
Is there any way we could use to implement a timer, or other methods that could meet the needs?
Thanks.