v0.7.0

Getting Started

Last updated


This page lists what ToriiDB needs, how to install the module, and which entry point to open a data directory with.

Requirements


RequirementVersion or purpose
Go1.25 or later (from go.mod)
OSUnix-like system with unix domain sockets (the daemon listens under /tmp)
Writable directoryHolds db_N/ snapshot and log files
OPENAI_API_KEYOptional; needed only for vector operations

Install the Module


  1. go get github.com/pardnchiu/toriidb

Or clone and build:
  1. git clone https://github.com/pardnchiu/toriidb
  2. cd toriidb
  3. go build ./...

Choose an Entry Point


SituationEntry pointGuide
More than one process may open the same directorydaemon.NewQuick Start: Socket Daemon
One process owns the directorystore.NewQuick Start: Embedded Store
Try commands interactivelygo run cmd/test/main.goQuick Start: REPL

ToriiDB sits next to other embedded Go stores rather than replacing them. bbolt (an embedded key/value database for Go) and Badger (a fast key-value DB in Go) store keys and values as byte slices; ToriiDB detects each value's type, reads and writes nested JSON fields by dot path, and filters documents with QUERY expressions. chromem-go is an embeddable vector database for Go with a Chroma-like interface, in-memory with optional persistence; in ToriiDB a vector is attached to an ordinary key, embedded with OpenAI text-embedding-3-small, ranked by cosine similarity with VSEARCH, and every write is appended to an fsynced log. The socket daemon lets several processes share one data directory through a single unix socket. rosedb is a key/value storage engine based on Bitcask, and NutsDB is a persistent key/value store with serializable transactions and list, set, and sorted set structures. BuntDB and FlashDB are in-memory key/value databases: BuntDB adds custom indexing and geospatial support, FlashDB offers Redis-like commands. SugarDB has the opposite shape, an embeddable and distributed in-memory store that can run as a cluster; ToriiDB stays on one machine, and its daemon serves local processes over a unix socket rather than a network port.

中文