-
Notifications
You must be signed in to change notification settings - Fork 0
Concept In Memory Schema Mutation
Turkce Dokumantasyon | English Documentation
Category: Core Concepts & Architecture
Subsystem: Schema Engine (AmberDB::Base)
Entry Type: Architectural Concept
Zero-Migration In-Memory Schema Mutation is AmberDB's architecture for dynamically altering table schema properties, validation rules, index targets, storage paths, and behavior flags in-memory at runtime via table_attr().
In traditional relational databases, adding a column or index requires executing heavy ALTER TABLE DDL statements, acquiring exclusive metadata table locks, rebuilding physical table pages, and running migration scripts. In AmberDB, records are naturally extensible arrays. An application can dynamically adjust a table's configuration (e.g. enabling keep_deleted, adding new search_block indexes, or switching storage directories) on the fly for the active process without touching physical files or running migrations.
Dynamic In-Memory Schema Customization
Physical Schema File (schema/catalog_product.table)
Loaded on startup
Table Info Hash in Memory
Runtime Mutation: $adb->table_attr("catalog_product", ...)
Dynamically Updated Properties (Immediate Effect in Active Process):
- keep_deleted => 1 (Enable soft-delete recycle bin)
- search_block => [1, 4, 9 ] (Include block 9 in full-text search)
- use_cache => 2 (Force strict RAM-disk mirroring)
- path => "/custom/storage/path" (Auto-recalculates table handles)
When modifying routing attributes such as year, section, or language via table_attr(), AmberDB automatically recalculates all internal file paths (.db, .inx, .src, .fld, .fac) and invalidates open cached handles safely.
# 1. Read existing schema attribute
my $id_type = $adb->table_attr("catalog_product", "id_type");
# 2. Dynamically enable soft-delete and adjust search blocks at runtime
$adb->table_attr("catalog_product", {
keep_deleted => 1,
search_block => [1, 4, 8 ],
use_cache => 0,
});
# 3. Subsequent delete_id() calls will now soft-delete to .del archive
$adb->delete_id("catalog_product", 101);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