Skip to content

Libraries

Autobee

A separate experimental multi-writer Hyperbee implementation.

Verified 19 October 2026

Explore the deferred multi-writer scaffold for an app-owned shared key-value view.

Status in Unstoppable Stack

Autobee and Autobase have different APIs. The multi-writer scaffold cannot be combined with node-sync.

How it works

Autobee merges writer operations into a Hyperbee-style view. Applications append operations rather than writing directly into the read view.

The example appends one key-value operation and applies it through a write batch. It demonstrates the local reducer API, not a multi-device acceptance test.

Autobee is a separate implementation from Autobase. The experimental scaffold uses Autobee; the P2P /db prototype uses Autobase.

Run an example

Use Node 22.17+ and npm for installation. Start in a new directory for this example so its ./data storage cannot collide with another example. Save each file below with the exact filename shown, then run the commands in order.

bash
mkdir autobee-demo
cd autobee-demo
npm init -y
npm install autobee@'1.0.10' corestore@'^7.13.0'

Save as example.mjs:

js
import Autobee from 'autobee'
import Corestore from 'corestore'
const store = new Corestore('./data')
const db = new Autobee(store, null, {
  async apply (nodes, view) {
    const batch = view.write()
    for (const node of nodes) {
      if (node.value === null) continue
      const op = JSON.parse(node.value.toString())
      batch.tryPut(Buffer.from(op.key), Buffer.from(op.text))
    }
    await batch.flush()
  }
})
try {
  await db.ready()
  await db.append(Buffer.from(JSON.stringify({ key: 'welcome', text: 'Hello merged view' })))
  await db.update()
  console.log((await db.view.get(Buffer.from('welcome'))).value.toString())
} finally {
  await db.close()
  await store.close()
}

Run from this example directory:

bash
node example.mjs

Expected result

Hello merged view

Example verification

The code shown here ran successfully in a local check on 19 October 2026. This verifies the small example, not production readiness, public-network reachability or every platform.

API essentials

  • new Autobee(store, key, { apply }): create or join a dataset with an application reducer.
  • append(bytes), update(), view.get(key): append an operation, update the view and read its value. Keys and values in this example are byte buffers.
  • Inside apply: view.write(), batch.tryPut(), batch.flush(). This is not the ordinary Hyperbee put() API.

Troubleshooting and limits

  • A joining peer starts read-only until admitted as a writer. The local writer key and dataset key have different roles.
  • Do not use the multi-writer scaffold with node-sync; that resource graph is not supported.
  • Use the version in the compatibility profile. Experimental API updates require deliberate review.

Next steps

Need help? Report an issue with your CLI version, platform, command and first relevant error.