r/perl 6d ago

AmberDB - High-performance Berkeley DB (DB_File) based pure Perl database engine

https://metacpan.org/dist/AmberDB

I have released **AmberDB**, the Perl database engine I have built and refined over 20+ years of professional software development, as an open-source project. You can access the project on GitHub and CPAN via the links below.

Why Did I Share AmberDB?

My primary goal is to make this practical and powerful engine accessible to the wider developer community. I had intended to open-source it for a long time; with comprehensive use cases, full documentation in both English and Turkish, and detailed POD documentation now complete, it is ready for production use.

---

Why Should You Use AmberDB?

1) Zero Dependencies, Maximum Developer Ergonomics

No dedicated database servers, daemon processes, or port configurations required. Install the module from CPAN anywhere Perl runs and start developing immediately. You can run it entirely in memory using `tmpfs` on Linux or `ImDisk` on Windows, or use it directly on-disk. It operates with a minimal system footprint.

2) PostgreSQL + Elasticsearch + Redis Capabilities in a Single Core

Combines relational querying flexibility, search-engine-grade filtering and ranking, and Redis-like in-memory operational speeds within a single lightweight engine. Eliminates the operational overhead and hosting costs of managing three separate infrastructure layers.

3) Variable-Width Records and Native Array Indexing

Avoids the traditional SQL constraint of splitting order headers and line items into separate tables requiring costly joins. Variable-length line items are stored directly within the primary record and indexed at the engine level with $O(1)$ efficiency. Queries such as *"Which orders contain this product?"* resolve instantly without multi-table scans.

4) Intelligent Schema Architecture and Multi-Criteria Active/Junk Handling

Every table operates on a declarative, JSON-like schema specification where business rules are enforced by the engine. The engine determines whether a record is active or passive (junk) based on multi-factor rules (stock, price, status, or parent entity constraints). For example, disabling a vendor automatically routes hundreds of thousands of associated items without requiring batch `UPDATE` operations:

* `A` Mode: Retrieves active records only (ideal for checkout and invoicing views).

* `AB` Mode: Ranks active records first, pushing junk records to the end (ideal for storefront search).

* `B` / `BA` Modes: Retrieves only junk records or prioritizes them (ideal for returns, archives, and clearance management).

5) Multi-Lingual and Accent-Folded Search with `AmberDB::Locale`

Normalizes complex language and accent variants directly within the indexing pipeline without requiring external system locales or heavy search stacks. Delivers precise phonetic and typographic matching across languages, including Turkish (`İ/i`, `I/ı`), German (`ß`, `ö/ä/ü`), French (`é`, `ç`), Spanish (`ñ`), and Azerbaijani (`ə`, `x`, `ğ`).

6) Schema-Level Automated Slug Generation (SEO)

Generates clean, search-engine-friendly URL slugs automatically upon insertion or update using a simple schema rule (e.g., `seo_block => [ 3, 4 ]`), fully synchronized with `AmberDB::Locale` without extra application-layer boilerplate.

AmberDB on CPAN

29 Upvotes

10 comments sorted by

3

u/Early-Bid-7958 2d ago

why does the readme have so many emojis? I understand you've been developing this script for many many years so I am pretty sure it is not AI-assisted (or worse), but people now associate excessive emoji use to that

0

u/marufcetin 1d ago

You can imagine how tedious it is to create documentation for developers. I also used AI for documentation creation. However, it always makes a lot of mistakes. I used Gemini AI Ultra, and when creating the documentation, it describes imaginary functions that resemble SQL commands and have nothing to do with AmberDB.

I suggest you take a look. The idea and code behind AmberDB are original.

1

u/Early-Bid-7958 19h ago

regardless, if I were you I'd remove the emojis or tell the AI to not put them.

I admit I'm beyond 60, so that that into consideration, but they not only do not add value, they're distracting.

1

u/tarje 15h ago

You developed this over 20 years, but didn't document it until you released it 20 years later?

2

u/scottchiefbaker 🐪 cpan author 1d ago

Why BerkleyDB based? I haven't heard that name in 15+ years. What does this do that SQLite doesn't do? SQLite is quite battle tested at this point, AmberDB not so much.

1

u/marufcetin 23h ago

BerkeleyDB (DB_File) is a key-value database written in C code and included in the standard Perl package. For BerkeleyDB, the cost of reading a record among millions of records is zero. BerkeleyDB is very fast, but because it's a low-level engine, it's difficult to perform complex tasks with it.

AmberDB, on the other hand, creates a wrapper on top of BerkeleyDB and provides custom indexing. This makes advanced applications easier. It solves the problem of searching, querying, listing, sorting, and filtering millions of records at near-zero cost.

AmberDB can provide an experience similar to PostgreSQL + ElasticSearch + Redis, but its installation and cost are much lower.

You're right that AmberDB isn't well-known or recognized. Because I've released a 20+ year professional project as open source for the first time. Please review the documentation on Github and the Wiki section.

1

u/DecalageVersLeRouge 6d ago

Looks really interesting. I'll ask what I always ask—what's the story behind the name?

3

u/marufcetin 6d ago

Amber is a precious, mystical, and mysterious stone. The same word with the same meaning is used in English, Turkish, and Arabic.

1

u/DecalageVersLeRouge 11h ago

I'm glad this got reinstated.

I can see the "broken" Markdown now, you've tried to use the Reddit rich text editor manually in a couple of places.