SAM: A Stability-Aware Cache Manager for Multi-Tenant Embedded Databases

Haoran Zhang, Decheng Zuo, Yu Yan, Zhiyu Liang, Hongzhi WangarXiv 2025 · DOI

In the evolving landscape of edge computing, multi-tenancy has become the standard operating model. A single gateway device often hosts multiple independent applications—such as network monitors, data loggers, and local analytics engines—each utilizing its own instance of an embedded database like SQLite. However, these devices are inherently resource-constrained. When multiple database tenants compete for a limited physical memory cache, performance often suffers from extreme volatility and unpredictable oscillations.

To address this, researchers from the Harbin Institute of Technology developed SAM (Stability-Aware Manager). SAM is an autonomic cache management framework that treats "decision stability" as a primary design principle. By balancing agility with resilience, SAM ensures high throughput and predictable performance even under shifting workloads or adversarial conditions.

The Challenges of Multi-Tenant Cache Management

Traditional monolithic database servers (e.g., MySQL) manage resources centrally. In contrast, embedded databases are libraries integrated into applications, making coordinated resource management difficult. The authors identify four primary hurdles:

  1. Workload Dynamism: The system must rapidly reallocate cache to emerging performance "hotspots."
  2. Cache Pollution: It must identify and ignore "polluters"—tenants performing full table scans that consume memory without providing significant performance gains.
  3. SLA Guarantees: High-priority tasks must be protected from starvation by lower-priority neighbors.
  4. Decision Stability: Frequent, jittery reallocations can trigger performance oscillations that are more detrimental than a slightly sub-optimal static allocation.

The SAM Architecture

SAM addresses these challenges through a structured architectural approach that decouples safety from efficiency.

The Two-Pool Model

Instead of managing a single global memory bucket, SAM divides the available cache into two distinct segments:

  • Fixed Pool: Provides a guaranteed baseline for every tenant, ensuring that minimum Service Level Agreement (SLA) requirements are met regardless of system-wide contention.
  • Elastic Pool: This pool is dynamically managed to maximize overall system "Effective Throughput."
High-level architecture of SAM, illustrating the separation of Fixed and Elastic pools and the autonomic control loop.

The AURA Control Policy

The core of SAM is the AURA (Autonomic Utility-balancing Resource Allocator) policy. AURA navigates the exploitation-exploration trade-off using two orthogonal signals:

  • The $H$-factor (Exploitation): Rewards tenants based on their proven historical efficiency, acting as a stable anchor for the system.
  • The $V$-factor (Exploration): Estimates the marginal gain a tenant might achieve with additional cache, allowing the system to discover new hotspots.

Scalability and Stability Mechanisms

To maintain low overhead when managing hundreds of databases, AURA employs an Adaptive Active Set (AAS). This mechanism restricts intensive optimization to a small subset of "active" tenants, keeping decision latency nearly constant as the system scales. Furthermore, SAM utilizes momentum-based allocation and actuation filtering to act as a "shock absorber," preventing the system from overreacting to transient noise or minor workload spikes.

The AURA control cycle, featuring localized optimization (Fast Path) and global scanning (Slow Path) to ensure scalability and stability.

Key Results and Performance

SAM was evaluated against 14 baseline managers using industry-standard benchmarks (TPC-C) and adversarial scenarios on real-world hardware, including the Raspberry Pi 5. Key findings include:

  • Superior Throughput: SAM matched or exceeded the performance of aggressive greedy heuristics while providing significantly higher stability.
  • Adversarial Resilience: During "scan attacks" (where a tenant attempts to hog cache with low-value scans), traditional managers often crashed the performance of critical tasks. SAM remained unfazed, maintaining a 97-98% hit rate for VIP tenants.
  • Excellent Scalability: While other managers saw decision times grow linearly with the number of databases, SAM’s decision latency remained flat for up to 120 databases.
  • Minimal Overhead: On edge hardware, SAM consumed only 0.0062% of the available decision time budget, making its management overhead practically negligible.

Conclusion

SAM demonstrates that stability is not a constraint on performance but a driver of it. By avoiding "knee-jerk" reactions to workload noise and separating baseline safety from dynamic optimization, SAM provides a robust framework for managing resources in the unpredictable environments of edge computing. Future work aims to extend these principles to other shared resources, such as I/O bandwidth and CPU priority.

Summary updated

BibTeX
@misc{zhang2025sam,
  author = {Haoran Zhang and Decheng Zuo and Yu Yan and Zhiyu Liang and Hongzhi Wang},
  title = {{SAM: A Stability-Aware Cache Manager for Multi-Tenant Embedded Databases}},
  year = {2025},
  eprint = {2507.22701},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.22701},
}
Figure