Home > database >  Please comment redis related issues about down the queue
Please comment redis related issues about down the queue

Time:10-11

Mall is written in PHP, mysql, in order to prevent the oversold, I now have the affairs of the mysql and row locks, submitted to unlock, can prevent oversold, but concurrent server performance decline through high, easy to 502. So I want to change to redis queue scheme, general merchandise has many sku, 100 pieces such as red, yellow 50 pieces, such many sku, how to use redis? Is online to find a few cases, such as inventory, 150 pieces, namely to write 150 lines, redis, reoccupy lpop reduce to zero, but if it is more sku, what should I write a reasonable point? How to ensure atomicity? My small white, for the first time contact redis, still hope your advice, convenient to a writing case, thank you very much!
  • Related