-
Notifications
You must be signed in to change notification settings - Fork 0
Guide What is AmberDB
Turkce Dokumantasyon | English Documentation
Category: Getting Started & Fundamental Guides
Subsystem: Core Architecture (AmberDB)
Entry Type: Overview & Architectural Guide
AmberDB is a high-performance, schema-driven NoSQL document database engine designed from the ground up for Perl. Running on top of Berkeley DB (DB_File), it features precomputed inverted indexing, ACID transactions backed by Strict Two-Phase Locking (Strict 2PL), automatic crash recovery, and intelligent locale-aware full-text search.
First engineered in 2005 and modernized in 2026 for CPAN distribution, AmberDB is specifically optimized for e-commerce backends, product catalogs, CMS engines, high-traffic web applications, and concurrent data pipelines.
AmberDB's core philosophy is to eliminate external database servers (e.g., MySQL, PostgreSQL), TCP socket latency, complex SQL JOIN bottlenecks, and external search engine dependencies (e.g., Elasticsearch). By combining native Perl structures with embedded C-level Berkeley DB speed, AmberDB delivers an all-in-one data, search, filtering, faceting, and transaction engine within a single zero-daemon instance.
AmberDB Unified NoSQL Architecture
Application Layer (Web / REST API / Worker / CLI)
|
v
┌─────────────────────────────────────────────────────────────┐
│ AmberDB │
│ ┌─────────────────┐ ┌─────────────────┐ ┌────────────────┐ │
│ │ AmberDB::Base │ │ AmberDB::Index │ │AmberDB::Transact│ │
│ │ Schema & CRUD │ │ Binary Indexes │ │ ACID & 2PL │ │
│ └─────────────────┘ └─────────────────┘ └────────────────┘ │
│ ┌─────────────────┐ ┌─────────────────┐ ┌────────────────┐ │
│ │ AmberDB::Cache │ │ AmberDB::Locale │ │AmberDB::Tools │ │
│ │ RAM-Disk (tmpfs)│ │ 9 Locales & UCA │ │ Reindex/Vacuum │ │
│ └─────────────────┘ └─────────────────┘ └────────────────┘ │
└─────────────────────────────────────────────────────────────┘
|
v
Operating System Layer (DB_File Hash + POSIX flock + Page Cache)
|
v
Physical Storage (dbstore/tables/*.db, .inx, .fld, .src, .fac, .srt)
AmberDB provides a lightweight, dependency-free internal component ecosystem:
| Module | Core Responsibility |
|---|---|
AmberDB::Base |
Schema loading (.table, .dbase), path routing, data serialization, 0-index primary key enforcement, and core CRUD dispatching. |
AmberDB::Index |
8-byte packed binary indexes (.inx), inverted field matching (.fld), full-text search (.src), columnar facet navigation (.fac), and pre-sorted indexes (.srt). |
AmberDB::Transact |
ACID transaction lifecycle, disk-backed undo journaling (.txn), Strict 2PL multi-process locks, and automatic orphaned journal crash recovery (transact_recover). |
AmberDB::Cache |
OS-level RAM-Disk (tmpfs / ImDisk) shared memory caching (.cache), TTL expiration, and in-memory table mirroring. |
AmberDB::Locale |
Regional language engine supporting 9 locales (en, tr, de, fr, es, ja, ru, ar, az) with case folding, phonetic softening, accent expansion, and Unicode Collation (UCA). |
AmberDB::Array |
High-speed array manipulation primitives (sorted comparison, deduplication, slicing, crop). |
AmberDB::String |
String sanitization, HTML stripping, ASCII transliteration, and SEO URL slug generation. |
AmberDB::Date |
High-precision date/time calculations, epoch conversions, and localized date formatting. |
AmberDB::Tools |
Database maintenance, .amberdb native backup and restore, reindexing, vacuuming, and integrity verification. |
Replaces expensive relational SQL JOIN operations with extensible document blocks. Child rows (e.g., order line items, attribute matrices) are stored horizontally within the parent record and automatically indexed for fast retrieval.
Primary (.inx) and secondary indexes are formatted as 8-byte packed binary arrays (Q* / a8*). This minimizes memory consumption and enables LIMIT / OFFSET) using raw zero-copy substr slicing.
Multi-table operations are guarded by disk-backed undo journals (.txn) and Strict Two-Phase Locking (Strict 2PL). In the event of a process crash or power loss, orphaned journals are automatically rolled back in LIFO order upon the next access.
-
Pillar 1 (Continuous WAL Stream): Every
insert,modify, anddeleteis instantly appended to a daily audit trail atbackup/YYYY/YYYY-MM-DD.csv. - Pillar 2 (Portable .amberdb Archives): Compressed, SHA-256 verified database snapshots. Derived indexes are omitted to save storage and reconstructed deterministically on restore.
Advanced language handling with phonetic devoicing (b/d/g -> p/t/k), circumflex unfolding (â/î/û -> a/i/u), apostrophe stripping, and locale-aware casing provides search-engine quality querying out of the box.
High-frequency tables can be mirrored directly into an OS-level shared memory RAM-disk (tmpfs or ImDisk), delivering sub-microsecond
| Criteria | AmberDB | SQLite | Traditional SQL (MySQL / Pg) | External NoSQL (MongoDB, etc.) |
|---|---|---|---|---|
| Architecture | Embedded (Zero Daemon) | Embedded | External Service / TCP Socket | External Service / TCP Socket |
| Perl Integration | Native Perl (Zero Overhead) | DBI / DBD Layer | DBI / DBD Layer | JSON / BSON Driver |
| JOIN Overhead | Zero (JOIN-Free Blocks) | High (B-Tree Scans) | High (Disk/Memory JOINs) | Application-Level Stitching |
| Full-Text Search | Built-in (Locale & Accent) | Extension (FTS5) | External Engine / Fulltext | Built-in / External |
| Multi-Process Concurrency | High (flock + Page Cache) | Limited (Coarse File Lock) | Very High (MVCC) | Very High |
| Pagination Speed |
|
|
|
|
| Memory Footprint | Minimal (~2-5 MB) | Low (~5-10 MB) | High (>100-500 MB) | Very High (>500 MB - 1 GB) |
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