-
Notifications
You must be signed in to change notification settings - Fork 0
Concept Tiered Junk Indexing
Turkce Dokumantasyon | English Documentation
Category: Core Concepts & Architecture
Subsystem: Tiered Storage & Lifecycle (AmberDB::Index::Junk)
Entry Type: Architectural Concept
Tiered Hot/Cold Storage and Junk Indexing is AmberDB's automated lifecycle management system for partitioning active operational records from stale, expired, out-of-stock, or historical data.
Rather than moving passive records to separate archive tables (which breaks ID references and complicates application logic), AmberDB keeps all data inside the single master .db table while partitioning secondary indexes into two distinct tiers:
-
Hot / Active Tier (Tier A): Active records indexed into standard files (
.inx,.fld,.src,.fac,.srt). -
Cold / Junk Tier (Tier B): Passive or out-of-stock records indexed into separate junk index files (
.jinx,.jfld,.jsrc).
Queries can seamlessly target active records only (jnktype => 'A'), historical records only (jnktype => 'B'), or execute high-speed single-pass hybrid searches (jnktype => 'AB').
Tiered Storage Index Partitioning Architecture
Master Table: catalog_product.db
(Contains ALL Records: 1 .. 1,000,000)
[Evaluates junk_rules ] [Evaluates junk_rules ]
Matching Active Rules Matching Passive/Out-of-Stock Rules
Tier A (Hot Storage) Tier B (Cold Storage)
Primary Index: .inx Primary Index: .jinx
Field Matches: _1.fld, _2.fld Field Matches: _1.jfld
Full-Text Search: _3.src Full-Text Search: _3.jsrc
Facet Bitsets: _4.fac
Rules are defined in the table schema (schema/*.table):
{
name => "Products",
record_index => 1,
use_junk => 1,
junk_rules => [
[4, "ne", 1 ], # Direct block rule: status != 1
["2->14", "ne", 1 ], # Relational rule: vendor status != 1
["6->0", "eq", "out_of_stock" ], # Nested array / composite rule
],
jnktype => "AB", # Default query mode
}| Mode | Target Scope | Typical Use Case |
|---|---|---|
'A' |
Active Records Only | Public storefront catalog, high-speed faceted search |
'B' |
Cold / Junk Records Only | Admin archive, discontinued inventory management |
'AB' |
Active First, Then Cold | Global search with prioritized active relevancy |
'BA' |
Cold First, Then Active | Historical audits and legacy investigation |
# 1. Search only active products on the public storefront
my ($active_count, @store_results) = $adb->search_table(
"catalog_product", "wireless keyboard",
start => 0,
limit => 20,
jnktype => 'A'
);
# 2. Search entire archive including passive/discontinued items
my ($all_count, @archive_results) = $adb->search_table(
"catalog_product", "wireless keyboard",
start => 0,
limit => 20,
jnktype => 'AB'
);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