-
Notifications
You must be signed in to change notification settings - Fork 0
Concept 2 Pillar Disaster Recovery
Maruf Çetin edited this page Sep 1, 2026
·
2 revisions
Turkce Dokumantasyon | English Documentation
Category: Core Concepts & Architecture
Subsystem: Backup & Maintenance Engine (AmberDB::Tools)
Entry Type: Architectural Concept
AmberDB's 2-Pillar Disaster Recovery Architecture provides a dual-layer strategy combining real-time continuous write-ahead logging (WAL) with portable, space-efficient, deterministic database snapshots (.amberdb).
The 2-Pillar Disaster Recovery Model
Pillar 1: Continuous Append-Only WAL Audit Stream
Live Writes (Insert / Modify / Delete)
backup/YYYY/YYYY-MM-DD.csv (Chronological user & action stream)
- Zero data loss (RPO ~ 0)
- Immutable audit trail
Pillar 2: Native Portable Database Snapshot (.amberdb)
Triggered via $tools->dump() / Cron
backup/YYYY/amberdb_YYYY-MM-DD.amberdb (Gzip tar archive)
- Contains schemas: schema/*.table, schema/*.dbase
- Contains master tables: tables/*.db, *.del, *.aut, *.cnt, *.unq
- Verified with SHA-256 manifest.json
- Excludes derived indexes (.inx, .fld, .src, .fac, .srt) for space
- Auto-reconstructs indexes deterministically via set_index on restore
- Every mutating operation (
insert_id,modify_id,delete_id, batch lists) automatically appends a chronological audit log entry to the daily WAL file:dbstore/backup/YYYY/YYYY-MM-DD.csv. - Each log line contains:
[Timestamp, Action (INSERT/MODIFY/DELETE), UserID, TableID, RecordID, SerializedData ]. - Can be disabled on temporary ETL loads using
no_backup => 1.
-
Space Efficiency: Secondary derived indexes (
.inx,.src,.fld,.fac,.srt) constitute up to 70% of database disk footprint. AmberDB deliberately excludes these from.amberdbarchives. -
Deterministic Reconstruction: Upon running
restore(file => "backup.amberdb"), the engine extracts schemas and authoritative master tables, then deterministically executesset_indexon all tables to rebuild all binary indexes. -
Cryptographic Verification: Every archive contains a root
manifest.jsonwith SHA-256 hashes for all authoritative files. Corrupted or tampered archives are rejected before restoring.
use AmberDB;
use AmberDB::Tools;
my $adb = AmberDB->new(path => { dbase_dir => "./dbstore" });
my $tools = AmberDB::Tools->new($adb);
# 1. Create a full compressed backup archive
my $archive_path = $tools->dump();
print "Backup created at: $archive_path\n";
# 2. Restore backup into a new or existing database with reindexing
$tools->restore(
file => $archive_path,
force => 1, # Allow overwriting existing tables
reindex => 1 # Deterministically rebuild all .inx, .fld, .src, .fac, .srt
);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