-
Notifications
You must be signed in to change notification settings - Fork 0
Concept Directory Structure
Turkce Dokumantasyon | English Documentation
Category: Core Concepts & Architecture
Subsystem: Storage & Filesystem Architecture (AmberDB::Base)
Entry Type: Directory Hierarchy & Placement Guide
The AmberDB Directory Structure defines a clean, deterministic physical hierarchy that cleanly segregates schemas, authoritative master data, derived secondary indexes, transaction journals, RAM-disk mount points, and disaster recovery archives.
All database files reside under a single root database directory (conventionally named dbstore/). AmberDB automatically inspects and scaffolds this hierarchy upon instantiation.
Standard AmberDB Directory Hierarchy (dbstore/)
dbstore/
├── schema/ ← Schema Definitions
│ ├── catalog.dbase ← Database group configuration
│ └── catalog_products.table ← Table schema definition
├── tables/ ← Master Data & Derived Indexes
│ ├── catalog_products.db ← Berkeley DB primary table
│ ├── catalog_products.del ← Soft-deleted recycle bin archive
│ ├── catalog_products.aut ← User modification audit ledger
│ ├── catalog_products.cnt ← High-concurrency hit counter store
│ ├── catalog_products.inx ← 8-byte packed primary ID index
│ ├── catalog_products_1.fld ← Inverted exact-match index
│ ├── catalog_products_2.src ← Full-text phonetic search index
│ ├── catalog_products_3.fac ← Columnar facet bitset index
│ ├── catalog_products_4.srt ← Monotonic binary sorted index
│ └── catalog_products_1.unq ← Bidirectional dictionary and uniqueness index
├── backup/ ← Continuous WAL & .amberdb Archives
│ └── 2026/
│ ├── 2026-09-01.csv ← Continuous daily audit stream (Pillar 1)
│ └── full_backup.amberdb ← Compressed backup archive (Pillar 2)
├── cache/ ← RAM-Disk Shared Memory (tmpfs / ImDisk)
├── buffer/ ← Transient Disk Staging Files (.tmp)
└── txn/ ← Active Transaction Undo Journals (.txn)
| Directory | Type | Purpose |
|---|---|---|
schema/ |
Persistent | Houses table schemas (.table) and database group configurations (.dbase). |
tables/ |
Persistent | Primary master data (.db, .del, .aut, .cnt, .unq) and derived reconstructible indexes (.inx, .fld, .src, .fac, .srt, .slg). |
backup/ |
Persistent / Archive | Year-partitioned folders (backup/YYYY/) holding daily append-only CSV WAL streams and native .amberdb archives. |
cache/ |
Shared Memory | Mount target for OS RAM-disks (tmpfs / ImDisk). High-frequency table mirrors operate here. |
buffer/ |
Transient (Staging) | Stores staging buffer files (.tmp) during buffer_write pipelines. |
txn/ |
Transient (ACID) | Stores active transaction rollback journals (.txn). Removed upon successful commit. |
The root database directory path is set during instantiation using path => { dbase_dir => ... } or modified dynamically via $adb->set_datadir():
use AmberDB;
# 1. Initialize instance with custom database root
my $adb = AmberDB->new(
path => { dbase_dir => "/var/data/ecommerce_dbstore" }
);
# 2. Change storage path dynamically at runtime
$adb->set_datadir("/mnt/ssd_storage/dbstore");Warning
Web Security (Preventing Direct HTTP Access):
Ensure the database root (dbstore/) is located strictly outside the web server's public document root (htdocs, public_html, www). If it must reside within the document tree, configure web server rules or .htaccess to deny all direct HTTP access unconditionally.
Tip
Cross-Platform Path Compatibility:
Use lowercase ASCII alphanumeric characters, underscores (_), and hyphens (-) for folder names to ensure seamless portability across Linux, Windows, and macOS.
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