Title. Statistical fields are often displayed and updated very frequently, how to handle this type of data efficiently?
For example, SF's question answer number, the collection quantity, the poll number and so on statistic data. Please give a good solution, thank you!
Reply content:
Title. Statistical fields are often displayed and updated very frequently, how to handle this type of data efficiently?
For example, SF's question answer number, the collection quantity, the poll number and so on statistic data. Please give a good solution, thank you!
That's what I'm dealing with. I'll divide the table vertically. Then write on-demand delay.
For this type of data that is read and written frequently:
1. If the request volume is not particularly high can consider another maintenance of a innodb engine table, separate statistics, real-time query update basic can meet;
2. If the request volume is very high then consider storing in the in-memory database (for example, Memcache, Redis), if the data need to land (permanent storage, the memory database more or less the risk of data loss), plus a scheduled task timed to write data to the database, In case of data loss inside the memory can be re-read from the database.