jeudi 7 septembre 2017

Show randomly advertisements by expire time and show count

I have a table for advertisements which has about 1000 to 5000 records, These records have show count (default 0) and expire time.

I want show 3 of them randomly and if I show one of them I update the show count record and fairly show all of them, I want also show them in customized category and I don't want show them in unrelated category.

What algorithm should I used for choose randomly weighted by show count and expire time? How can I manage this? I prefer use Redis as database.




Aucun commentaire:

Enregistrer un commentaire