Skip to main content

ECHO Database

About 2 min

ECHO Database

ECHO (The Eventually Consistent Hierarhical Object store) is a peer-to-peer graph database written in TypeScript.

  • Secure, P2P data replication based on CRDTsopen in new window.
  • No servers or central authority, all the data is with the clients.
  • Connectivity with peers via WebRTCopen in new window.
  • Support for multiple concurrent writers.
  • Collaboration on key-value objects and text.
  • Support for offline writes and conflict resolution when peers rejoin the network.

Tell us what you think

Join our Discordopen in new window and talk to us about the kind of database you are looking for.

Spaces

Spaces are units of sharing and access control in ECHO. They are equivalent to "collections" in a document store.

A space is an instance of an ECHO database which can be replicated by a number of peers.

A given peer is typically a part of many spaces at any given time.

There are several steps to establishing a space between peers:

  1. Peer A listens on the peer network for peers intereseted in a specific invite code it generated.
  2. Peer B obtains the invite code and locates the listening Peer A via the signaling network.
  3. Peer A and Peer B establish a secure connection via Diffie Hellmannopen in new window key exchange.
  4. Peer A generates an authorization code and sends it to Peer B via another safe channel (i.e.: shows a QR code).
  5. Finally, Peer B provides the authorization code back to Peer A over the new connection.

This verifies that the connection is secure, and the identities of peers are mutually confirmed.

Tip

If you're using react, DXOS provides a simple UI flow that implements generating and accepting invitations to spaces.

Next steps:

Objects

Units of data are referred to as objects (like documents or rows in other databases). Objects always belong to a space. Objects can have fields with values, and weak references to other objects to form trees or graphs.

Glossary

See the glossary for definitions of other terms you'll find in this guide.

How to use ECHO

ECHO and HALO

ECHO is designed to allow users to retain control over their data. ECHO is a secure storage mechanism, responsible for holding end-user data and identity information (keys, credentials, metadata, ..., etc.) in persistent browser or filesystem storage. Specific devices can be revoked from accessing user data at any time.

In order to allow multiple applications to access the same ECHO database, the user must initiate a device invitation, which synchronizes ECHO across both applications, giving them both read and write access to all of the user's data stored in their ECHO. See Device Invitations for more information.

For Node.js applications, the ECHO database is implemented as an in-process storage engine that persists to files on disk.

Next steps