Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 14423E7CC for ; Mon, 3 Dec 2012 04:12:06 +0000 (UTC) Received: (qmail 49616 invoked by uid 500); 3 Dec 2012 04:12:04 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 49100 invoked by uid 500); 3 Dec 2012 04:11:53 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 49016 invoked by uid 99); 3 Dec 2012 04:11:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Dec 2012 04:11:50 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.223.180] (HELO mail-ie0-f180.google.com) (209.85.223.180) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Dec 2012 04:11:43 +0000 Received: by mail-ie0-f180.google.com with SMTP id c10so3337714ieb.11 for ; Sun, 02 Dec 2012 20:11:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:references:from:content-type:x-mailer:in-reply-to :message-id:date:to:content-transfer-encoding:mime-version :x-gm-message-state; bh=q1YPZ+9dPUnzGgNVyk8g3pYZLbTNGy4o1nYWssV4g90=; b=ZqmVFFiFui6YWABBfioXv1frJ2IsijCBu6AXAaMb4fNSEknVYnoSAX9nRrf3+PNstw IAo8VfDZD26phfqx+9Z71oIguIIso/zAhkk9fjibtyGWrI+sLAOY9MsidgYg0MuZrB// K/3O5X9WZTCNslP2qx+X3lrvKlbEYSJENf/k3vc7Sniithz2AvysD4Gj/ujnso//5hHP +GeBKblK9vyIXK5OUbtKxrJZXKQMI5DjaLN1OvNtV6FpYwQ0tdm078Y00AtQV+paEi4v oNidjxgDdNDErm+UucoxdrS7FP2QgiD0ApPftgYIXnNnYnzhBk7D1QrmWjZarX7aJxbx nzYw== Received: by 10.50.150.144 with SMTP id ui16mr5186984igb.68.1354507881220; Sun, 02 Dec 2012 20:11:21 -0800 (PST) Received: from [10.85.137.114] ([166.137.109.47]) by mx.google.com with ESMTPS id s20sm6684950igs.10.2012.12.02.20.11.17 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 02 Dec 2012 20:11:20 -0800 (PST) Subject: Re: decentralized chat References: <20121124031418.GA1797@canonical.org> From: Thanos Vassilakis Content-Type: text/plain; charset=us-ascii X-Mailer: iPhone Mail (9A405) In-Reply-To: Message-Id: Date: Sun, 2 Dec 2012 23:11:13 -0500 To: "user@couchdb.apache.org" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) X-Gm-Message-State: ALoCoQkuH8RuCQKAaLFTmOVa9GbWdoJMttc+KxrRm2j/f4dqv0akiDPALZPpQd0J86sGnKbdapoA X-Virus-Checked: Checked by ClamAV on apache.org I've used couchdb for a private but audited chat system for traders. It's wo= rked very well.=20 Thanos On Dec 2, 2012, at 7:17 PM, Noah Slater wrote: > If it looks like Couch has 80% of what you need, perhaps you would be > interested in contributing the remaining 20%? That would be a win for > everone! Some of the stuff you mention sounds quite exiting... >=20 >=20 > On 24 November 2012 03:14, Kragen Javier Sitaker wro= te: >=20 >> Hi. I'm new to CouchDB, but I was just chatting with Noah on IRC about >> how IRC sucks and we need to replace it and whether we could do that >> using CouchDB. He mentioned this thing Chris did four years ago called >> Toast: >>=20 >> < >> http://jchrisa.net/drl/_design/sofa/_list/post/post-page?startkey=3D%5B%2= 2Simple-Wins%22%5De >>>=20 >>=20 >> Right now Skype chat is basically the best thing out there that I've >> seen, but it's proprietary. It has the following features I like: >>=20 >> * Real-time: people normally see your lines within less than a second >> after you send them. >> * Peer-to-peer: you don't have to install or manage software on a server >> to make it work, and it knows how to traverse NATs. (Skype, Inc., >> does maintain a centralized authentication service, which I regard as >> a significant drawback.) >> * Replicated: you can look at chat history and add chat lines when >> you're offline. When you reconnect to the people you're talking to, >> all the lines get sent. This is important not mostly because I'm >> trying to chat while I'm on an airplane but because I don't want to >> lose messages when my network gets disconnected, and because I switch >> between devices and want to be able to see messages I typed on my >> laptop on my cellphone and vice versa. (As far as I can tell, the >> POP-not-IMAP nature of XMPP makes this impossible for XMPP chats.) >> * Unified-UI: you can chat with many different people or groups of >> people at once using the same app, and see e.g. a list of chat >> channels where you have unread messages. >> * Encrypted: your ISP can't read your chat messages. >> * Secure: the people you're chatting with can't subvert your chat >> software to e.g. snoop on your other chats. >> * Correct: unlike IRC, doesn't truncate your lines at arbitrary places >> if they get too long. >> * File transfers: you can send screenshots and stuff to other people, >> including everybody in a group chat. >> * Cross-platform: versions for both GNU/Linux and Android. >>=20 >> So I'm trying to get a sense of whether there's something out there that >> would make this feature set easy to replicate. And maybe CouchDB is it? >> Or do I need to build something from scratch? >>=20 >> [Noah suggested](http://swhack.com/logs/2012-11-24#T02-25-22) making >> each chat line a new document, using continuous replication, creating a >> mapreduce view using datetime as a key and pulling the most recent 40 >> messages, and using the _changes feed to get Comet updates to the >> browser asynchronously. That sounds pretty reasonable to me, but the >> following questions occur to me: >>=20 >> * I'm behind NAT. If you're behind NAT too, how can we set up >> continuous replication between our CouchDB instances? Is there STUN >> support for CouchDB replication yet? >> * Do I need to create a new CouchDB database for every chat room? Is >> there any problem with having 20 or 30 databases on my netbook talking >> at once? >> * How about if I want to have a single Comet connection from my browser >> to all of them at once? (Browsers won't let you have 30 Comet >> connections to localhost.) >> * Are there security concerns I need to think about? Like, how do I >> make it so that I can update my DHTML UI, and maybe even automatically >> get updates from someone else, but not *everybody* I chat with can >> update my DHTML UI to a version that spies on my chats? What are the >> security properties of the replication protocol? What if I need to >> kick someone out of a chat channel because they're spamming it? >>=20 >> I think the ability to automatically update application code is >> necessary for decentralized applications (like email) to start to >> successfully compete with centralized ones (like Facebook) again, but >> although I have some ideas about how to do that securely, I don't feel >> like I've solved the problem because I haven't tried them in practice >> yet. >>=20 >> Anyway, I don't know if anybody else thinks it's an interesting project, >> but it seems to me like every chat system out there today is basically >> unusably bad, and decentralized database replication with automatically >> incrementally updating views seems like the right substrate to build it >> on. >>=20 >=20 >=20 >=20 > --=20 > NS