# prolly-trees

> Implementation of [peer-to-peer b-trees](https://0fps.net/2020/12/19/peer-to-peer-ordered-search-indexes/) which are [prolly trees](https://www.dolthub.com/blog/2020-04-01-how-dolt-stores-table-data/) as used in dolt and noms.

Latest version **1.0.4** (published 2023-04-08) · (Apache-2.0 AND MIT) license · 0 weekly downloads

## Install

```sh
npm install prolly-trees
pnpm add prolly-trees
yarn add prolly-trees
bun add prolly-trees
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2023-04-08 |
| First published | 2022-05-03 |
| Weekly downloads | 0 |
| License | (Apache-2.0 AND MIT) |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 397.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mikeal Rogers |
| Maintainers | mikeal |

## Links

- npm: https://www.npmjs.com/package/prolly-trees
- Repository: https://github.com/mikeal/prolly-trees
- Homepage: https://github.com/mikeal/prolly-trees#readme
- Issues: https://github.com/mikeal/prolly-trees/issues
- npm.io page: https://npm.io/package/prolly-trees

## Dependencies (2)

- [bl](https://npm.io/package/bl.md) ^4.0.3
- [node-sql-parser](https://npm.io/package/node-sql-parser.md) ^3.1.0

## Recent versions

- 1.0.4 (latest) — 2023-04-08
- 1.0.3 — 2023-04-03
- 1.0.2 — 2023-03-31
- 1.0.1 — 2023-03-27
- 1.0.0 — 2023-03-24
- 0.2.6 — 2023-03-15
- 0.2.5 — 2023-03-12
- 0.2.4 — 2023-03-03
- 0.2.3 — 2023-03-03
- 0.2.2 — 2023-02-24
- 0.2.1 — 2023-02-24
- 0.2.0 — 2022-11-07
- 0.1.0 — 2022-11-07
- 0.0.1 — 2022-05-03
- 0.0.0 — 2022-05-03
- … 1 more at https://npm.io/package/prolly-trees/versions

## README

# Prolly Trees

Implementation of [peer-to-peer search trees](https://0fps.net/2020/12/19/peer-to-peer-ordered-search-indexes/) [(probabalistic b-trees trees)](https://www.dolthub.com/blog/2020-04-01-how-dolt-stores-table-data/) as
used in [dolt](https://www.github.com/dolthub/dolt) and [noms](https://www.github.com/attic-labs/noms).

While this library has 100% test coverage and is relatively stable, it's
not recommended for broad use. The implementation internals are all very
exposed and have not been properly documented. Without thorough documentation
there's a lot of mistakes consumers will make regarding caching and block
storage.

Some time in the near future I will fully document the library.

# Notes

This is *just* an implementation of the trees. It does not have an opinion about
how blocks are encoded and hashed. The tests use a `dag-cbor` IPLD encoder, and
the library is typically encoded into IPLD in other libraries.

## ranges

Range queries match `>=` the `start` key and `<` the `end` key.

In other words, ranges do not include matches against the end key
but do match against the start key. This is so that more advanced
range queries can be built with only appending to keys rather than
needing to do more advanced key modifications to reduce the closing
match.

---
_Source: https://npm.io/package/prolly-trees · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
