views:

79

answers:

2

The users of my app will purchase any batches of 10 credits. My question is, where should I store the current number of credits?

My goals are:

  • I want to make it not easy to steal
  • I want to make it reliable, I don't
    want users to lose their credits
  • I need to tell the user when they run out

Ideas:

  • Store # credits on phone DB
  • Store # credits in server database
  • Store # credits in a preference
  • Store in all places, and double check on each transaction
  • Since the transactions will be low volume, write code to detect excessive behaviors or manually check anything suspicious

I'd like some opinions about how paranoid I should be. Thanks!

+2  A: 

Storing on a server DB gives you the most control. The others seem easier to crack into.

John at CashCommons
+5  A: 

I would store it on both the phone db and on a server db. The server should be the final word on how many credits a user has, but the phone can be used to warn the user if they are running low, etc. Whenever a user connects, you should check the values and update the phone's value to reflect the server's.

Wade Tandy