-
Notifications
You must be signed in to change notification settings - Fork 0
Concept RAM Disk Acceleration
Turkce Dokumantasyon | English Documentation
Category: Core Concepts & Architecture
Subsystem: Cache & Buffer Engine (AmberDB::Cache)
Entry Type: Architectural Concept
RAM-Disk Shared Memory Acceleration is AmberDB's architecture for achieving sub-microsecond in-memory table read/write latencies by mounting an OS-level shared memory filesystem (tmpfs on Linux or ImDisk on Windows) under dbstore/cache/.
Because AmberDB uses raw Berkeley DB (DB_File) hash files, caching is not restricted to a single Perl worker process. All parallel worker processes (e.g. Plack/Starman/Apache mod_perl workers) access the same shared memory mapped table files concurrently using kernel-managed page caching and non-blocking shared OS flock locks.
RAM-Disk Multi-Process Shared Memory Architecture
Perl Worker Process 1 Perl Worker Process 2 Perl Worker Process N
Shared RAM-Disk Filesystem (/dev/shm or ImDisk R:)
dbstore/cache/catalog_category.db & .inx (In-Memory Hash)
Atomic Preload ($adb->cache_preload)
Persistent Physical Storage Disk (dbstore/tables/*.db)
In the table schema (schema/*.table):
-
use_cache => 0: Standard disk-backed reads/writes. -
use_cache => 1: Direct memory caching on read operations with TTL expiration check (cache_ttl => 3600). -
use_cache => 2: Strict RAM-Disk Mirroring. AmberDB automatically ensures the entire table is preloaded into RAM-disk on first access viacache_ensure(). All subsequent read operations run purely against the RAM-disk.
# Check RAM-disk mount status and environment diagnostics
my $diag = $adb->cache_setup();
print "RAM-Disk Mounted: $diag->{is_mounted} (Size: $diag->{cache_size})\n";
# Atomically preload a high-traffic table (e.g. categories) into memory
$adb->cache_preload("catalog_category");
# Read from memory cache (sub-microsecond response time)
my @category = $adb->cache_read("catalog_category", 12);AmberDB — High-Performance Schema-Driven NoSQL Database Engine for Perl.
Copyright 2005-2026 Maruf Cetin. Released under the Artistic License 2.0.
CPAN · GitHub Repository · Issue Tracker
- Berkeley DB (DB_File) Engine
- AmberDB Table Schema
- Global Flags
- Table Schema Flags
- Directory Structure
- File Structure (Extensions)
- Repeat Blocks
- Auto-Increment ID
- ASCII ID
- Relational Records
- Record Anatomy
- JOIN-Free Architecture
- Packed Binary Index
- Strict 2PL Locking
- Undo Journal & Rollback
- Tiered Junk Indexing
- Disjunctive Faceting
- Phonetic Accent Search
- 2-Pillar Disaster Recovery
- RAM-Disk Acceleration
- In-Memory Schema Mutation
- Simple Mode
- new
- config
- set_datadir
- insert_id
- insert_list
- modify_id
- modify_list
- delete_id
- delete_list
- read_id
- read_all
- read_list
- exist_id
- exist_list
- exist_table
- table_count
- table_keys
- table_lastid
- table_attr
- table_create
- field_fetch
- field_filter
- search_table
- facet_menu
- field_fltkeys
- field_allfltkeys
- facet_rules
- slug_read
- slug_fetch
- transact_start
- transact_end
- transact_commit
- transact_rollback
- transact_recover
- flock_open
- flock_close
- cache_setup
- cache_read
- cache_write
- cache_delete
- cache_preload
- cache_ensure
- buffer_write
- buffer_read
- buffer_delete
- recs_scan
- recs_get
- recs_put
- recs_del
- locale_uc
- locale_lc
- locale_sort
- locale_to_ascii
- locale_num2text
- locale_format_currency
- locale_format_date
- array_sort
- array_punch
- array_filter
- array_sublist
- deep_copy
- log_owner
- use_counter
- use_junk
- keep_deleted
- auto_id
- buffer_write
- simple
- no_write
- no_backup
- jnktype
- keys_only
- id_type
- language
- .db · .table · .dbase
- .inx · .fld · .src
- .fac · .srt · .slg
- .unq · .del · .aut
- .cnt · .txn · .amberdb
- .csv · .cache · .tmp