Configs2026年5月30日·1 分钟阅读

TinyBase — Reactive Data Store and Sync Engine

A tiny, reactive data store for structured data with built-in indexing, relationships, queries, and real-time synchronization across tabs, workers, and servers.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
TinyBase
直接安装命令
npx -y tokrepo@latest install 7af6512c-5c65-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

TinyBase is a reactive client-side data store that organizes data into tables, rows, and cells with built-in indexing, relationships, and queries. It also provides a sync engine for real-time collaboration across browser tabs, web workers, and remote servers.

What TinyBase Does

  • Stores structured data in tables with typed cells and reactive listeners
  • Creates indexes, relationships, and computed queries over stored data
  • Synchronizes state across browser tabs, workers, CRDT merges, and remote servers
  • Provides React bindings with hooks for every store, table, row, and cell
  • Persists data to localStorage, IndexedDB, SQLite, or custom backends

Architecture Overview

TinyBase models data as a hierarchical store of tables, rows, and cells. Each mutation fires granular listeners at the cell, row, table, or store level, enabling fine-grained React re-renders. The Indexes, Relationships, and Queries modules layer SQL-like operations on top of this store. The MergeableStore variant uses CRDTs for conflict-free multi-device sync, and Persisters handle reading from and writing to storage backends.

Self-Hosting & Configuration

  • Install via npm: npm install tinybase
  • Create a store with createStore() and set data with setCell or setRow
  • Add React bindings via tinybase/ui-react hooks like useCell and useTable
  • Configure persistence with a Persister for localStorage, IndexedDB, or SQLite
  • Enable sync by creating a MergeableStore and connecting a Synchronizer

Key Features

  • Granular reactive listeners at cell, row, table, and store levels
  • Built-in indexes for fast lookups and relationships between tables
  • CRDT-based MergeableStore for conflict-free real-time sync
  • Multiple Persister backends: localStorage, IndexedDB, SQLite, custom
  • Tiny core at under 5 KB gzipped with tree-shakable modules

Comparison with Similar Tools

  • Zustand — global state management without structure; TinyBase adds tables, indexes, and sync
  • Jotai — atomic state primitives; TinyBase provides relational structure and persistence
  • RxDB — reactive database with replication; TinyBase is smaller and simpler to set up
  • Replicache — sync framework for offline-first apps; TinyBase is self-contained with built-in CRDTs
  • Dexie.js — IndexedDB wrapper; TinyBase adds reactivity, relationships, and sync on top of storage

FAQ

Q: Is TinyBase a database? A: It is a reactive data store, not a traditional database. It can persist to databases like SQLite but runs in-memory in the client.

Q: Can it sync between devices? A: Yes. The MergeableStore uses CRDTs for conflict-free sync, and Synchronizers connect to WebSocket or PartyKit servers.

Q: Does it work with React? A: Yes. The tinybase/ui-react module provides hooks for every level of the store hierarchy.

Q: How large is the bundle? A: The core store is under 5 KB gzipped. Additional modules (queries, sync, persisters) are tree-shakable.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产