[go: up one dir, main page]

DBDB.io The Encyclopedia of Database Systems · Est. 2017
Database of Databases

Database Entry

GUN: Version Comparison


Logo v1 logo v2 logo
Description
Gun is an open-source and realtime, decentralized, offline-first, graph database engine written in JavaScript. It is a distributed system for synchronizing data across web applications and devices.
  1. https://github.com/amark/gun
Gun is an open-source and realtime, decentralized, offline-first, graph database engine written in JavaScript. It is a distributed system for synchronizing data across web applications and devices.
  1. https://github.com/amark/gun
History
Gun was built by Mark Nadal in 2014. He four years researching scaling up his web application, and eventually he found out it was hard with traditional databases. He then created a peer-to-peer database that can run in web browsers.
  1. https://github.com/amark/gun
Gun was built by Mark Nadal in 2014. He four years researching scaling up his web application, and eventually he found out it was hard with traditional databases. He then created a peer-to-peer database that can run in web browsers.
  1. https://github.com/amark/gun
Start Year 2014
  1. https://github.com/amark/gun/commit/f4285a7328304f0e7bdcab56a36264e8b41cb9cc
2014
  1. https://github.com/amark/gun/commit/f4285a7328304f0e7bdcab56a36264e8b41cb9cc
End Year
Twitter URL @marknadal
Countries United States of America United States of America
Former Names
Website URL http://gun.js.org http://gun.js.org
Docs URL https://gun.eco/docs https://gun.eco/docs
Source Repo URL https://github.com/amark/gun https://github.com/amark/gun
Blog URL
Wikipedia URL
Tags
Licenses
Apache v2
Apache v2
Operating Systems
Linux
Linux
Governance
Project Types
Commercial Open Source
CommercialOpen Source
Supported Languages
JavaScript
JavaScript
Written In
JavaScript
JavaScript
Coding Agents
Developer Orgs
Mark Nadal
Mark Nadal
Derived From
Embedded Systems
Inspired By
Compatible With
Hosted Services
Acquisitions
Checkpoints
Not Supported
Gun does not support for checkpoints by default. But users may use third party adapters as the persistent layer like Amazon S3 to achieve checkpointing.
  1. https://gun.eco/docs/Storage
Not Supported
Gun does not support for checkpoints by default. But users may use third party adapters as the persistent layer like Amazon S3 to achieve checkpointing.
  1. https://gun.eco/docs/Storage
Compression
Prefix Compression
Gun uses radix tree to store user data in memory, and the Radisk is what the project team have designed for it to persist storage in Radix Tree by default. Gun also supports self-implemented or third-party persistent storage like Amazon S3, so data compression can be done outside of Gun.
  1. https://gun.eco/docs/Radisk
Prefix Compression
Gun uses radix tree to store user data in memory, and the Radisk is what the project team have designed for it to persist storage in Radix Tree by default. Gun also supports self-implemented or third-party persistent storage like Amazon S3, so data compression can be done outside of Gun.
  1. https://gun.eco/docs/Radisk
Concurrency Control
Optimistic Concurrency Control (OCC)
Gun is a offline-first database engine and uses eventual consistency. It allows users to view and update data when it is offline, and data will be synchronized when it is online. Gun uses a self-designed conflict resolution algorithm, Hypothetical Amnesia Machine (HAM), which combines timestamps and vector clocks to resolve conflicts and order data.
  1. https://github.com/amark/gun/wiki/Conflict-Resolution-with-Guns
Optimistic Concurrency Control (OCC)
Gun is a offline-first database engine and uses eventual consistency. It allows users to view and update data when it is offline, and data will be synchronized when it is online. Gun uses a self-designed conflict resolution algorithm, Hypothetical Amnesia Machine (HAM), which combines timestamps and vector clocks to resolve conflicts and order data.
  1. https://github.com/amark/gun/wiki/Conflict-Resolution-with-Guns
Data Model
Graph
Gun uses graph to represent data and data relations. A logical graph in Gun is denormalized into a subset of JSON files.
  1. https://gun.eco/docs/Simple-introduction-to-graph-data-structures
Graph
Gun uses graph to represent data and data relations. A logical graph in Gun is denormalized into a subset of JSON files.
  1. https://gun.eco/docs/Simple-introduction-to-graph-data-structures
Foreign Keys
Not Supported
Gun is a NoSQL database without foreign keys support.
Not Supported
Gun is a NoSQL database without foreign keys support.
Hardware Acceleration
Indexes
Patricia/Radix Trie
By default, Gun uses the Radisk Storage Engine as an in-memory and on-disk radix tree to store user data. Gun supports some existing persistent storage services like Amazon S3 to be plugged in, and also offers interfaces for developers to build persistent layer for it, so indexing can be flexible.
  1. https://github.com/amark/gun/wiki/Radisk
  2. https://gun.eco/docs/Storage
Patricia/Radix Trie
By default, Gun uses the Radisk Storage Engine as an in-memory and on-disk radix tree to store user data. Gun supports some existing persistent storage services like Amazon S3 to be plugged in, and also offers interfaces for developers to build persistent layer for it, so indexing can be flexible.
  1. https://github.com/amark/gun/wiki/Radisk
  2. https://gun.eco/docs/Storage
Isolation Levels
Snapshot Isolation
Gun allows offline usage and synchronizes data when online with eventual consistency. Each user has their own copy of data when using. Conflicts are handled by Hypothetical Amnesia Machine (HAM) when presented during synchronization.
Snapshot Isolation
Gun allows offline usage and synchronizes data when online with eventual consistency. Each user has their own copy of data when using. Conflicts are handled by Hypothetical Amnesia Machine (HAM) when presented during synchronization.
Joins
Not Supported
Gun is a NoSQL database without join operations support.
Not Supported
Gun is a NoSQL database without join operations support.
Logging
Not Supported
Not supported
Not Supported
Not supported
Parallel Execution
Query Compilation
Query Execution
Query Interface
Custom API
Gun provides custom API for query interfaces. Some other choices are also available including GraphQL and SPARQL.
  1. https://gun.eco/docs/API
Custom API
Gun provides custom API for query interfaces. Some other choices are also available including GraphQL and SPARQL.
  1. https://gun.eco/docs/API
Storage Architecture
Disk-oriented In-Memory
Gun supports both the disk-oriented and in-memory mode. It is offline-first database where browser asks peers for data to use in memory and browser local storage the most often as cache. By default, Gun has a built-in persistent storage layer called Radix. One can also configure Gun to store data in third-party persistent service (e.g., Amazon S3, LevelDB, MongoDB, Cassandra).
  1. https://gun.eco/docs/Storage
Disk-orientedIn-Memory
Gun supports both the disk-oriented and in-memory mode. It is offline-first database where browser asks peers for data to use in memory and browser local storage the most often as cache. By default, Gun has a built-in persistent storage layer called Radix. One can also configure Gun to store data in third-party persistent service (e.g., Amazon S3, LevelDB, MongoDB, Cassandra).
  1. https://gun.eco/docs/Storage
Storage Format
Storage Model
N-ary Storage Model (Row/Record)
Gun stores records in JSON files. Data and relations are represented as a graph. Records are connected by references, called “souls” internally in Gun. Some official and simple queries similar in SQL are implemented with paths traversing. Complex operations among relations can be easily extended on graph.
  1. https://gun.eco/docs/Storage
N-ary Storage Model (Row/Record)
Gun stores records in JSON files. Data and relations are represented as a graph. Records are connected by references, called “souls” internally in Gun. Some official and simple queries similar in SQL are implemented with paths traversing. Complex operations among relations can be easily extended on graph.
  1. https://gun.eco/docs/Storage
Storage Organization
Stored Procedures
Not Supported
Gun is a NoSQL database without stored procedures support.
Not Supported
Gun is a NoSQL database without stored procedures support.
System Architecture
Shared-Everything
In Gun, every node utilizes its own memory space and shares the persistent storage with the other peers. Gun implements its own transport layer protocol for P2P networking, Daisy-chain Ad-hoc Mesh-network (DAM). The ad hoc mesh network is used to coordinate with peers by messaging without producing too many duplicate rebroadcasting messages.
Shared-Everything
In Gun, every node utilizes its own memory space and shares the persistent storage with the other peers. Gun implements its own transport layer protocol for P2P networking, Daisy-chain Ad-hoc Mesh-network (DAM). The ad hoc mesh network is used to coordinate with peers by messaging without producing too many duplicate rebroadcasting messages.
Views
Not Supported
Gun is a NoSQL database without views support.
Not Supported
Gun is a NoSQL database without views support.