Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > BOOK: Professional XMPP Programming with JavaScript and jQuery
|
BOOK: Professional XMPP Programming with JavaScript and jQuery
This is the forum to discuss the Wrox book Professional XMPP Programming with JavaScript and jQuery by Jack Moffitt; ISBN: 978-0-470-54071-8
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional XMPP Programming with JavaScript and jQuery section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 10th, 2010, 06:56 AM
Authorized User
 
Join Date: Feb 2010
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Application architecture with persistence layer

With Jack's really great book I'm getting more and more familiar with writing little ajax-based xmpp applications :) Now I'd like to build a more complex one with storing data into a database (e.g couchdb ).

Does anybody have some experience with xmpp applications and persistence layers? How could an architecture look like? How do I manage the access model? Which xmpp-user are allowed to read/write which parts of the database? Does It makes sense to implement something like a "database agent"?

I'd like to discuss some possible and existing solutions here.
 
Old June 10th, 2010, 05:13 PM
Wrox Author
 
Join Date: Jan 2010
Posts: 178
Thanks: 0
Thanked 16 Times in 15 Posts
Default

Chesspark did authentication based on JID. Most of our users were local to our own server, so this worked very well. It's possible for a bad server admin to abuse it for external users, but this is also true with email.

The database just checked credentials against the JID, and since we were always speaking XMPP, we knew the server had authenticated them.

The rest of the application state was stored just as with any other kind of application.
 
Old June 10th, 2010, 05:15 PM
Wrox Author
 
Join Date: Jan 2010
Posts: 178
Thanks: 0
Thanked 16 Times in 15 Posts
Default

One other note: we also stored some per user configuration for clients and such in Private XML storage on the server.

You can find a bit more detail in my chesspark architecture posts over at my blog. Just search for "chesspark" on http://metajack.im
 
Old June 10th, 2010, 08:11 PM
Authorized User
 
Join Date: Feb 2010
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by metajack View Post
Chesspark did authentication based on JID.
Yes, that's the most obvious way :)

Quote:
Originally Posted by metajack View Post
The database just checked credentials against the JID
And here comes the technical question: How can I do that?

At the moment I use the same username and password for both xmpp and couchdb. It works but It's awful to keep the login data in sync.
As I could see, you have some experience with couchdb, right? Do you know how to tell couchdb to use the JID as access model?
 
Old June 28th, 2010, 02:31 PM
Wrox Author
 
Join Date: Jan 2010
Posts: 178
Thanks: 0
Thanked 16 Times in 15 Posts
Default

Quote:
Originally Posted by flossy View Post
And here comes the technical question: How can I do that?

At the moment I use the same username and password for both xmpp and couchdb. It works but It's awful to keep the login data in sync.
As I could see, you have some experience with couchdb, right? Do you know how to tell couchdb to use the JID as access model?
We wrote an authentication plugin for ejabberd that uses CouchDB to authorize requests. That is one way to link one to the other.

At Chesspark we modified the built in ODBC integration to use our normal table structure instead of the standard ejabberd one. It just needs a JID and a password, which were already stored in our database for the web application. Instead of copying the data to another table for ejabberd, we just patched ejabberd to use our existing table.

Authentication plugins in both ejabberd and CouchDB are surprisingly easy to write.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with 3-layer architecture T. R. Tinker BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 6 December 16th, 2008 04:26 PM
Handle error from database layer to applican layer khatu_jec ASP.NET 2.0 Basics 1 November 9th, 2008 03:51 PM
Application Architecture balesh.mind ASP.NET 2.0 Professional 3 July 26th, 2007 11:26 AM
Application Architecture ram_siddinen VS.NET 2002/2003 1 January 27th, 2004 12:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.