-
Notifications
You must be signed in to change notification settings - Fork 0
Concept JOIN Free Architecture
Turkce Dokumantasyon | English Documentation
Category: Core Concepts & Architecture
Subsystem: Data Model & Schema Engine (AmberDB::Base)
Entry Type: Architectural Concept
The JOIN-Free Extensible Block Architecture is AmberDB's design paradigm for eliminating expensive relational SQL JOIN operations, locking contentions, and nested Cartesian products. Instead of normalizing data across dozens of foreign-key joined tables, AmberDB models domain entities as self-contained, hierarchical, extensible multi-block records.
Complex parent-child, one-to-many, and many-to-many relationships are embedded directly within the record using comma-separated relational keys ("12,45,99"), multidimensional arrays ([[... ], [... ] ]), or nested dictionaries ({ ... }). AmberDB's indexing engine automatically extracts and precomputes inverted index mappings (.fld, .fac, .src) for these embedded relational values on every insert or update.
Relational SQL Model vs AmberDB JOIN-Free Model
Traditional SQL (Multiple Table JOINs):
Products > ProductTags > Tags ==> Expensive multi-table
JOINs at query time
> ProductImages
AmberDB JOIN-Free Record Model:
Single Master Record (catalog_product.db)
[ID, Title, CategoryCSV, Price, [TagsArray], [VariantsAoA], {SpecsHash} ]
Precomputed on Insert/Update (Zero Query-Time Overhead)
.inx (ID Map) .fld (Fields) .fac (Facets) .src (Search)
-
Zero Query-Time JOIN Overhead: Single-key lookups (
read_id) and list reads (read_list) fetch the entire domain entity in a single$O(1)$ disk seek without disk seeks across multiple tables. -
Precomputed Inverted Indexing: Adding a category ID (e.g.
"5,12") to a product record automatically inserts the product's ID into the inverted match index (_2.fld) for both category 5 and category 12 during insertion. Querying category 5 viafield_fetchdirectly returns the record IDs in$O(1)$ time. - No Lock Cascading: Writing to a record only locks the target table or record without cascading lock acquisitions to junction tables.
- Natural JSON and REST API Alignment: Records map directly to JSON objects and REST representations without object-relational mapping (ORM) impedance mismatch.
Stored as delimiter-separated scalar strings or nested array references:
# Product record with multiple category IDs in Block 2: "10,25,88"
my @product = (0, "Gaming Laptop", "10,25,88", 1499.00);
$adb->insert_id("catalog_product", @product);
# Schema match_block => [2 ] indexes all 3 categories automatically.
# Querying any category fetches the product instantly:
my @laptops = $adb->field_fetch("catalog_product", 2, "25");When associated entity details (e.g. customer profiles or publisher details) need to be loaded, read_list is used:
# 1. Read order records
my @orders = $adb->read_all("order_active");
# 2. Extract unique customer IDs in-memory
my %cust_ids = map { $_->[2] => 1 } @orders;
# 3. Batch-fetch all customer profiles in a single pass preserving order
my @customers = $adb->read_list("customers", [keys %cust_ids ]);Tip
When to Normalize:
Store static or high-frequency shared entities (such as users, categories, vendors) in their own master tables, and store their IDs inside referencing records. Use read_list for high-throughput batch retrieval rather than performing looped single-record queries.
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