0

I'm building a static website with 10000+ pages generates from json file with middleman.

Each page is a document (pdf) with it's own id, summary and a download link.

I need to give anonymous users the ability to rate a document and show global rating for each document.

Since the website is static, i've been looking for a solution like disqus that handles pages rating and ability to get counts via api. I didn't find any.

Let's say I'll have to create a seperate server that handles rating. Which technology should I use ? I think about Redis, but the big problem is what if a visitor creates a scripts that rates up/down a document million times. How can I make sure there will be no flooding?

I know about captcha, but will it be effective in this scenario?

Are there other solutions?

So here are my questions:

  1. Is Redis the right choice for this?
  2. NodeJS/Rails ? I'm pretty confortable with Rails, but NodeJS is faster ?
  3. Is captcha enough to be sure there will be no (minimum) flooding ? Other solution?

Thank you.

Alex
  • 2,036
  • 4
  • 22
  • 31

1 Answers1

1
  1. Redis is an awesome solution for it. you can use redis abilities to store each rating given and another key to store the calculated rating for an easy fetch
  2. If you are familiar with Javascript, Node JS is a fun choice to go. if you are more familiar with ruby - Sinatra would do the trick just fine.
  3. as for the captcha solution - keeping anon users from flooding your rating queue is a PITA. you should probably allow only registered / logged in users to rate - and only after a successful download request.in that case - a captcha would be just fine.
Elad Meidar
  • 774
  • 6
  • 11