-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Introduction
GUN is a small, easy, and fast data sync and storage system that runs everywhere JavaScript does. The aim of GUN is to let you focus on the data that needs to stored, loaded, and shared in your app without worrying about servers, network calls, databases, or tracking offline changes or concurrency conflicts. This lets you build cool apps fast, like:
When a browser peer sends a request, it'll merge the response with its own data using our graph-based CRDT conflict resolution algorithm, then cache the result. Since it's cached in the browser, there are a few interesting side effects:
- The next time the browser sends that request, the response is instantaneous, even when offline.
- Data is replicated on each browser that requested it.
- If your server catastrophically fails, you can still recover your data from the browsers.
This makes the loss of important information nearly impossible, as all copies of the data must be destroyed for it to be unrecoverable. A server is also just a peer, but isn't as picky about what they cache.
GUN is peer-to-peer (multi-master decentralized replication), meaning updates do not need a centralized server. You save data on one machine, and you can sync it with other peers without needing a complex consensus systems. It just works.
However, you do not need peers or servers to use GUN, they're completely additive!