Home  >  Q&A  >  body text

redis-账户-余额 - Redis存储账户余额

Redis可否用来存储账户余额,如果直接使用Mysql当存储,那压力能不能吃得消,Redis的话又担心数据丢失,应该怎么做才好呢?

PHP中文网PHP中文网2738 days ago956

reply all(1)I'll reply

  • 巴扎黑

    巴扎黑2017-04-22 09:02:40

    It is best not to use redis. There is an upper limit on the memory that a single redis node can use, which seems to be 10G. Moreover, it is best to use a relational database with transaction consistency for account balances. MySQL itself can also be optimized a lot. If you feel the pressure is high, you can add caching or separate reading and writing

    reply
    0
  • Cancelreply