Is there any ready-made excellent framework for persistently storing redis data to mysql?

Source: Internet
Author: User
I write code for several projects, open redis, fetch data to the variable, open mysqli, insert data to the database, and add the script to cron. I feel that there are a lot of repetitive code, so I would like to ask if there are some common and efficient code for re... I write code for several projects, open redis, fetch data to the variable, open mysqli, insert data to the database, and add the script to cron.
I feel that there are a lot of repetitive code, so I would like to ask if there are some general and efficient frameworks that are used to persistently store data in redis to mysql?

Reply content:

I write code for several projects, open redis, fetch data to the variable, open mysqli, insert data to the database, and add the script to cron.
I feel that there are a lot of repetitive code, so I would like to ask if there are some general and efficient frameworks that are used to persistently store data in redis to mysql?

1. first, even if the framework is used, what it does will be retrieved from redis and then persisted to mysql, which does not reduce the operations on the data layer, the framework does not need to be written in your code. (Only one advantage ).
2. Data structure and persistence. Redis storage format is mostly K-V, Key is generally the primary Key ID, and VALUE is generally JSON, and mysql is how, mysql is a field, that is to say, you still need to convert the Json into a javabean and then persist it. So if your data structure is fixed, you can consider writing a script for regular processing. if your data is changed, you should manually control it, otherwise, what is the difference between changing your script and writing two lines of code?

Summary: The framework cannot solve the problem of adapting your redis to mysql complex data formats. It would be nice to maintain a timer for a simple data structure. If you need to do this, you need to find a problem and the bug is not controlled yet.

SetredisData in the persistent storagemysql.
redisUsed as a cache, data comes from the data persistence layer.
For search engines, suchsolrAndmysqlIn this case, you can consider data persistence to the database.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.