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
