8000 GitHub - goatplatform/goatdb: An Embedded, Distributed, Document DB
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

goatplatform/goatdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 

Repository files navigation

GoatDB Logo


GoatDB: Embedded, Distributed, Document Database

šŸ“š Documentation • ⚔ Benchmarks • šŸ’¬ Discussions • šŸ‘‹ Discord

GoatDB is an embedded, distributed, document database that prioritizes speed and developer experience. It excels at real-time collaboration and embedded caching applications.

Instead of following traditional database design patterns, GoatDB leverages concepts refined over decades by distributed version control systems. These are enhanced with novel algorithms for efficient synchronization and automatic real-time conflict resolution.

Currently optimized for TypeScript environments, GoatDB functions as a first-class citizen in both browsers and servers. It utilizes a document model with schemas, providing causal eventual consistency to simplify development while offering built-in optional cryptographic signing for the underly C837 ing commit graph.

What makes GoatDB different?

GoatDB is under active development. If you're interested in a new approach to distributed data, we invite you to explore further and contribute. And please, star ā­ļø our project. We really appreciate it! šŸ™

Warning

Please keep in mind that GoatDB is still under active development and therefore full backward compatibility is not guaranteed before reaching v1.0.0. For more details, see the FAQ.

Quick Start

Install in Deno (recommended):

deno add jsr:@goatdb/goatdb

Basic Usage

import { GoatDB } from '@goatdb/goatdb';
const db = new GoatDB({ path: './data', peers: ['http://10.0.0.1'] });
const item = db.create('/todos', { text: 'Hello, GoatDB!', done: false });
item.set('done', true);

React Hooks

GoatDB provides a set of ergonomic React hooks for building real-time, offline-capable UIs with minimal boilerplate. These hooks offer a complete state management solution for React apps—handling database initialization, loading state, live queries, and item updates—all with automatic synchronization and efficient reactivity. Hooks like useDB, useDBReady, useQuery, and useItem make it easy to manage your application's data layer. See the Concepts and Reading and Writing Data docs for more background.

Example:

function TaskList() {
  const tasks = useQuery({
    schema: taskSchema, // see https://goatdb.dev/schema/
    source: '/tasks',
    predicate: (item) => !item.get('done'), // see https://goatdb.dev/query/
  });
  return (
    <ul>
      {tasks.results().map((task) => (
        <li key={task.path}>
          <TaskEditor path={task.path} />
        </li>
      ))}
    </ul>
  );
}

function TaskEditor({ path }) {
  const task = useItem(path, { keys: ['text', 'done'] }); // see https://goatdb.dev/read-write-data/
  if (!task) return <span>Loading...</span>;
  return (
    <input
      value={task.get('text')}
      onChange={(e) => task.set('text', e.target.value)}
    />
  );
}

For details and examples, see the React documentation.

For full installation and usage details, see the installation guide and tutorial.

Contributing

GoatDB is open source under the Apache 2.0 license. We welcome issues, discussions, and pull requests. To get started:

  1. Fork the repository
  2. Create a branch for your changes
  3. Submit a pull request

For local development, you can link GoatDB into your project:

deno run -A jsr:@goatdb/goatdb/link link ./path/to/goatdb

To unlink GoatDB, run:

deno run -A jsr:@goatdb/goatdb/link unlink

License

GoatDB is licensed under the Apache 2.0 License.

0