SkyDB: A Mutable Database for the Decentralized Web

David Vorick
The Sia Blog
Published in
6 min readOct 15, 2020

--

Today we are adding a new feature to Skynet called SkyDB. SkyDB is a framework that allows Skynet users to create decentralized accounts and store mutable files in those accounts. This is the final building block required by Skynet to allow developers to build feature complete applications that compete with the likes of Youtube, Twitter, Instagram, and Snapchat.

SkyDB is already supported in the Javascript SDK for Skynet. For a quick-start intro to SkyDB, check out this blog post which makes a simple Skynet app that uses SkyDB. To make a more complete application, checkout the full documentation of our SDK.

One of the simplest things you can do with SkyDB is make an app that stores user data, for example a decentralized version of DropBox. The user’s SkyDB account can be used to store a json object which lists the user’s files and any associated metadata. That object can then be interpreted by the frontend to load a list of files for the user. If the user makes any changes to their set of files, the json object can be updated.

The killer feature here is that the user’s SkynetBox can be accessed from any device, using any Skynet portal. The user’s account does not exist in a single location, but rather in a decentralized global data layer that can be accessed from anywhere. This means that there is no de-platforming, because no single party can deny a user access to their data.

This sort of app — a decentralized DropBox — can be built in a single weekend by a single person. When we started Sia, it took us almost 2 years of full time work to put out the first product that remotely resembled a decentralized DropBox. And even then, it was only accessible from the same machine that was running the Sia node. That it is now possible to accomplish so much more in just a single weekend really highlights how much decentralized storage has advanced since we began.

Publication and Aggregation

SkyDB supports both private files and public files. Private files are encrypted, and are useful for building applications like SkynetBox, but you can do much more with the public files.

For example, you can write a blogging application that publishes a list of posts that a user has written in a public file under their account. Anyone using a blog reader can “follow” that user by adding their account id to the list of accounts that they check when they load the reader. The reader can then scan the publication file of every writer that the reader is following and show any new blog posts to the reader. Using this technique, developers can now make a fully decentralized alternative to Medium.

Aggregation does not need to be limited to things that fit the traditional notion of publishing. For example, a user could put a list of comments they’ve made on posts in a public file in their account, allowing other readers to see what they think. More than comments, a user can publish things like a list of articles they’ve clapped for, or they could publish a list of favorites or even a list of post upvotes and downvotes.

This aggregation technique is the key element that allows Skynet to emulate most centralized web applications. With enough creativity, you can get high performance, fully decentralized alternatives to applications like Twitter, Snapchat, Facebook, and more using these basic building blocks.

A key element for developers in this process is the absence of any required infrastructure. Launching a decentralized alternative to Medium on Skynet does not require running a server or hosting a database. You just push the client application to Skynet and everything else is handled by the decentralized network. This includes the costs of supporting users. An application which achieves overnight success and suddenly ramps up to millions of users will not result in large bills (or even any bills!) for the application developer.

Permissionless Innovation of Major Applications

In the centralized world, making a new Twitter with specific improvements (for example, upgrades to the chat feature) means needing to launch a brand new service that has no users on it. Twitter controls the data, including critical information like account credentials.

On Skynet, all critical data is owned and controlled by users. This means that multiple different applications can have access to the same data, and this can be done without permission from existing developers.

For example, a Skynet version of Twitter could be upgraded by an independent party to support a different feed algorithm and different moderation strategies. Unlike in the centralized world, this updated application still has access to the full original set of data. Users can log in using the same account credentials, and users can continue seeing posts that were made on the older version of the client. Launching competing applications no longer requires building a new ecosystem from scratch.

The openness of the data paves a path for rapid innovation. Anyone can choose to extend any platform, and the data is already available for them. This is a major feature of Skynet that cannot be replicated by the centralized world. Because of this improved ability to innovate, Skynet applications will be richer and more interesting than anything you can find in the centralized world, and the centralized world will find itself unable to keep up.

Blended Applications

The boundaries between applications are firm on the centralized Internet because data exists in silos. Twitter has limited ability to integrate with Facebook because Facebook is a separate permissioned database, controlled by a different company with competing interests. On Skynet, boundaries only exist between applications to the extent that users desire them to exist.

One example of a place where blended applications could thrive is internet chat. Today, our chat messages are broken across many platforms. We may have 10 conversations going with the same friend and each conversation is locked into its own silo, inaccessible except from a particular application. Skynet however makes it possible for applications to all use the same chat layer, allowing users to discover eachother inside of one application but then extend their conversations across all applications.

Another simple use for blended applications is cross application discovery. If you follow an account on one application, you can look up what other applications they publish on which you use. In a Skynet world, following someone on Twitter could mean that they also automatically populate your feeds on Facebook, Instagram, and YouTube.

Blended applications will eventually become very sophisticated. In a world with SkyDB, developers have access to all of the data that has ever been published to Skynet. The Internet transforms from a fractured archipelago where every application needs to build its own cache of data to a living unified organism where every application can use any data that exists anywhere on Skynet.

A Brighter Future for the Internet

Skynet unlocks power for users and developers that simply doesn’t exist in other data models. With the launch of SkyDB, it is now possible to build applications that could not exist previously. Decentralization will win not because we are concerned about our privacy or long term health, but because decentralization enables application, integration, and innovation that simply cannot be replicated by the centralized world.

This technology isn’t an early stage technology with a 6-months-becomes-36-months roadmap. This technology is ready today. If you would like to join us as a builder or user, we invite you to read the documentation or join our discord.

--

--