You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
boffin gem seems to be the best in my reading.
boffin uses zunionstore very well and it can provide simple and flexible access rankings.
For example, the ranking in 7 days that stock has double weighted than view is as follows.
Article.top_ids({stocks: 2,views: 1},days: 7)
boffin is less active, but I think there is no problem.
redis is also used as a queue for asynchronous/scheduled processing such as sidekiq.
It can be used to asynchronize notifications, to post rankings to slack on daily, etc.
Use Analytics gems which using ActiveRecord
There is no need to add any middleware, so we can continue to use heroku for free.
But the access ranking that depends on both stock count and view count will be handmade.
Analytics gems can be used if the ranking only view count.
I think that both search engines and async/scheduled processing are necessary for this type of application.
So finally we need to install elasticsearch and redis-server.
But at this point the judgment that does not use these is reasonable (because there is demo app work on heroku).
Which way is better to implement ranking is almost the same.
(if really have to choose it, redis(only ranking) > elasticsearch(only ranking) >>> ActiveRecord)
The text was updated successfully, but these errors were encountered:
On the other hand, I know the environment where there are lots of articles.
Therefore, I think that it is necessary to be able to use a search engine as an optional.
* required
* PostgreSQL
* Redis <- New!
* optional
* ElasticSearch, Solr or ... (I have not decided which to use...)
Current algorithm of popular article has a problem that older articles come higher.
I want to add recently weight to popular article.
There are 3 choices.
Use Search Engine such as elasticsearch, solr etc
Search engine is the best solution because this is search problem.
e.g.
By introducing a search engine, we can also get "advanced search" and "related articles" widget.
Use Redis sorted set
redis sorted set is one of the best ways to implement access ranking.
e.g. https://siguniang.wordpress.com/2014/09/15/access-ranking-with-redis-sorted-sets/
boffin gem seems to be the best in my reading.
boffin uses zunionstore very well and it can provide simple and flexible access rankings.
For example, the ranking in 7 days that stock has double weighted than view is as follows.
boffin is less active, but I think there is no problem.
redis is also used as a queue for asynchronous/scheduled processing such as
sidekiq
.It can be used to asynchronize notifications, to post rankings to slack on daily, etc.
Use Analytics gems which using ActiveRecord
There is no need to add any middleware, so we can continue to use heroku for free.
But the access ranking that depends on both stock count and view count will be handmade.
Analytics gems can be used if the ranking only view count.
Probably use these gems.
Smaller and easier to read gem is https://github.com/patorash/acts_as_footprintable.
My opinion
I think that both search engines and async/scheduled processing are necessary for this type of application.
So finally we need to install elasticsearch and redis-server.
But at this point the judgment that does not use these is reasonable (because there is demo app work on heroku).
Which way is better to implement ranking is almost the same.
(if really have to choose it, redis(only ranking) > elasticsearch(only ranking) >>> ActiveRecord)
The text was updated successfully, but these errors were encountered: