I would like to ask, for example, when to make a highly concurrent flash sale activity if redis cache is used to insert the database
for example, when will the corresponding prizes be saved in the database when the activity is in progress?
I would like to ask, for example, when to make a highly concurrent flash sale activity if redis cache is used to insert the database
for example, when will the corresponding prizes be saved in the database when the activity is in progress?
you can write mysql asynchronously with queue consumption. Each time the redis is written, a message is sent to the queue. After the consumer gets the message, it gets the order information through redis and writes it to mysql.
can also set a schedule to run every few minutes, pull new orders in redis within a few minutes, and write them to mysql. However, you need to pay attention to the redis occupancy problem, which may block redis if the design is flawed.
at the same time, do a good job of persistence of redis, so as to avoid the loss of data without persistence after the crash of redis, so that the order does not match.
writes inventory to the queue, and each request takes a value from the queue. If there is a value, it is processed as a normal request. For example, if you set up an inventory of 100, there are only 100 requests to the database.
100 requests are not large and when a request comes, php-fpm creates a process to receive the request until the request is processed. Php-fpm can send many people (processes) at the same time without interfering with each other.
the larger the server processor and memory, the more people php-fpm can dispatch. This doesn't need php programmers to worry about. Of course, under certain circumstances of processor and memory, the smaller the workload of each person (the better the programming), the more people php-fpm can send at the same time.
1. Redis is used to quickly determine whether items that are killed in seconds are still in stock.
2. Limit the current by judging the result of redis data, so as to reduce the pressure on the server.
the amount of data persisted to the database by 3.redis is very small, as long as the database is operated normally.
Previous: Web.xml will always add a xmlns:web,web-app_4_0.xsd to web-app_2_5.xsd automatically.
Next: How is the coding in the java.net.URLEncoder.encode method determined?
has not quite understood the concepts of controller, service layer, dao layer and logic layer, and how to use them and why to use them in this way ...
for example, (- 1) get 225 ...
to query the data after horizontal split, suppose the data of a business is split horizontally, and the monthly records are stored in a table. The data of each table is about 1000w. There are already more than 20 tables, such as table_201606,.,table_201...
because I want to open the official account page in Mini Program, but Mini Program can only open the set business domain name, I think of two ways: 1. Open a registered business domain name, and then jump to the official account page in the registered...
Project is the user name information required by Vue, which is stored in the user s browser. This user name information can be obtained on other websites for example, if I log in to Tencent s website in my browser, can Baidu get my Tencent account inf...
what is stored in the database is the html code, which is mainly a piece of div content, including the style, does not contain the body and other tags, and the label is strict in opening and closing. If I want to query the keyword "class " now, if I us...
the map of Tetris is implemented in a two-dimensional array, and squares are also implemented in arrays, but I just don t understand how maps interact with squares. is how to know where the square is on the map. Besides, although the two-dimensional ...
how does the QQ WeChat group @ all women, get all women s information ...
1, JAVA DES encryption class, how to use PHP to achieve encryption, decryption. (1) encryption if the key is 123mursharpAbcd, the plaintext is hello world, output 3d518daea941120d72fe3488f5d27a64 under this code, it will appear before data decryption...
for example, if there is a set of numbers such as 1, 2, 5, 7, 11, 14, how can Filter come up with two sets of numbers: [1, 2] and [5, 6, 7, 7]? ask for advice ...
the original rule is as follows [1-9] {1} [0-9] {3} now I want to rule out the result of 2035. How do I write it? because I m in a hurry, I can t think for myself. Regularity is my weakness. Thank you! ...
there is no vue rich text with formulas, that is, formulas in mathematics, physics and chemistry ...
python smtp send email setup signature? you can also say how it is sent in other languages ....
vue scaffolding code php back-end server language does not know how to get the content entered in the vue-quill-editor rich text editor api given to the official website I just say that new a quill and then use getContents (); to get the content how ...
as shown in the figure, if you want to do a login interception based on $api.getStorage ( userId ), the desired effect of is 1. Enter the page that can open the green box (main.html), but the other three in the red box cannot be opened directly (mes...
...
I m not familiar with the git command. I used vscode s git management tool to "undo the last commit " twice, but now I don t want to undo those commits. How can I restore them? ...
there is such a requirement: user login module, does not support the choice of login method, only a text input box, while supporting: QQ number, mobile number, e-mail, nickname, ID card, etc. (if the user filled in the values of these five fields) any f...
ask what is the development environment and language of short video playback software similar to Douyin requirements: if developers only have JAVA and front end now, what is the best development environment? is it okay to use Hbuilder s MUI? wi...
generate the corresponding loop based on the given number. If 2 is given, a double cycle is generated, and 3 is a triple cycle if 3 is given, then for (let i = 0; i < arr.length; iPP) { for (let j = 0; j < arr.length; jPP) { ...