MySQL+Redis engineering process and strategy

two thousand five hundred and fourteen Unauthorized reproduction is prohibited Understanding the course
Course Introduction
discuss {{interaction.discussNum ? '(' + interaction.discussNum + ')' : ''}}
Suitable for people
Want to learn MySQL Redis
You will learn
Learn to use MySQL+Redis
Course Introduction


1. Using c++language, vs2019 develops cross platform [Windows and Linux] to connect MySql and Redis frameworks.
2. Use MySql to persist player data, Redis as the player data cache layer, and Redis does not persist data.
MySQL works very efficiently with Redis, just like men and women are not tired of working together. Without Redis, MySQL can be independent
Good completion of user read/write requests. With Redis, users can access data more efficiently, in less time, and quickly
Request.
3. Explain how to maintain the strong consistency strategy of MySQL and Redis data and implement it in code. Every time you start Redis, you can use the pipeline technology from MySQL
Batch import active user data into Redis and set the expiration time
4. The tutorial uses thread pool technology. Each thread has its own independent data and thread binding classes. Each instance contains a thread
The data of each thread includes: mysql connector, Redis connector, memory recycling pool, secure serial queue, condition variable, and mutex
Ensure data security within threads.
5. Operating principle:
When there is no request, each worker thread is in the sleep state.
When there are read-write requests, obtain a thread from the thread pool, add read-write requests, and push the data to the thread work queue.
Then the worker thread obtains the data of the queue, arranges the serial work tasks, reads and writes MySQL databases, and reads and writes Redis data,
When the work task is completed, the next work task is executed, and the processing result is pushed to the logical thread to send the data to the user.
6. User read data strategy: users first search data from Redis, and Redis finds the data,
Data is returned to the player. Redis fails to search. Data is searched in MySQL, written to Redis, and returned to the user.
7. User write data strategy: users first delete data from Redis, then write data to MySQL, and finally write data to Redis to maintain data consistency.
8. The tutorial is a dry goods tutorial, not a novice tutorial. The basic syntax of MySQL is rarely explained. Redis has a series of basic explanations.
The tutorial explains how to build a high concurrency, high-performance read-write database framework, and use the high availability, high-performance framework of MySQL+Redis.
If you want to obtain the source code, please contact the online customer and the tutorial author

Expand more
release
 head portrait

{{ item.user.nick_name }} {{ EROLE_NAME[item.user.identity] }}

Topping note
 Discussion Chart
{{ item.create_time }} reply
  • delete

    Are you sure to delete?

    confirm
    cancel
  • {{item. is_top==1? 'Cancel topping': 'topping'}}

    The discussion that has been set to the top, do you want to replace the existing one?

    confirm
    cancel
{{ tag.text}}
 head portrait
{{ subitem.user.nick_name }} {{ EROLE_NAME[subitem.user.identity] }}
{{ subitem.create_time }} reply
delete

Are you sure to delete?

confirm
cancel
release
{{pageType==='video '?' The discussion area grabs the sofa, and you can get double credits': 'The discussion area is empty, please say two sentences~'}}
release
{{tips.text}}
{{ noteHeaderTitle }} note {{hasMyNote? 'My notes':' Take notes'}}
{{hasMyNote? 'My notes':' Take notes'}}
Quality Notes
Updated on: {{$dayjs. format ('YYYY-MM-DD HH: mm: ss', item.last_uptime*1000) }}
 head portrait
{{ detail.username }}

Public notes are visible to others and have the opportunity to be rated as "high-quality notes" by the administrator

{{ noteEditor.content.length }}/2000

Public Notes
preservation
put questions to

The lecturer will answer your questions as soon as possible. If you choose to ask questions in public, you can get more help from students.

Record time point
Record the time when the video is played when asking questions, so as to facilitate subsequent viewing
Open questions
Submit