What Chris is saying makes perfect sense. If you can keep the users in a conversation (or room for >2) connected to the same CouchDB, you should have no problems.
I launched into a vision of users connected to a single couchapp at the edge of a couchdb cluster, which presents interesting problems. Looking back at my first email, I hope I didn't come off abrasive, but I thought it'd be fun to toss out a lot of issues in the super complicated scenario because it touched on things already in my head at the time. -Randall On Dec 20, 2010 2:07 PM, "Chris Anderson" <[email protected]> wrote: > On Fri, Dec 17, 2010 at 1:57 PM, Johnny Weng Luu > <[email protected]> wrote: >> Hi >> >> Im designing a chat app and i thought about this design: >> >> Clients are connected to the nearest couchdb and listening for changes (chat >> texts). >> If one client posts a new message it will be inserted in that client's >> couchdb node. >> The change will be propagated to other couchdb nodes in the cluster. >> The clients connected to those couchdb nodes will get that message. >> > > If you design it to abstract a chat room as a database, then rooms > will be easy to replicate, as users can each replicate via a common > shared instance in the cloud. Users will tend to maintain as many > replications going as they are in chat rooms, so the connection > overhead scales nicely too. > > The application challenge here is creation of rooms (admin stuff), and > tracking which rooms people join (presence), but sharing chat messages > for an individual room becomes much simpler. > > The larger rooms may require partitioning, but frankly at that message > rate chat stops making sense anyway, so exact ordering is less > crucial. > > -Chris > >> But this design is heavily dependent on how fast couchdb propagates changes >> to other nodes. >> Is this a good design with couchdb or is it not intended for this design? >> >> How else could you design a chat application with couchdb? >> >> /Johnny >> > > > > -- > Chris Anderson > http://jchrisa.net > http://couch.io
