NAME
AmberDB::Cache - Native .db and .inx RAM-Disk (tmpfs) unified cache and persistent buffer engine for AmberDB
SYNOPSIS
# Soft Cache (use_cache => 1):
# Caches metadata (lastid, keys, count) in cache/$tableid.inx and allows manual caching:
$dbp->cache_write("product", "vitrin", @product_data);
my @data = $dbp->cache_read("product", "vitrin");
$dbp->cache_delete("product", "vitrin");
# Hard Cache (use_cache => 2):
# Mirrors entire table into cache/$tableid.db and cache/$tableid.inx (tmpfs RAM-disk)
$dbp->cache_preload("catalog_category");
# Persistent buffer operations (stored under dbstore/buffer/)
$dbp->buffer_write("product", @heavy_computation_records);
my @records = $dbp->buffer_read("product");
$dbp->buffer_delete("product");
DESCRIPTION
AmberDB::Cache manages two distinct storage subsystems: 1. Unified RAM-Disk (tmpfs) cache mirroring AmberDB's native .db and .inx formats under dbstore/cache/. 2. Persistent disk buffer staging under dbstore/buffer/ for heavy computation and temporary dataset staging.
AUTHOR
Maruf Cetin <marufcetin@gmail.com>
LICENSE AND COPYRIGHT
Copyright (C) 2020-2026 Maruf Cetin.
This library is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.