GUN is a JavaScript graph database protocol for realtime peer-to-peer sync, offline-first use, and end-to-end encryption. npm install gun gets a small embedded engine for browser and Node.
Overview
GUN is an ecosystem for building community-run, encrypted applications with decentralized graph data. It advertises multiplayer-by-default realtime peer-to-peer state sync, flexible graph models spanning key-value, tables, documents, and media, and local-first offline operation with optional end-to-end encryption.
The core is a graph synchronization protocol with a lightweight embedded engine sized for browser use. Documentation points to modular pieces for CRDT conflict handling, cryptographic auth, mesh networking, and storage. Production use is claimed by the Internet Archive and many other projects, with examples spanning chat, social, and media-style apps.
Developers typically start from an interactive browser tutorial or by installing the gun package on npm and running bundled examples. SEA modules add user authentication; Node and React Native need WebCrypto shims such as @peculiar/webcrypto. Integrations are documented for Electron, React Native, Vue, Svelte, web components, and GraphQL among others.
Relay peers can be deployed on Linux via install scripts, Docker images, Heroku, Dome, or Zeet.co so clients can discover each other. Environment variables configure HTTPS certificates and ports. AXE clustering into a shared DHT is mentioned as a default behavior users may disable for isolated networks.
Key features
- Realtime P2P graph synchronization
- Offline-first local data
- End-to-end encryption support
- CRDT-based conflict resolution
- Browser and Node.js usage
- SEA cryptographic user auth
- Relay peer deployment options
- Graph, document, and key-value models
Use cases
- Decentralized realtime applications
- Offline-capable collaborative apps
- Encrypted community platforms
- Browser-based P2P data layers
- Self-hosted GUN relay networks
Does the same job as
GUN doesn't name these products itself, but its own description shows it does the same job.