Cache Module Log Decoupling for Social Network Data Consistency
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing systems for processing long relation chain data in social network systems face issues with inconsistent speeds between cache and database operations, leading to high data error rates and loss of modification requests due to reliance on cache module memory and potential restarts.
Innovation Solution
A system with a cache module, a receiving module, and a saving module, where the cache module synchronizes modification requests to the receiving module for storage in a non-memory operation log file, and the saving module reads from this log to update the database, decoupling cache and saving operations and reducing memory usage and data errors.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If the cache module stores operation logs in memory to respond to read requests at top speed, then the read speed is improved, but the memory space is heavily occupied and modification requests may be lost upon restart
Solution Approach 1:
The patent extracts the operation log storage function from the cache module and places it in a separate receiving module that writes to non-memory storage devices. This separation allows the cache module to focus on fast reading while the receiving module handles persistent storage, reducing memory space occupation while maintaining read speed.
Solution Approach 2:
The receiving module acts as an intermediary between the cache module and the database saving module. It receives modification requests from the cache module, stores them in operation log files on non-memory storage devices, and enables the saving module to process them asynchronously, thus reducing memory dependency while ensuring data persistence.
2Speed
If the cache module processes modification requests directly without persistent storage, then the processing speed is improved, but the reliability is reduced due to potential request loss
Solution Approach 1:
The receiving module performs preliminary action by storing modification requests in operation log files on non-memory storage devices before the saving module processes them. This ensures that modification requests are persisted reliably even if the cache module restarts, while the cache module can continue processing new requests at high speed without waiting for database updates.
Solution Approach 2:
The operation log files serve as an intermediary storage mechanism between the fast cache module and the reliable but slow database. This intermediary layer ensures that modification requests are not lost (improving reliability) while allowing the cache module to process requests asynchronously (maintaining speed).
3Speed
If the cache module and saving module operate at different speeds, then the cache responsiveness is improved, but the system complexity increases due to synchronization requirements
Solution Approach 1:
The receiving module with operation log files acts as an intermediary that decouples the cache module and saving module. The cache module writes modification requests to the receiving module without waiting for database updates, and the saving module reads from the operation log files at its own pace. This asynchronous mechanism simplifies synchronization while maintaining cache responsiveness.
Solution Approach 2:
The system is segmented into three independent modules: cache module for fast reading and request generation, receiving module for persistent request logging, and saving module for database updates. Each module operates independently at its own speed, eliminating the need for complex synchronization between cache and saving operations.
4Speed
If the system uses pure memory operation for cache and direct DB operation for saving, then the operational speed is improved, but the data error rate increases due to speed mismatch
Solution Approach 1:
The operation log files in the receiving module serve as an intermediary that bridges the speed gap between memory-based cache operations and disk-based database operations. By logging all modification requests persistently before database updates, the system ensures data accuracy even when cache and database operations proceed at different speeds.
Data Source
AI summary
A cache module responds to an operation request, from a front end, for long relation chain data of a user, and synchronously sends a modification request in the operation request to a receiving module; the receiving module receives the modification request from the cache module, and synchronously stores the modification request into an operation log file of a storage device; a saving module reads the modification request in the operation log file of the receiving module, and modifies the long relation chain data in a database (DB) according to the read modification request.


