How to cope with achievements / badges / rewards for your APP with minimal impact on the system?

I like the concept of badges and achievements for the website that I am developing. It has been proven that they improve the usage / usage speed, and I think this can be a great motivator for the application that I would like to develop.

At a high level, I can imagine 3 ways to do this.

Check members that meet the requirements as a cron job: This doesnโ€™t seem like a good idea for me, as the number of participants increases, the cron task takes more time and time.

Every time an action is completed, which may meet the requirements for the icon, check if any icons should be checked : This seems like a good way to do this, but it looks like I could potentially damage the server by constantly checking the already marked icons or what the user may not even come close to him.

Each time a user completes an action that can receive badges, check to see if they already have this, and then check to see if they meet the requirements:. This is also good, but if I save the user as an object, it seems that he can get prohibitively large or that I can finish getting into the database by checking the achievements quite a lot.

Are there any options that I am missing? Are my problems one or more approaches bloated?

Edit: Is this a much less interesting question than I thought, or am I asking at a bad time? I didnโ€™t understand something?

+6
badge achievements
source share
1 answer

Or combine your two ideas:

Each time the user completes an action that the icon can receive, put it on the list (if it was not already there) and often process this list using cron.

This way, you donโ€™t need to check every time the user completes the action, and you can keep the cron operation reasonable.

Of course, there are options: for example, processing a list when it reaches a certain amount. Or partially check the requirements before adding the user to the list.

I suppose this will depend on the number of users, the available actions that can be performed, etc.

+4
source share

All Articles