Home > Back-end >  Don't understand to ask, how to solve the high concurrency redis
Don't understand to ask, how to solve the high concurrency redis

Time:11-13

To save a collection to redis
Then multiple places more frequent operation to this collection, add elements to or remove elements, and save
How to solve the problem of concurrency
Friends said in the queue, but never use queue, not how to use

CodePudding user response:

You may want to ask is, how to guarantee the data consistency problem, add redis lock is good

CodePudding user response:

refer to write diary 1/f, the Yangtze river water response:
you may want to ask is, how to guarantee the data consistency problem, add redis lock good

Lock will affect performance

CodePudding user response:

refer to the third floor of responses asking, "what can you see it °
Quote: refer to write diary 1/f, the Yangtze river water response:
you might want to ask is, how to guarantee the data consistency problem, add redis lock good

Locking affects performance

That you can learn the queue, could not meet not use don't learn to ~

CodePudding user response:

reference Nihility, 4/f/response:
Quote: refer to the third floor of responses asking, "what can you see it °
Quote: refer to write diary 1/f, the Yangtze river water response:
you may want to ask is, how to guarantee the data consistency problem, add redis lock good

Locking affects performance

That you can learn the queue, impossible encounter will not use don't learn to ~

Must be to learn, but after all is a big family, not a moment to figure, so want to ask next use which queue will be better, at least will reduce a lot of useless, because I tried several queues, can solve this problem

CodePudding user response:

There are list this structure, you can use redis lpull, rpush

CodePudding user response:

refer to 6th floor KeepSayingNo response:
redis list this structure, can use lpull, rpush

Redis delete specified in a specified key elements, in which way? Lpull what method, points out, not baidu

CodePudding user response:

The
reference 7 floor of responses asking, "what can you see it °
Quote: refer to 6th floor KeepSayingNo response:
redis list this structure, can use lpull, rpush

Redis delete specified in a specified key elements, in which way? Lpull what method, points out, not baidu

Is jedis object method

CodePudding user response:

Literally, redis use queue to ensure single-threaded execution

CodePudding user response:

The following is a personal understanding: redis is single-threaded, if to set a frequent operation, because redis is single-threaded, for any operation is according to the order of operations to come, is it can be concluded that there is no redis data concurrency problem, just personal understanding,
  • Related