Serverless Database Memory Reclamation for Cost Optimization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Serverless databases face challenges in managing memory efficiently, leading to higher costs due to persistent cache memory usage even when user workloads are low, as traditional caching strategies do not effectively reduce memory usage in response to decreased activity.
Innovation Solution
Implement a memory management system that detects trigger events to reclaim memory from serverless database instances, determining the amount to reclaim and identifying specific memory to free, allowing for customizable reclamation policies to balance performance and cost, including machine learning-based optimizations for historical usage patterns.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If traditional caching strategies are used to improve performance, then query performance is improved, but memory usage persists even when user workload is low, leading to higher costs
Solution Approach 1:
The patent implements dynamic cache memory management by transitioning from static cache allocation to dynamic reclamation. The system continuously monitors workload patterns and automatically adjusts cache memory usage based on actual demand, shrinking cache when workload is low and expanding when needed, thus resolving the contradiction between maintaining performance and reducing memory usage.
Solution Approach 2:
The system changes the parameter of cache memory allocation from fixed to variable. By introducing workload-based thresholds and automated reclamation policies, the cache memory size becomes a dynamic parameter that adapts to workload conditions, allowing the system to optimize between performance and cost based on actual usage patterns.
2Quantity of substance
If cache memory is reduced to lower costs, then billing aligns with actual usage, but performance may be impacted
Solution Approach 1:
The patent implements feedback mechanisms by monitoring workload patterns and cache access statistics. This feedback information is used to intelligently determine when and how much cache memory to reclaim, ensuring that performance is maintained within acceptable thresholds while optimizing cost. The system continuously adjusts cache size based on real-time performance metrics and workload conditions.
Solution Approach 2:
The system performs preliminary actions by proactively shrinking cache memory before costs become problematic, based on predicted workload patterns. By anticipating low-periods and preemptively reducing cache usage, the system avoids unnecessary cost accumulation while maintaining performance during critical periods, thus resolving the contradiction between cost optimization and performance maintenance.
3Quantity of substance
If aggressive memory reclamation is implemented, then costs are reduced, but performance impact increases
Solution Approach 1:
The patent applies partial action by implementing moderate, measured memory reclamation rather than aggressive complete eviction. The system reclaims only the necessary amount of cache memory based on workload analysis, maintaining a balance between cost reduction and performance stability. This partial reclamation approach allows the system to optimize costs while preserving sufficient cache for critical operations.
Solution Approach 2:
The system implements beforehand cushioning by maintaining a minimum cache threshold and using progressive reclamation strategies. Before completely evicting cache, the system preserves a cushion of essential cached data and uses gradual reclamation steps, preventing sudden performance degradation while still achieving significant cost savings over time.
Data Source
Figure 1
Figure 2~3
Figure 4~5
AI summary
A solution is disclosed for memory management of serverless databases that includes: based at least on detecting a trigger event, determining whether memory is to be reclaimed; based at least on determining that memory is to be reclaimed, determining an amount of memory to be reclaimed; identifying memory to be reclaimed; and reclaiming the identified memory. Disclosed solutions are flexible, enabling customization of the aggressiveness and manner of memory reclamation. This permits users to specify a tailored balance point between performance and cost, for arrangements that bill users based on resource usage (e.g., memory consumed by a serverless database). In some examples, users specify a ramp-down parameter that is used to determine how much memory can be evicted in a particular reclamation event, time intervals (or another criteria) for triggering a reclamation event, and a definition for whether a cache is active.