Some notes toward a fully distributed, serverless socnet/communications network using CouchDB.
This is a dump from one of my desktop note-taking apps. It's not fully
fleshed out, and in fact a fair amount of discussion needs to take place
before it will be. As always, if we can re-use and extend an existing
application, we should so we can apply time and energy toward making it do
exactly what we want rather than potentially reinventing a wheel:
CouchDB (https://couchdb.apache.org/) is a distributed NoSQL database which
stores JSON documents rather than information in rows and columns in tables
documents are managed with MVCC (Multi-Version Concurrency Control), and
the network is designed for eventual consistency
automatic conflict resolution
CouchDB nodes can connect to one another to replicate data very easily
designed to operate offline - do what you want with your local copy of the
data, and when you reconnect it'll automatically resynch with the rest of
the CouchDB network you set up
designed for ad-hoc connections - whatever connection it has, when it has
it, it can use it to connect to the network
lightweight - the proof of concept Twitter-like app (Toast) supported
thousands of transactions per second while running on an older Macbook Air
accessed in the fashion of a hash table, i.e. with key/value references
queries are done with JavaScript
the API is bog-standard HTTP(S)
can be interacted with using wget, curl, or a web browser
runs on everything from Windows to Android
because it includes its own HTTP(S) server, it is capable of hosting apps
within the database itself, so you don't need an external framework (like
PHP, Rails, or Django)
apps are written in HTML5 and JavaScript, stored as documents in the
database
apps are trivial to deploy
book is online, free to download and read, can be found on Github also:
http://guide.couchdb.org/
we can conceivably use CouchDB to implement Network25 (and whatever other
information storage solutions we will eventually want to use)
installation can be a single installer for every platform - download this,
double click on it, when it's ready it'll tell you
every document can have its own schema, which is simple to determine
because it works just like a hash table (key/value)
public profile document (gets replicated)
{
_id: "Bryce A. Lynch",
_interests: ["long walks on the beach", "moonlit nights", "massively
distributed systems"],
_friends: ["friend", "friend", ...],
_publickey: "<public key>",
...
}
private profile document (doesn't get replicated, stored on machine,
optionally encrypted and must be unlocked with a passphrase when the
Network25 app is started)
{
_id: "Bryce A. Lynch",
_publickey: "
participants (1)
-
Bryce Lynch