List of questions:
1. How to read the source code of Redis efficiently? 2. What components and modules should a K-V database consist of? 3. What does Redis mean by binary security? 4. What are the slow operations of fast Redis? 5. Integer arrays and compressed lists are not very good at finding time complexity, so why Redis still using them as the underlying data structure? A. Memory utilization. Arrays and compressed lists are very compact data structures that take up less memory than linked lists. Redis is an in-memory database, and a large amount of data is stored in the memory. At this time, it is necessary to optimize as much as possible to improve the memory utilization. B, an array of CPU cache support more friendly, so in the design of Redis, collection of data elements less cases, the default with the method of compaction memory storage, use of CPU cache will not reduce the access speed at the same time, after the data elements more than set threshold, to avoid the query time complexity is too high to jump into a hash and table data storage structure, Ensure query efficiency. 6. Why is single-threaded Redis so fast? 7. What are the potential performance bottlenecks of Redis single-threaded IO requests? A. Use complex commands. B. Perform big key operations...... 8. How does Redis avoid data loss when downtime occurs? 9. When AOF logs are rewritten, the bgreWriteAof child process does not block the main process. But are there any other potential blocking risks during rewriting? AOF overrides also have a rewrite log, why doesn't it share the log that uses AOF itself? A: A. It is inevitable that the parent and child processes will compete when writing the same file. Controlling the competition means that the performance of the parent process will be affected. If the AOF rewrite fails, the original AOF file is polluted, so rewrite a new file, if the failure is directly deleted, it will not affect the original file, after rewriting, directly replace the old file can be. 11. How can Redis quickly recover after downtime? 12. How to achieve data consistency between master and slave libraries? 13. Why not use AOF for replication between master and slave libraries?Copy the code
Will always be updated…