Data Storage

3Box FAQs on Data Storage

Where does 3Box store data?

3Box does not store data in a centralized database. Instead, all data is stored on IPFS in OrbitDB instances. IPFS is a peer to peer storage network and OrbitDB provides peer to peer databases on top. IPFS pubsub is used by OrbitDB peers to sync data across the network.

When a user arrives at an app that uses 3Box, a local OrbitDB/IPFS instance is generated in the browser. Upon instantiation, this node syncs any available user data from other peers on the network. When applications (via the user) make updates to the 3Box datastore, these changes occur locally, offline-first. These local updates are then synced back out to peers on the network using IPFS pubsub.

How is 3Box data persisted?

Because IPFS storage does not yet offer solid persistence guarantees (in the form of Filecoin), we replicate 3Box data to a set of OrbitDB/IPFS pinning-nodes running on infrastructure provided by 3Box. Currently 3Box provides a majority of pinning capacity on the network, but 3Box is working on a solution that would allow other services, applications, or users to run their own instance of the pinning-node, to guarantee openness.

Can 3Box access users' data?

3Box's architectural design and cryptography make it impossible for 3Box to view users' private data on the platform. 3Box's decentralized identity pattern and use of encryption derived from a user's private key within their wallet prevents this; all encryption and decryption occurs inside the wallet. However, data that is stored publicly is viewable by 3Box and anyone else observing the network.

How many databases make up a 3Box?

It depends. Each user has at least one OrbitDB key-value database, called the Root Store or the Profile Store. The Root Store keeps public profile information, basic private encrypted information, and 3Box configurations.

Users or applications can also create and store data in Spaces to keep information access controlled separately from the Root Store. Each Space would add another OrbitDB key-value database to the user's 3Box.

Lastly, if apps use Threads to enable peer to peer communication and shared messaging, these are also separate OrbitDB databases. Threads are OrbitDB Feed Stores where one or multiple users can post messages, and these Threads live inside of Spaces. However, Threads aren't explicitly owned by any 3Box, since they're shared between users. There can be many, many Threads mapped to a single application Space.

As you can see, 3Box is actually a network of peer to peer databases, that together make up a user's entire data footprint.

Which OrbitDB storage structures does 3Box use?

3Box uses OrbitDBKV-Store for profile and spaces storage, and OrbitDB-feedstore for threads.