Giter Site home page Giter Site logo

cbdb's Introduction

cbdb

Status: this repo contains several EXPERIMENTS that have been abandoned and/or backburnered in an unfinished (and undocumented) state. Feel free to use the issues tracker here for discussion, but what I ended up doing instead was rewriting Memcouch itself as a solution to the problems I was wrestling with.


cbdb helps you build auto-saving and auto-syncing JavaScript apps.

It is an in-memory "state container" (sort of like Redux or unistore) but designed to synchronize with a persistent and/or shared database (e.g. CouchDB or GraphQL) using an API adapter in the background.

UI ↔︎ (working copy) ↔︎ API

Data in a cbdb instance is tracked in a key-value fashion and can also be queried as an array. When data is changed, cbdb remembers the working copy and helps you eventually merge the work back into its primary source.

Example

This could be your app:

None of the core methods of cbdb are shown in this example! Those are boring.

import {SyncableStore} from 'cbdb';

const db = new SyncableStore();

leverages reselect or hooks

You can use it with PouchDB for "offline first" apps, or with CouchDB for "offline second" apps, or with any other server API that shares state changes.

Background

see memcouch

cbdb is short for Chair-Brain DB, which is short for a tangled web of puns involving:

  • chairs being single user couches
  • the fact that the animals with pouches lack a corpus callosum between the two halves of their brains
  • a hint of PEBKAC on my own part; the interfaces I build are supposed to handle conflicting edits and I/O errors but I am rarely that computer savvy

License

TODO: another distracting decision

cbdb's People

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.