Easiest Database Ever

Try it now

var gun = Gun('https://gunjs.herokuapp.com/gun');
gun.get('example/tutorial').put({hello: "world"});
In this 1 minute tutorial, we will connect to a gun peer, create an object, and sync data in realtime.
var ref = gun.get('example/tutorial');
Congratulations! You just referenced an object and saved data to it. In two tabs, we'll load that reference and sync data between them.
https://gunjs.herokuapp.com/ x
https://gunjs.herokuapp.com/ x
Let's update the "hello" field with a different value. We can get any field on the object, and update it directly.


It may be trivial to get realtime updates with socket.io or something, but what you do not get is state synchronization. GUN does this for you out of the box, assuring that two users' simultaneous updates won't concurrently break each other.


GUN is peer-to-peer by design, meaning you have no centralized database server to maintain or that could crash. This lets you sleep through the night without worrying about database DevOps - we call this "NoDB". From that, you can build decentralized, federated, or centralized apps.


GUN works even if your internet or cell reception doesn't. Users can still plug away and save data as normal, and then when the network comes back online GUN will automatically synchronize all the changes and handle any conflicts for you.


Most databases force you to bend over backwards to match their storage constraints. But graphs are different, they let you have any data structure you want. Whether that be traditional tables with relations, document oriented trees, or tons of circular references. You choose.


Are you currently working on a project using GUN or perhaps you would like more information before you make up your mind.

We always love to be in touch with our community and listen about what you're working on and maybe we can give you a hand. Click the button below and talk to us on Gitter!


Gun constructor

Used to creates a new gun database instance.

Read more


Save data into gun, syncing it with your connected peers.

Read more


Load all data under a key into the context.

Read more


Move up to the parent context on the chain.

Read more


Change the database options.

Read more


Navigate through a node's properties

Read more


Subscribe to realtime updated changes on a node or property.

Read more


Read a full object without subscribing updates.

Read more


Add a unique item to an unordered list.

Read more


Loop over each property in a node, and subscribe to future changes. It's essentially performing a .path on each field.

Read more


Handle cases where data can't be found.

Read more

Interactive explainers

Databases can be scary, which is why we are making a series of explainers to educate everyone. Young or old, our goal is to show you that these ideas are actually simple.


Our GUN community is working on great projects here are the promising ones.