AmberDB

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

          * Wrapped 'do $target_path' inside eval { do $target_path } in AmberDB::Base::Schema (table_info() and dbase_info()).
          * Prevents fatal process/worker termination when user .table or .dbase schema files contain syntax errors under global $SIG{__DIE__} handlers.

        - [SLUG INDEX ARCHITECTURE VERIFICATION (.slg)]
          * Verified flat unified .slg index access model where block numbers (formerly _0 / _1 file suffixes) reside in key prefixes:
            - Block 0: "0:$rid" -> URL slug value
            - Block 1: "1:$slug" -> Record ID value
          * Enforced direct .slg table access and recs_get key lookups without legacy .rwt fallbacks.

        - [GROUP-LEVEL SCHEMA INHERITANCE (.dbase -> .table)]
          * Database group schema files (.dbase) now cascade common operational flags to all member tables in the group.
          * Added %INHERITABLE_DBASE_KEYS whitelist in AmberDB::Base::Schema (use_ramdisk, keep_deleted, use_counter, log_owner, table_dir, use_section, etc.) preventing table-specific blocks and rules from leaking.
          * Granular overrides: attributes explicitly defined in a .table file take precedence over .dbase defaults.
          * Upgraded version string to 5.25.3 across all modules in lib/.

5.25.2  2026-09-11
        - [CONNECTION PROFILE & SHADOW CRYPTOGRAPHY ARCHITECTURE]
          * Decentralized connection profile abstraction ($adb->{_connect}) managing database, username, password, and session token.
          * Introduced Unix shadow format standard: sha256$<16_hex_salt>$<hex_digest> via Digest::SHA for one-way password protection.
          * Self-securing auto-elevation: plain-text passwords written to connect.pl are automatically upgraded to salted SHA-256 shadow hashes upon connection, and plain-text passwords are purged from disk.
          * Full backwards compatibility: empty/undef password and shadow grant passwordless access for local application layers (web, local workers).

Changes  view on Meta::CPAN

          * Enhanced $adb->table_attr() with unified getter/setter and automatic path refresh on schema changes (year, section, lang).
          * Protected $adb->table_info() by returning shallow copies to prevent external reference leaking and unauthorized in-memory state mutations.
          * Refactored all internal core modules (lib/AmberDB.pm, lib/AmberDB/Base.pm, lib/AmberDB/Tools.pm, lib/AmberDB/Transact.pm, lib/AmberDB/Cache.pm, lib/AmberDB/Index/Junk.pm) to interact strictly through accessor methods ($adb->config, $adb->...
          * Enforced restricted hash key access via Hash::Util::lock_keys with private internal naming (_cfg, _path, _table, _dbase, _cache, _db, _txn) and locked container references (Hash::Util::lock_value) against typo/unauthorized overwrites.
          * Added comprehensive unit test suite t/amberdb_encapsulation.t covering all 10 encapsulation scenarios.
        - [MIGRATION NOTICE / BREAKING CHANGE] Standardized schema terminology across the entire codebase and directory layout:
          * UPGRADE ACTION REQUIRED: Existing projects must rename their physical 'dbstore/scheme/' directory to 'dbstore/schema/'.
          * Updated RAM-disk setup scripts (setup_ramdisk.sh, setup_ramdisk.ps1, setup_ramdisk.pl, setup_ramdisk.bat) to mount 'schema/'.
        - Upgraded transaction engine specification to full ACID-Compliance with Strict Two-Phase Locking (Strict 2PL):
          * Enforced Lock-Before-Write and Lock-Before-Read ordering across insert_id, modify_id, and delete_id for true serializable isolation.
          * Introduced 'no_transact => 1' schema attribute and table_attr() support to exempt auxiliary tables from abort cascades while preserving LIFO rollback consistency.
        - Added comprehensive ACID architectural guarantees section to documentation (README.md, Turkish and English User Guides).
        - Clarified architectural distinction between high-throughput batch ETL imports and atomic business transactions.
        - Standardized file open error diagnostics and OS-level reporting ($!) across all core modules:
          * Added explicit OS error reporting ($!) to all open and tie failures in AmberDB, Base, Cache, Transact, and Tools.
          * Replaced silent schema open failure in AmberDB::Base::table_write with diagnostic cluck and graceful return.
          * Improved audit log error handling in AmberDB::auth_insert with cluck and record skipping.
        - Redesigned 2-Pillar Disaster Recovery and Native Backup Architecture:
          * Upgraded recs_back to continuous chronological time-series stream in 'backup/YYYY/YYYY-MM-DD.csv' eliminating folder clutter and ensuring zero-data-loss logging.
          * Added Tools->dump() for creating portable, compressed '.amberdb' archives packaging schemas (schema/*.table, schema/*.dbase), authoritative data files (tables/*.db, tables/*.del, tables/*.aut, tables/*.cnt, tables/*_*.str), and cryptograp...
          * Preserved native physical directory layout (schema/ and tables/) in .amberdb archives for 1-to-1 extraction and portability.

docs/EN.AmberDB_User-Guide.md  view on Meta::CPAN

2. **Derived & Rebuildable Indexes (Disposable Secondary Projections):**
   - **`.inx` (Record Index + Sort), `.fld` (Match), `.src` (Full-Text), `.fac` (Facet), `.slg` (URL Slug):** All these index files are deterministic projections derived directly from `.db`.
   - If any secondary index is corrupted, deleted, or incomplete, running `AmberDB::Tools->set_index($table)` reconstructs all indexes from scratch within seconds with **zero data loss**.

> **Rationale Behind Transaction Design:** `AmberDB::Transact` was deliberately engineered around this principle. A failure writing to the authoritative `.db` file (`is_index == 0`) triggers an immediate automatic `rollback`. However, if the master d...

### 7.7 Exempting Auxiliary Tables from Failure Cascades (`no_transact`)

In multi-table business operations (e.g. creating an order, updating inventory, and charging accounts), some tables represent **core transactional entities** (orders, payments, inventory), while others serve as **auxiliary or secondary records** (cus...

AmberDB allows declaring tables with `no_transact => 1` (either in schema `.table` or dynamically at runtime) to **exempt them from transaction abort cascades**:

1. **Static Schema Definition (`.table` file):**
   ```perl
   # order_customer_summary.table
   {
       name        => "Customer Order Summary",
       no_transact => 1,   # Failures here do NOT abort the main transaction
       schema      => [qw(user_id order_id amount created_at)],
   }
   ```



( run in 1.743 second using v1.01-cache-2.11-cpan-e7c6538aa59 )