Mutating the Immutable: Behind the Scenes of SkyDB

This article was first published on Sia Blog - Medium
-----

Skynet allows for uploading arbitrary data of various types, but unlike the traditional web, these files are immutable. This limits what you can do with your decentralized applications, so in October, Skynet Labs rolled out a new feature for Skynet: SkyDB. You can read David’s introduction here.

Developers are already hacking with it, porting it, and breaking it in. It’s even driving tools to enable instant DNS resolving, cross-application user accounts, and a social networking platform . But what is it? What’s going on under the hood?

Before getting into the technical details, let’s talk about using SkyDB.

SkyDB is a framework that allows you to bring mutability to your application’s data. It works as a key-value store. So, instead of querying a database to access specific rows in tables, lookups are done by providing a public key (typically associated with a user) along with a data key to specify what value you wish to pull. Writing to SkyDB works similarly. Using a private key and a data key, you can set data. Data written to or retrieved from SkyDB are formatted as JSON objects, and the keys used are easily derived from a single seed.

The power and simplicity of SkyDB comes from some behind-the-scenes magic: the data retrieved from SkyDB are actually Skylinks containing JSON data. Therefore, much of the infrastructure involved works just like any other file on Skynet. SkyDB methods are ultimately a developer-friendly abstraction for handling the reading and writing from the actually mutable piece of Skynet: the registry.

The registry also enables us to get and set data using public and private keys. However, instead of storing JSON data, the application uses a specific data type called a “Registry Entry.” A registry entry contains three elements:

  1. the data key used by SkyDB,
  2. a ...

-----
To keep reading, please go to the original article at:
Sia Blog - Medium

Comments (No)

Leave a Reply