sorted-blocks
TypeScript icon, indicating that this package has built-in type declarations

0.0.12 • Public • Published

SortedBlocks

It is a append-only data structure used in conjunction with custom blocks to persist data on underlying store.

  1. Can be used to create embeded database.
  2. Lock free data structure for reading and writting.
  3. Supports multiple writers without sync, cause of its append nature.
  4. Supports Multi version concurrency.(M.V.C.C)
  5. Supports custom blocks.
  6. Supports consolidation or defrag of store.
  7. Upcoming support for indexing for faster reads.
  8. Out of box support for local caching.

Binary Block Format

This is the format used to append blocks in the store, where each block is formatted as follows.

Block-Body
Byte[] <4294967295Bytes
Index 0 in on LHS
Block-Header
Byte[] <4294967295Bytes
Index 0 in on LHS
Block-Header-Length
UInt32BE 4Bytes
Block-Body-Length
UInt32BE 4Bytes
Block-Type
UInt32BE 4Bytes
Preamble-CRC-16
UInt16BE 2Bytes
Preamble-CRC-16
UInt16BE 2Bytes
SOB
0x23,0x21(#!) 2Bytes
Index 0 in on RHS

Package Sidebar

Install

npm i sorted-blocks

Weekly Downloads

3

Version

0.0.12

License

SEE LICENSE IN license.md

Unpacked Size

32 kB

Total Files

21

Last publish

Collaborators

  • lragji