Turkce Dokumantasyon | English Documentation
Category: Core Concepts & Architecture
Subsystem: Schemaless Operations (AmberDB::Base)
Entry Type: Architectural Concept
Simple Mode is AmberDB's lightweight operational mode for using tables without creating or defining schema files (.table).
When simple => 1 is configured (or when accessing unmapped tables), AmberDB bypasses schema validation, secondary inverted index maintenance (.fld, .src, .fac, .srt), and metadata lookups. Records are stored directly into the master Berkeley DB (DB_File) hash table (.db) as native key-value pairs.
This mode is ideal for:
Schemaless arbitrary JSON payloads.
:::text
Simple Mode vs Standard Mode
Standard Schema Mode:
insert_id() > Validates Schema > Writes .db > Updates .inx, .fld, .src, .fac, .srt
Simple Mode (simple => 1):
insert_id() > Writes directly to .db (Zero Index Overhead, Maximum Ingestion Speed)
In Simple Mode:
insert_id, read_id, modify_id, delete_id, exist_id) run with full ACID safety at maximum $O(1)$ speed.field_fetch) automatically fall back to fast C-level sequential table scans (recs_scan).# Initialize AmberDB instance in Simple Mode
my $adb = AmberDB->new(
cfg => { simple => 1, no_backup => 1 },
path => { dbase_dir => "./dbstore" }
);
# Insert key-value records without any pre-existing .table file
$adb->insert_id("sessions", "sess_98234a", 1001, "admin", time(), "192.168.1.50");
# Read back directly
my @session = $adb->read_id("sessions", "sess_98234a");
print "User: $session[1], Role: $session[2]\n";