High-concurrency counters without sharding

前端 未结 2 1715
离开以前
离开以前 2020-12-28 18:53

This question concerns two implementations of counters which are intended to scale without sharding (with a tradeoff that they might under-count in some situations):

2条回答
  •  醉话见心
    2020-12-28 19:27

    Memcache gets flushed, you lose your counter. OUCH. Using a mysql database or a NOSQL solution will resolve that problem with a possible performance hit. (Redis, Tokyotyrant, MongoDB etc...) may not have that performance hit.

    Keep in mind, you may want to do 2 actions:

    1. keep a memcache counter just for the high performance reasons.
    2. keep a log, and then get more accurate metrics from that.

提交回复
热议问题