Forum BigDB Same Old Question - Server Jobs

Discussion and help relating to the PlayerIO database solution, BigDB.

Same Old Question - Server Jobs

Postby azuanagames » January 13th, 2011, 5:39 pm

I want to add the ability to do Weekly Top / Monthly Top / All-Time Top scores. It would be even nicer to be able to do Last-Week and Last-Month's Top scores.

Something not quite possible with the current system? I mean when do you reset the scores? On which server? How do you prevent multiple servers from trying to reset the scores? Maybe you have a solution?

Further, I would want to run contests possibly, and do something with every user, such as given the users score (1 "entry" per score point) run a random number generator to select top winner. This would entail loading the entire list of users, getting all the scores to then find the sum of all the scores, to then be able to scale the random number and select the winner... Might be overly complicated, but the point is that this is something that would only happen once a week or month. This will take up more than the allowed time to run on the server though.

My solution is going to be to do this all on my local machine. That is, create a secure connection that can access the database and use it with the C# client-side. But, it would be ideal to allow this type of job to run on the server, or a server designed for "cron" jobs. Things that can run, daily, weekly, monthly. There you can give us more time on the server, perhaps 5 minutes of CPU time per job? Maybe less since the server has a better connection to the DB. Something to think about anyway.
azuanagames
 
Posts: 157
Joined: April 29th, 2010, 10:59 pm

Re: Same Old Question - Server Jobs

Postby Benjaminsen » January 13th, 2011, 9:06 pm

It's totally possible to easily do Top X for a given DateRange, as long as the daterange is fixed.

For instance, if you can have objects like this

{
Score: 123,
DayId: 1234, // UniqueId for each day
WeekId: 1234, // UniqueId for each week
MonthId: 1234 // UniqueId for each month
}

Then add indexes like so:
[DayId, Score]
[WeekId, Score]
[MonthId, Score]

Then you can do lookups for Top-EachDay, Top-EachWeek and Top EachMonth.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Same Old Question - Server Jobs

Postby Benjaminsen » January 13th, 2011, 9:08 pm

With regards to the cron thing: It's come up before... We're aware of the request and are considering it for the future ;-)
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark


Return to BigDB



cron