title: Game with hourly rewards
body: <p>i want to make a web-based game for my study.</p>
  
  <p>The game is simple: after registration you have 100$ and you can buy let's say one tree, this tree will give you 10 apples per hour and you can sell one apple for 1$</p>
  
  <p>My question is: how do i make this tree drop 10 apples per hour? Do I need to write another C# Console programm (aka cronjob) that connects to database and updates everything? Catching users, gettings their trees and giving them apples every hour? I have tried it that way but it is a performance issue</p>
  
  <p>I have tried to do that and filled my database with dummy 1000 users and each user had 10000 trees (so 10000000 trees in total) but my C# program (so-called cronjob) is taking more than 5 minutes to reward all fake players with apples</p>
  
  <p>I am using entity framework and foreach loop to catch every player and count their trees then add apples to them and save database changes</p>