
Distributed Social App with CouchDB. Brilliant - messel
http://www.victusspiritus.com/2010/10/05/distributed-social-app-with-couchdb-brilliant/
======
Joeboy
There's a bit more info in the projects's README at
<http://github.com/maxogden/couchappspora>

Unlike the link submitted it suggests it's intended to be an alternative
implementation of Diaspora's protocols, which for my money makes it a bit more
interesting than yet another distributed social network.

~~~
messel
My bad, yeah I caught that he cloned the API and updated the post this AM.

~~~
maxogden
couchappspora is shooting for ostatus/SWAT0 compatibility. I just started a
separate project to work towards implementing ostatus in commonjs
<http://github.com/maxogden/ostatus-js>

~~~
messel
so what do you need: PuSH, Salmon, anything else? _update_ learned to read :D
OStatus consists of the following protocols: WebFinger PortableContacts
Activity Streams PubSubHubBub Atom

------
beza1e1
There are little technical details. As far as i understand the thesis is:
CouchDB provides all the groundwork for distributed state, so there is no need
to build a lot sync/auth/notify code like Diaspora does. Really?

~~~
antileet
I don't think it's that capable of doing all that. As far as I understand,
CouchDB does a "dumb" version-control type synchronization. Server A can copy
all the data that Server B has and do it in a nice clean manner over HTTP.

I can think of several disadvantages (though I may be wrong and naive):

1\. If you're running a node, and I'm running a node, my data schematics might
not be compatible with yours. If I write a uniform backward-compatible RPC,
then it'll be a little better.

2\. I can't selectively allow you to copy some data (photos) and not others.
If you are a user on my database, you can access everything you have
permissions to. It's hard to set fine-grained permissions.

3\. Push notifications will be hard. I'd have to poll the database for
changes.

For that matter, the same can be achieved by putting a giant XML file on Git,
and having each person set up a remote, or using a complicated set of shell
scripts and rsync. Couch's replication facility is really neat, especially if
you want to scale horizontally or if you're adding redundancy, etc.

CouchDB is becoming the new hammer. It'll get tempting to write source
control, file backup, etc, using this database because of the data sync, and
decent query capabilities. But I feel that building a social network on top of
CouchDB's replication might not be the best of ideas.

~~~
janl
CouchDB sync is more like rsync than DVCS sync. The idea is that it is very
simple, yet powerful enough to build more sophisticated systems on top of.
Building small and large P2P systems on top of CouchDB is very much a design
goal. The fact that sync can be used to build scalable HA systems is
orthogonal.

To your points:

1.) I think the idea of this project is to define a common ground to allow
seamless sync.

2.) CouchDB supports filtered replication, so you can define what can be
synced and what not.

3.) CouchDB has a push-notification changes feed that does not involve
polling.

~~~
dbfclark
Is it actually the case that filtered replication can be used cleanly for
access control now? My understanding from the various docs was that currently
you can write a filter but not require that users replicate through it -- that
is, if you have permission to replicate, you have permission to replicate and
that's it. For real access control using this I think you'd need something
like a permission to replicate distinct from permission to read and a
permission to replicate only through a specified filter. I suppose I'm off to
have a look through Max's source, but if I'm wrong about these things I'd
appreciate the correction...

...ok, back. Right now there appears to be no access control at all. Granting
that this is a relatively early-stage project so it doesn't necessarily matter
too much, but my question still stands.

~~~
janl
Your personal data db could be private and you could use filtered replication
to create a local clone with only the data you want to allow replicating.

------
maggit
@messel: Interesting find :) But I get a bit suspicious when the title says
"Brilliant". Do you agree that removing it would be in the spirit of the
submission guidelines for HN? (Though, of course, the guidelines do not say to
remove such words)

~~~
messel
oh brilliant was in my post title.

when I came across Max's app that Guinness image was the first thing that
popped up.

~~~
maggit
To clarify, I'm not suggesting that you remove the "Brilliant" from the linked
post, only from the HN submission title.

The Guinness reference is completely lost on me when seeing the picture, and
not much clearer when just seeing the title :) I'm sure I'm not the only
one...

~~~
messel
I don't mind moding the post here, but I can't seem to edit it.

Admit to the odd reference, it probably doesn't click with everyone. Maybe I
watch too much BBC on netflix?

------
knodi
I love couchdb so much. It has made relocation and big data crunching so much
easier.

------
js4all
This is a really good example of not reinventing the wheel.

Instead built-in functions of the wonderful CouchDB are used - indeed
brilliant.

------
mrinterweb
Nice work Max. You should do a show and tell at tonight's pdxruby brigade.

~~~
messel
Man I wished in Portland sometimes, just to go to some of your guys hack
meetups.

------
cies
becareful with supplying your email address! it said i had to provide it for
my gravatar, but it turns out it is _publically_ visible and _unchangable_
after you entered it..

it's a trap! :-P

~~~
messel
:D I don't think Max expected the implementation would get so much attention.

