First Post

Hello and welcome! This blog will be documenting some new projects built around a distributed database called GunDB. The idea with these projects will be that they're local and offline first, and they keep a copy of everything they need to function in the browser. Gun ticks a lot of the boxes required to enable this type of functionality. There's other projects that offer similar features, but I'm going to skip the pros and cons of what else is available and jump into working with Gun.

The first project I've been working on is called RSStream. It's a feed reader that stores everything in Gun, but does the feed processing using SimplePie and Dobrado, which are other projects I've worked on. Those services run on the same server and push data to a Node app that has access to Gun.

Before looking at how to store data in Gun, there's a bit of a mindset change required when working with a distributed database. Your first question should be, if everything is distributed how can I protect my data? Gun solves this problem by providing user accounts that can encrypt, sign and verify data. This makes it possible to store data under an account that can only be written when the account owner is logged in.

RSStream uses this feature to create a host account on the server, which provides a central location for application data. Wow first post and we're already talking about centralising data in a distributed database? Well we actually want two things. Data should be distributed as widely as required, to support users. But control should also be available to the administrators of an application when running a hosted service.

With this in mind, creating a host account means we now have a reliable place to store data that can't be modified, even though that data is distributed to browsers and other servers. We've reached the first step to having a usable piece of software! Stayed tuned for more updates.


3 photos

Add a comment