nomasystems/nbson
61.6
Adequate · 17 September 2026
1.2k
lines of production code
Erlang
primary language
1
measurement over time
What this system is
This system is an Erlang library for encoding and decoding BSON documents, designed for high-performance data serialization. It supports standard BSON types, including expanded 64-bit integer handling and binary vectors for AI/ML embeddings, while providing robust error handling and efficient binary construction. The library exposes a public API for converting between Erlang data structures and BSON binaries, with performance benchmarks maintained in a separate repository.
Features
Support for BSON Binary Vector Subtype 9 and expanded 64-bit integer handling
Users can now encode and decode dense numeric vectors (INT8, FLOAT32, and PACKED\_BIT) using the new Erlang tuple representations (e.g., \{vector, int8, \[...\]}\), enabling efficient storage for AI/ML embeddings. The library also expands the supported range for 64-bit integers to the full signed 64-bit range and introduces an explicit \{long, I64}\ tuple type for 64-bit integers. Additionally, the \nbson:lookup/2\ and \nbson:at/2\ helper functions have been removed from the public API, and the project has migrated its build configuration to use Gradualizer for type checking and updated dependency sources.
(repo-wide) · high confidence
Removals
Removal of nbson.hrl header file
The include/nbson.hrl file, which previously defined type aliases for nbson\_key, nbson\_value, document, and document\_path, has been removed from the project. Users relying on these specific type definitions via this header will need to adjust their code or source these types from alternative locations if they are still exported elsewhere.
include · high confidence
Removed local benchmark script in favor of external reference
The local \nbson\_BENCH\ escript, which previously performed encoding and decoding benchmarks comparing \nbson\ against \bson-erlang\, has been removed from the repository. This change aligns with the project's decision to link to the \nbson\_bench\ repository instead of hosting benchmark code locally, simplifying the project structure and centralizing performance testing.
bench · high confidence
Behavioural changes
Replaces legacy BSON encoder/decoder with new high-performance implementations and adds vector support
The library replaces the previous \nbson\_encode\ and \nbson\_decode\ modules with new \nbson\_encoder\ and \nbson\_decoder\ implementations, which significantly improve decoding performance and introduce support for encoding Erlang maps as BSON documents (in addition to the existing proplist support). The new encoder also adds an \encode\_to\_iodata/1\ function for more efficient binary construction. The public API in \nbson.erl\ has been updated to reflect these changes: \encode/1\ now returns \{ok, Binary}\ or \{error, Reason}\ instead of just \Binary\, and \decode/1\ returns \{ok, Document}\ or \{error, Reason}\ instead of a list. Additionally, a new \get/2\ function is provided for retrieving values from documents, and the library now supports encoding and decoding binary vectors (int8, float32, and packed bit) as a new value type.
src · high confidence
Test coverage
Expanded test coverage for BSON data types and error handling
Added a new Common Test suite \nbson\_monad\_errors\_SUITE\ to verify error handling for invalid BSON decoding and integer overflow during encoding. Updated the main \nbson\_SUITE\ to use the public \nbson\ facade instead of internal modules and expanded test cases to cover additional data types including compressed, encrypted, MD5, UUID, and function binaries, as well as explicit int64 encoding, proplists, iodata encoding, and various vector types.
test · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 62.
Lenses
- Code Health 92
- Architecture 69
- Maturity 51
- Readiness 61
- Security 100
Changes since last survey
- 28 commits — 18 feature/other, 10 fixes
By area
- (root) — 12 commits
- (repo) — 3 commits
- src/nbson.erl — 3 commits
- src/nbson_encoder.erl — 3 commits
- src/nbson_decode.erl — 2 commits
- src/nbson_decoder.erl — 2 commits
- .github/workflows — 1 commit
- bench/data — 1 commit
- test/nbson_SUITE.erl — 1 commit
Notable commits
- fix: Merge pull request #1 from nomasystems/fix/use_public_facade
- fix: Merge pull request #11 from nomasystems/fix/allow-obj-id-as-lists-first-element
- fix: fix(#13): data_compressed test failing (#14)
- fix: fix: Allow object_id as first element on lists
- fix: fix: Use public facade on test suite.
- fix: fix: adding a get method to publi facade
- fix: fix: decoding empty binary (#7)
- fix: fix: encode type spec. (#21)
- fix: fix: rebar3 format issue.
- fix: fix: some types (#10)
- change: Feature encode/decode maps instead proplists (#4)
- change: Feature: encoding proplists support (#6)
- change: Feature: monad like errors (#16)
- change: Initial commit
- change: Merge pull request #2 from nomasystems/perf/cstring_decode
- change: Refactor: decode performance (also some decoder specs) (#17)
- change: chore(#19): Link to nbson_bench instead of hosting the benchmarks (#20)
- change: chore: performance. encode_to_iodata (#27)
- change: chore: update dependencies refs (#12)
- change: feat: Allow explicit encoding of long integers (#23)
- …and 8 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
nomasystems/nbson was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 17 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 7aab5d1acf4703795b70d2db182bac7494973848 — the exact code this score is about.
- Scored under rubric-2026.09.12 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-f94092f054c1.