Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > BOOK: Professional XMPP Programming with JavaScript and jQuery
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 10th, 2010, 06:56 AM
Authorized User
Points: 71, Level: 1
Points: 71, Level: 1 Points: 71, Level: 1 Points: 71, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
  #2 (permalink)  
Old June 10th, 2010, 05:13 PM
Wrox Author
Points: 702, Level: 10
Points: 702, Level: 10 Points: 702, Level: 10 Points: 702, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
  #3 (permalink)  
Old June 10th, 2010, 05:15 PM
Wrox Author
Points: 702, Level: 10
Points: 702, Level: 10 Points: 702, Level: 10 Points: 702, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
  #4 (permalink)  
Old June 10th, 2010, 08:11 PM
Authorized User
Points: 71, Level: 1
Points: 71, Level: 1 Points: 71, Level: 1 Points: 71, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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?
  #5 (permalink)  
Old June 28th, 2010, 02:31 PM
Wrox Author
Points: 702, Level: 10
Points: 702, Level: 10 Points: 702, Level: 10 Points: 702, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:42 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.