Ask YC: Why the excitement over XMPP on the backend?
I'm developing something now that implements a push client, and I keep seeing people getting excited about XMPP for publish-subscribe type things.
The slide deck that keeps getting press lately is here: http://en.oreilly.com/oscon2008/public/schedule/detail/4359
It really seems to me that using XMPP (which is a stateful chat protocol) for RPC might be the wrong approach. Have the XMPP advocates just re-invented message queues?
In the OSS world, ActiveMQ exists, so does AMQP. MQ theory is very old, having been used for decades for things like financial systems.
Am I missing something?
32 comments
[ 23.4 ms ] story [ 78.3 ms ] threadThe investment banking world has as you say had to deal with huge feeds as well as mashups from multiple sources.
http://www.zeromq.org/ for example is coming out of the financial world and looks like it's going to be the nginx of amqp systems. It looks like it's way faster and "scalable" than creating something over xmpp.
AMQP is very interesting. Check it out if you are building a distributed system or if you have a requirement for reliable asynchronous messaging. When I last looked into it about a year ago, the implementations (all two of them that I found - apache qpid and rabbitmq) were still a little rough but it looks like a lot has happened.
It's wierd how few people in the web world are aware of asynchronous messaging.
You're missing that it's not stateful chat protocol, it's stateful xml protocol (that has, so far, been use mostly for chat).
People are excited that it's fast, stable (some of the implementations anyway), and they don't have to reinvent the wheel.
But the context is different. XMPP as MQ mechanism may work better in Internet scale distributed system. Just like HTTP works better as a client server mechanism on Internet scale distributed system than other protocols before it.
I worked in a startup called PubSub from 2003 to 2006. We in fact used XMPP in 2004 internally to relay our error message log of our cluster of machines in real time to our office's archive server. It was an experiment but it seems pretty useful. We called it as fuselet before in our company.
Why do you think so? What advantages does XMPP have over other MQ technologies at "internet scale"?
Also xmpp libraries are available in almost every language and platform and traditional MQ's do not have presence or federation(ie horizontal scalability).
It's not about using XMPP as a message queue per say. It's about using xmpp as a p2p messaging system for machine to machine communication as well as integration with chat.
On the other hand. If I only have an internal cluster, I will choose to use existing MQ system instead of XMPP. I may want higher throughput, and I don't care authentication of endpoints because they are all trusted. Why do I need all the extra stuff that XMPP demands?
Regarding the case I mentioned in PubSub: It was just an idea. In fact, I was the one who mentioned the idea then. And our CTO and VP of Eng thought it was an interesting idea because in this case, we just wanted to see how does it work out and did a test implementation. And it was pretty flexible for us to use it.
Of course XMPP is not the first MQ system on Internet. SMTP is the first one, right? In SMTP, we don't know anything of endpoints. We assume senders and recipients exist and are taken care of by SMTP servers. I think in XMPP, because the original application is chatting, then it adds an new protocol to notify "presence" of endpoints.
Edit: I think when I said "internet scale", I actually meant "a system of billion nodes that are loosely coupled together"
Yes. http://softwarelivre.sapo.pt/broker/ for example.
But "decentralized" does not mean "federated" which is I think your point.
Best regards,
It's also got lots of good libraries for many languages, and neat tricks like bridges between it and the web browser.
This is already happening, but in isolated cases. Behind the scenes, Six Apart streams all the blog posts on its services directly to Google Blog search.
There are quite a few well-known services that get more API traffic (search engines, etc, pinging for updates) than actual human traffic. So something like this is ultimately necessary, whether it's XMPP or something similar.
I think they are aware of message queues, didn't they allude to them in the talk? Anyway they billed their talk as two guys who build web services making a tentative foray into the message-queue world, so if you think you can help, send feedback.
I read a bit over ActiveMQ, RabbitMQ, and the recent and lovely ZeroMQ. As far as I could find, none of them provide federation on a Internet scale. Specially Open Federation using TLS.
I'm a XMPP developer for 6 or 7 years now, and if someone thinks that XMPP is going to replace MQ systems, they are delusional. But for Web integration, XMPP beats the crap out of current MQ systems because of Federation.
Sure, you can get 2.5M messages/sec on ZeroMQ. So what? I've seen personally a XCP XMPP server doing 1M messages per second also. But for internet scale stuff, even slower servers like OpenFire would work just fine for the current loads they are seeing.
It also helps that for scripting languages commonly used (like Perl, Ruby, Python), XMPP bindings are commonly available, while AMQP are still rare. Please please prove me wrong :).
My recommendation for startups? Use a MQ system internally from day one to develop your solution, but use XMPP to talk to the outside world.
RabbitMQ (and I'm suggesting it based only on what I read, I don't use it myself, I use another one) is the best placed MQ system right now, because it offers the bridge between local MQ system and XMPP world.
Best regards,
More cynically, XMPP vendors generally give everything they have away in hopes that somebody with money will buy support for it. Since customers of message queuing products are people with money, it is only natural for people to hype XMPP as the "worse is better", cheaper alternative to "enterprisy" MQ products in hopes of having some money fall into their pockets.
Less cynically, the people hyping XMPP understand it very well from their personal experiences with chat systems and "chatbot" like applications including Twitter. It is easy to say "hey, if a computer can IM me, I bet a computer could IM another computer." It is a little tricky to abstract that into "hey, that is the same thing as that old, boring message queing stuff," and anybody that gets that far realizes it's not that exciting to blog about.
How so?
Now, maybe you want to combine your batch-update and batch-fetch operations into a single "batch-update-and-fetch" POST operation. Well, that is exactly what WS-* does.
On the flip side, sometimes instead of batching you want to fetch or update only parts of individual resources via some extension to partial GET requests and or a PATCH method. There is currently no uniform interface for those so, just like in the case of batching, you lose all the uniform-interface benefits.
Now, let's say you want to combine your partial-resource operations with batch operations over multiple resources to reduce the number of requests you receive and/or the reduce the aggregate size of requests, so you add the ability to do patching and partial-fetches to your batch-update-and-fetch mechanism.
Now take a step back. Doesn't your batch-update-and-fetch-with-patch-and-partial-fetch look a lot like SOAP with WS-ResourceTransfer? It will probably look a lot like SOAP; not even the newish SOAP 1.2 that actually is somewhat HTTP cache friendly, but old school RPC-only SOAP + WS-ResourceTransfer.
Look at Google's GData and OpenSocial's RESTful API for examples.
And, that is totally ignoring anything to do with transactions.
Take any WS-<star> specification, and you can probably find one or more ad-hoc proposals for adding similar features for RESTful protocols. For example, AtomPub is adding a mechanism that is almost exactly like SOAP-with-attachments, but more limited. The various HTTP message signing mechanisms like those found in Amazon's web services or the one in OAuth (and OpenID? I forget if there is a different one for that) are analogous to the various WS-Security stuff. As another example, I've seen a couple RESTful protocols that tried to define something like a simpler WS-Policy.
I don't think that the WS-<star> stuff is that great either; a lot of it is really complex. But, WS-<star> stuff is all decomposed in ways that make it relatively simple to combine just the parts you need together. SOAP 1.2 isn't complicated at all. WS-Policy and WS-Security and other stuff is more complicated than it needs to be, but it isn't so complicated that it needs to be totally redone anew. And, a lot of it can be (and is) subsetted pretty easily.
I'm not convinced that this is a major trend, but I see your point.
There seem to be quite a few people these days who think that REST means nothing more than "uniform interface" and/or "resources". But that's only part of the picture.
http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch...
"REST is defined by four interface constraints: identification of resources; manipulation of resources through representations; self-descriptive messages; and, hypermedia as the engine of application state."
P.S. I'm not sure why you think batch operations are missing from REST. GET/PUT/POST/DELETE can apply just as well to collections as to individual resources.
More on the proposal of mixing the two, the rabbitMQ folks have done some interesting work integrating with xmpp. (See their xmpp transport (http://www.lshift.net/blog/2008/07/01/rabbitmq-xmpp-gateway-...), and rabbiter (http://github.com/tonyg/rabbiter/tree/master).
So there we have an interesting mixture of the two technologies, you get the insanely fast message routing and throughput of RabbitMQ while leveraging the tools that xmpp brings with it (users, federation, etc.)
http://activemq.apache.org/how-does-activemq-compare-to-amqp...