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
| Requirement | Version or purpose |
|---|---|
| Go | 1.25 or later (from go.mod) |
| OS | Unix-like system with unix domain sockets (the daemon listens under /tmp) |
| Writable directory | Holds db_N/ snapshot and log files |
OPENAI_API_KEY | Optional; needed only for vector operations |
Install the Module
- go get github.com/pardnchiu/toriidb
Or clone and build:
- git clone https://github.com/pardnchiu/toriidb
- cd toriidb
- go build ./...
Choose an Entry Point
| Situation | Entry point | Guide |
|---|---|---|
| More than one process may open the same directory | daemon.New | Quick Start: Socket Daemon |
| One process owns the directory | store.New | Quick Start: Embedded Store |
| Try commands interactively | go run cmd/test/main.go | Quick 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.