Microservice Cache Layer for Faster Consistent Data Access
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Microservices architectures face inefficiencies in data access and consistency, leading to increased latency, network traffic, and resource utilization due to repetitive database queries and lack of centralized data management, especially in high-volume transaction systems.
Innovation Solution
Utilizing cache nodes to store computations for microservices, allowing direct access without database connections, thereby reducing redundant data retrieval and improving transaction processing efficiency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If microservices directly access the database for each transaction, then data consistency is maintained, but transaction processing speed decreases and resource usage increases
Solution Approach 1:
The system performs preliminary actions by caching computed data from the data access layer before transaction requests arrive. The cache nodes store computations that can be reused across multiple transactions, eliminating the need for repeated database access while maintaining consistency through controlled cache invalidation mechanisms.
Solution Approach 2:
The patent introduces cache nodes as intermediary components between microservices and the data access layer. These intermediaries store pre-computed data and serve transaction requests without requiring direct database connections, thus improving speed while preserving data consistency through coordinated updates.
2Loss of energy
If microservices repeatedly query the database for the same data, then data accuracy is ensured, but network traffic and resource utilization increase
Solution Approach 1:
The system creates copies of data from the data access layer and stores them in cache nodes. These copies serve subsequent transaction requests without requiring additional database queries, reducing network traffic and resource utilization while maintaining data accuracy through synchronized updates from the source.
Solution Approach 2:
Data is pre-retrieved and cached before transaction requests are processed. This preliminary action eliminates the need for repeated database queries during transaction processing, reducing resource utilization while ensuring data accuracy through controlled cache synchronization.
3Reliability
If a centralized data access service is implemented, then data consistency improves, but system complexity increases
Solution Approach 1:
The centralized data access service is segmented into distributed cache nodes that can be independently managed and scaled. Each cache node handles specific data or service requests, reducing the complexity of any single component while maintaining overall system consistency through coordinated operations.
Solution Approach 2:
The cache nodes serve as intermediaries that simplify the interaction between microservices and the data access layer. By handling data retrieval and caching logic centrally at the cache layer, the system reduces the complexity individual microservices would otherwise need to manage while maintaining data consistency.
4Loss of time
If database connections are established for each transaction, then data freshness is guaranteed, but transaction latency increases
Solution Approach 1:
Data is retrieved and cached in advance before transaction requests are processed. This preliminary action eliminates the time required to establish database connections during transactions, reducing latency while maintaining data freshness through controlled cache synchronization mechanisms.
Solution Approach 2:
Cache nodes act as intermediaries that store fresh data retrieved from the data access layer. By serving transactions from this intermediate cache layer, the system eliminates repeated database connection overhead while maintaining data freshness through coordinated updates from the source layer.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
A transaction system receives a transaction request for a database service. The transaction system retrieves, by a first microservice, a set of data from a data access layer of the database service in response to receiving the transaction request. The transaction system performs a set of computations based on the set of data retrieved from the data access layer. The transaction system stores the set of computations in one or more cache nodes of a data access service and accesses, by a second microservice, the set of computations, performed in response to retrieving the set of data by the first microservice, from the one or more cache nodes.