Creating a scoreboard on large areas of traffic

A bit of a strange question, but I hope someone can point me in the right direction. Basically, I have two scenarios, and I would like to know which one is better for my situation (the user checks the scoreboard on a high-speed website).

  • Top 10 is regenerated every time a user lands on a page - increasing the load on the server, especially with high traffic, the user will see how he will stand as soon as possible.
  • Top 10 is regenerated at a given interval, for example. every 10 minutes. - generates only one set of results, causing one surge every 10 minutes, and not potentially once every x seconds, if the user falls between the updates, he will not see their updated score.

Each one has its pros and cons, in your experience, which is best used or are there any magical alternatives?

EDIT - update after taking on board what everyone said, I decided to rebuild this part of the application. Instead of dealing with individual scores, I deal with the totals, this is then stored in a separate table that refers to the cached data source.

Thank you all for your great contribution.

+3
source share
4 answers

, (, ). , , Top 10 .. - MemCache, , / - MemCache , , / . ( ), , ,

+1

, . 2, , . JS 10 ,

0

Jordan: ( HTML) , , . PHP, , XMLHttpRequests ( ). JavaScript , XMLHttpRequests ( , ), .

0

Drupal , . , 10- - - , . , , , 10 , 10- , , .

If you are not configured for Drupal / MySQL then CouchDB will be useful here. You can create a view that calculates the top 10 data, and it will be cached until something happens that leads to the need for recounting. You can also add a built-in http proxy to cache results in a specific number of minutes.

0
source

Source: https://habr.com/ru/post/1751013/


All Articles