Do We Need Another OO RPC Mechanism? 92
Paul68 queries: "I am looking for an RPC mechanism for a project. Granted, there are many to choose from, yet there seem none that meet my requirements! When one has toyed with the requirements the solution generaly becomes obvious. So, yeah sure, I can set out and create the next RPC mechanism, but it is a lot of hassle. But does the world need yet another OORPC, or have I simply not looked in the right corners?"
"My requirements are:
- object oriented
- extensible
- platform independent
- supports signatures for integrity and sender checking
- supports privacy of the message contents (i.e. encryption)
- time sensitive: I should be able to detect a dead server and do failover while the user is waiting for the response
- bandwidth efficient, as I am looking to deploy it in wireless environments
Does anyone have any options that I may have missed?"
It's time to stop (Score:5, Insightful)
Re:It's time to stop (Score:5, Insightful)
There is one good RPC system, and it's called HTTP. It works wonderfully when you can generate stuff from a database into some text-representation.
There are a lot of bad ones, which mostly have the same thing in common: It is NOT a good idea to make a remote resource act like an object. It just doesn't work well. To get an impression that it works well, you need a huge bloated library, so you can pretend that everything works, until your network breaks and you have to deal with all the shit yourself anyway, but now add the complexity of the RPC system to the mix.
The thing is, when you design to work with a very simple system, either HTTP or something similar built on top of TCP directly, you end up with design, where the network is a natural part of the system. When you build something on top of a generic RPC system, you just add a layer of indirectness, which makes a good design much harder to get. In addition, when you restructure your data into text-representation (or other simple representation), you usually end up doing it in the right place, because it's usually the only place where such representation can be handled in a sane way.
That's my 1 cent about RPC. The other 1 cent deals with objects. Objects are nice, if you don't have 1) database or 2) proper functions. When you have a (relational) database, you end up with something like objects anyway, when you build a good database access layer. For many things this is what you would want to do anyway, with the added benefit that you never need to care about object references. You just tell the system how to find/alter what you need.
For the functions, as soon as you have first-class functions, objects no longer make much sense, as it takes about 15 seconds to build an object system on top of these functions. Most of the time you don't want object anyway, as you usually want functions and data instead. Learn LISP. It is more useful today than ever before. If there's something wrong with existing dialects, then help build a better one.
As for your requirements: You could use TCP directly, but you need encryption, so add ssl or something. Authenticate the connection or something, the encryption should handle rest of the integrity (this is pretty much a cipher question). Build a simple protocol with no tweaks and leave the extensibility there. If you want, you could send XML anyway, if you use zlib or something to compress it. Depending on your data, it might be the easiest thing to parse anyway. Separate the protocol layer, have it timeout and catch TCP failures, and automatically reconnect (same or other server), and you have the time-sensitivity. If you need more, send requests to multiple servers, and handle them with the one that answers first. Aim for stateless protocol, and it becomes easier. TCP and SSL are pretty platform independent, so unless your protocol is really bad that shouldn't be a problem. Now, you basicly want this all for every application in existence.
Forget the objects, they just make life a lot harder. Use cookies and numerical identifiers if you really need to. A lot of things look like they needed OO-RPC, but to this day I've not seen a single one where it really made sense. Doesn't even speedup development in the long run..
Re:It's time to stop (Score:2, Interesting)
The people behind REST [conveyor.com] seem to agree with you, I think.
Re:It's time to stop (Score:1)
Re:It's time to stop (Score:4, Insightful)
A million years ago, a caveman spent alot of time developing the wheel. Don't replicate his work. You're likely to make lots of mistakes when you reimplement RPC or yet another master framework product, particularly with the encryption and signing part.
I know of people working on a similar project using Java Jini. Check it out.
Also, base your decision on the actual architecture of your application, not the buzzword-compliance of the glossy brochure or website.
Does 7 really rule out XML? (Score:5, Insightful)
Of course, if you are sending many packets, each with small amounts of data, perhaps strewn across many XML tag sets, then the XML "noise" ratio may be high. How about gzipped XML-RPC ?
Re:Does 7 really rule out XML? (Score:5, Interesting)
Re:Does 7 really rule out XML? (Score:4, Funny)
Re:Does 7 really rule out XML? (Score:5, Informative)
(That was for one particular application, others will vary.)
Re:Does 7 really rule out XML? (Score:1)
XML is highly compressible. Not only are <=/> characters and tagnames are repeated all over the place, being mainly in printable ASCII means most characters use 7bits.
Throwing a compress/decompress around the RPC process often adds very little extra processing and gives you the advantage of a very extensi
Re:Does 7 really rule out XML? (Score:2)
Re:Does 7 really rule out XML? (Score:1)
Re:Does 7 really rule out XML? (Score:3, Insightful)
Something XML-RPC (SOAP) doesn't have (Score:5, Informative)
The dude asking the quesiton here is, I think, a little too worried about overhead - the overhead of XML is fairly tiny, and the overhead of TCP/IP isn't that great either - if both of those really are too much then you're probably on your own as there isn't likely to be a "general purpose" solution that will work for you.
- Steve
Re:Something XML-RPC (SOAP) doesn't have (Score:3, Insightful)
SOAP is designed for easy synchronous communication, and while you can fake synchronous over asynchronous, it can be more challenging to go the other way.
Re:Something XML-RPC (SOAP) doesn't have (Score:4, Informative)
If you're looking for something closer to real-time (a way for the server to initiate contact with the client) check out the BEEP protocol [beepcore.org].
From the BEEP web page:
BEEP is a turbocharger for Internet applications that offers advanced features such as:
Re:Something XML-RPC (SOAP) doesn't have (Score:2)
Re:Something XML-RPC (SOAP) doesn't have (Score:2)
Re:Something XML-RPC (SOAP) doesn't have (Score:1)
Re:Something XML-RPC (SOAP) doesn't have (Score:2)
With a SAX-based XML parser, you can stream data back in as leisurely a pace as you want and have your client react immediately to whatever tag delimits your message boundaries.
As for overhead, I'm in agreement there: the overhead of TCP/IP is definitely minimal compared to the cost of marshalling RPC data to begin with. TCP/IP can be tuned anyway, and it'll almost certainly be faster and m
Re:Something XML-RPC (SOAP) doesn't have (Score:5, Interesting)
Perhaps I misread original points, but it seemed like he wasn't so much worried about overhead, but about time-sensitivity aspect. TCP tries really hard to get all the data get through (with re-sends etc), without worrying at all about delays. It's good for bulk transfers, and things that simply have to get through, but for real-time (or in general time sensitive) data it's pretty useless to get anything that is late. And worse, since there's no way to really know what's going on (from TCP POV, "app shouldn't care"), it's difficult for the app to try to failover or other sensible action to resolve the (likely transient) problem.
Trying to figure out information about why and how data just isn't getting back, via socket (or whatever) API is next to impossible... thus, protocols such as RTP were developed. It's been a while since I followed what was happening there, but there was definite need for something that would give better control over timing information; at the very least for apps to be able to find out if there are timing problems, and do the right thing whatever it is (mark server as likely being down, find alternatives etc).
As to overhead, I'd agree; esp. due to HTTP being so ubiquitous, all stacks are ridiculously optimized, and handle "non-optimal" usage of TCP (simple request-reply) rather fine, all things considered.
Re:Something XML-RPC (SOAP) doesn't have (Score:3, Informative)
Check out: http://www.globus.org/ogsa/ and the globus toolkit.
Anm
Re:Something XML-RPC (SOAP) doesn't have (Score:1)
You're dead right about the size overhead of XML not being a problem. But the problem with XML is the performance of the standard parsers. XML parsers need to unde
You don't mention... (Score:5, Informative)
It's easily capable of representing objects, platform independent, encryptable (via SSL), compressable (via gzip [and probably SSL as well]), and textual.
The advantages of being textual in your protocols is well laid out in Eric Raymond's [catb.org] book The Art of Unix Programming [faqs.org]. He even treats it as a case study [faqs.org].
Re:Extensible? (Score:2, Informative)
NML (Score:5, Informative)
Does 6 rule out TCP? (Score:5, Interesting)
If you do end up writing your own UDP-based protocol, take some time to study TCP as well as other UDP based protocols and make sure you write something network friendly. There are a lot of naive protocols which fail spectacularly in less-than-perfect conditions.
Re:Does 6 rule out TCP? (Score:1)
Think before UDPing (Score:2)
Also udps message size limit of 64k might be limiting..
#6 is not a killer (Score:2, Interesting)
Recommending Gled as a C++ solution (Score:1)
It is in early stages of desing and development, but is fully fucntional and comes with a complete toolkit and devloping framework, including a C++ interpreter (ROOTCINT [root.cern.ch]), visualisation, object collection introspection and streaming interfaces from ROOT [root.cern.ch], autogenerated GUI for system and user C++ classes, object-collection monitor, cluster infrastructure using a hierarchical OO RPC system and visualisation w
RPC is rarely worth the trouble. (Score:3, Informative)
RPC causes untold security/authentication headaches and is often hard to program with besides.
See ESR [faqs.org]
Try Twisted maybe (Score:2, Interesting)
http://www.twistedmatrix.com/products
Haven't used it myself yet, but from the specs it seems to cover everything you could need.
Re:Try Twisted maybe (Score:2)
Maybe an even better idea is Pyro [sourceforge.net]?
Or even Jabber (Score:2)
Clue (Score:3, Insightful)
The problem with RPC is that, to be useful at all, it has to be used where the function-call abstraction fails. In inter-process communication and (more so) in network communications, there are too many failure modes that just don't fit that abstraction, but that a reliable application needs to handle anyway.
The whole point of RPC is supposed to be that the code invoking them looks just like regular function calls. To be reliable, though, they need to be decorated with so much error handling junk that any such benefit is usually lost. You're better off with explicit message passing and a documented wire protocol. You need the latter anyway to have a debuggable application.
Re:Clue (Score:2)
Re:Clue (Score:2)
You're not paying attention. Lots of "systems like .NET
have been designed to solve" the problems. Those systems
always fail. The next person comes along and finds the
same problems, and says "I'm designing an RPC system...".
That's why we have so many.
Clue.
That, or they're all overkill (Score:2)
Do note that you can also substitute "anonymous client" with "corporation with a heck of a lot of red tape".
As another post in this thread [slashdot.org] has already well put, SOAP is the compromise product of a number of these giant corporations. It doesn't do nearly so well when you
Take a look at CORBA (Score:3, Informative)
Re:Take a look at CORBA (Score:2)
SunRPC ;) (Score:3, Interesting)
It doesnt have 1. though that depends on what you mean by
"object oriented". I sense you want do export your C++ objects
It is somewhat lacking in 4 and 5 , though GSS-RPC will give you both. It is also not that difficult to implement authentication providers for sunrpc.. And for those that hate the portmapper, you don't have to use it. Another + is that it's small and fast. And you can do rpc over unix domain sockets, easing the pain to create custom protocols for interproces communication on the local box.
Java: try RMI or Jini (Score:2)
Do We Really Need Another Program? (Score:2)
Do We Really Need Another Program? We have so many already... thousands... millions!
I do not think it is a good idea to try to create one "mechanism" providing options along the dimensions of security, performance, reliability, simplicity, portability, expandability, elegance, extensibility, etc, etc. If "separation of concerns" and "aspect oriented design" is still trendy, then I use that as proof by reference.
Larry
#6 (Score:3, Insightful)
The problem is your requirements (Score:3, Insightful)
All this overhead also will take resources. So whats is it exactly youre working on that needs RPCs? Most networked applications Ive seen doesnt need RPCs, especially ones that are secure and efficient.
Try zeroc's ICE (Score:1, Informative)
You should have a look at zeroC [zeroc.com]. I haven't used it but have had very good reports about it. Plus the licensing is purely volume based or free if your product is open source.
http over udp? (Score:2)
Something like:
COMMAND: getStockQuote
PARAM COUNT: 1 PARAM 1: MSFT END COMMAND
This is the basic principal of POP3 / SMTP and could be extended to allow for RPC. Each side would have to know
Why OO? You can add it on your side (Score:1)
ICE? (Score:1, Redundant)
Message Queuing Server? (Score:4, Informative)
some type of message queuing server, like IBM Websphere MQ, or equivelant.
As a mental exercise, and to make sure I'm not talking out my ass, let's run down your list of requirements:
equirements are:
1. object oriented
Well, in the case of Websphere MQ, I'd say "yes" to this one, at least partially. There is a C++ based client library, IIRC, a (IBM specific) Java client library, and a JMS client. And even if the client libraries weren't OO, you could write OO wrappers for procedural calls more easily than writing your own RPC mechanism from scratch, I think.
2. extensible
Check. If you use pub/sub messaging instead of point to point messaging, even more so. And if you use a message type (MapMessage in JMS) that is based on name / value pairs, it's easy to extend your messages without breaking backwards compatibility.
3. platform independent
Not completely, but with both Java and C++ clients available, you should be able to support most everything.
4. supports signatures for integrity and sender checking
Not sure if it has native support for signatures, but a signature can always be added to a message as a property.
5. supports privacy of the message contents (i.e. encryption)
Again, using Websphere MQ as an example, it does support the use of SSL for communications, if that helps meet your requirements.
6. time sensitive: I should be able to detect a dead server and do failover while the user is waiting for the response
You're right, that's the tricky one. I think there are ways to achieve this goal using message passing servers, but it might take some work.
7. bandwidth efficient, as I am looking to deploy it in wireless environments
I think this requirement is met as well. Most messaging products support a message type that is nothing more than a stream of bytes that you interpret as you will... and even if you use a slightly move involved message type (MapMessage or StreamMessage to use JMS types as examples) you're still not carrying a lot of overhead.
Now #1-3 are no problem, #4 and #5 can be found, and #7 rules out anything XML-based. #6 seems to be the killer, as this rules out anything over TCP, and at that point the list gets pretty short.
Depending on just how "time sensitive" #6 really is, I do think you could come up with a solution using a message passing server. If you're able to use Java for the clients, JMS makes doing an RPC style messaging very easy, using the QueueRequestor and TopicRequestor interfaces. And even if you can't use Java, it shouldn't be to hard to cook up your own request / reply mechanism, built on top of the messaging system.
JMS - Second this (Score:1)
Check out openjms:
http://openjms.sourceforge.net/
or the JBoss impl. for starts. Plus it's more fun that CORBA/DCOM/RMI.
Messaging (Score:2, Informative)
binary RPC (Score:2, Informative)
The reason I attended the conferences is that I have spent a lot of time developing a binary RPC mechanism. The method I use can be used in messages (eg
What Programming Language? (Score:1)
You're looking for an Object Oriented RPC language but you forget to tell us what language you're actually coding for. Objects in C++ are very different from Objects in Java, Python
Also, to get better input it'd by nice to know why exactly you need an RPC! Perhaps you have chosen to have one to solve your problems?
Regards!
Re:What Programming Language? (Score:1)
I need the mechanism to communicate between nodes in a distributed telecommunications-type application. I opted for looking at one RPC mechanism rather than invent a slew of new protocols.
Re:What Programming Language? (Score:1)
Re:What Programming Language? (Score:1)
Re:What Programming Language? (Score:1)
It would have been really great if you mentioned the protocols you have already ruled out and the ones you are considering. Best of luck to your project!
CORBA or RMI/IIOP (Score:3, Informative)
RMI is also a nice spec. Contrary to popular belief RMI is not a wire protocol but simply a spec for an RPC interface. The standard implementation uses a specific wire protocol and is tied to Java. However, RMI/IIOP also comes standard and is transparently interoperable with CORBA. I'm sure if you wanted to you could write your own transport implementation.
XML-RPC and SOAP are not really OO RPC mechanisms (despite SOAP containing the word "object" in it). SOAP is a bloated compromise spec created by committee by a few large players in the industry to satisfy all their requirements, and hence does not really enforce any sort of object or typing system. Already I see people addled by XML-think outright proposing this protocols. If it fits your project go for it, but XML is not the panacea people think it is.
Re:CORBA or RMI/IIOP (Score:3, Informative)
Actually it doesn't contain the word "object" anymore, since W3 realized that the original name "Simple Object Access Protocol" was a bit misleading and the newest version of the spec does not expand the acronum anymore. So now SOAP is just SOAP :)
Take a look at Ice (Score:2, Redundant)
Endian-ness (Score:3, Interesting)
It can be a real pain when the underlying communication protocol blindly assumes endian-ness is the same on every machine. I prefer text-based protocols because they alleviate that problem.
Check out RO... (Score:2)
Check out RemObjects [remobjects.com]. It's really a brilliant piece of software and is the first RPC development system I've used that's been a real joy to work with.
QNX messaging (Score:2)
QNX messaging reliably passes an arbitrary-length string of bytes from a client to a server, waits for a response, and returns another arbitrary-length string of bytes from the server. This is the basic primitive of the QNX operating system. Everything, including I/O, uses it. It's integrated with scheduling, so if you do a MsgSend to another process that's waiting in a MsgReceive,
WTFO? (Score:1)
Alternatively, you could use HTTP and set the refresh time-out to automatically poll the server for refreshes. Send your data in HTML/WML/xHTML/cHTML/whatever and let the client deal with interpreting it. Mod your client to provide a default error page if the refresh times out.
Done.
CORBA (Score:2, Informative)
> 1. object oriented
CORBA is definitely object-oriented. Much better than XML and SOAP (SOAP is -NOT- OO at all). I love the fact that once you have a reference to an object, it does not matter where that object is.
> 2. extensible
Yes. There are many useful (and optional) services available for CORBA. You don't pay for what you don't use with CORBA, so if you don't require a Naming Service or a Transaction Service, you don't have to include
Re:CORBA (Score:1)
I wouldn't say "heaven" myself
- the insanely complex C++ mapping
- bloated and complex run-time APIs
- inefficient protocol
- far too complex type system
- missing features
- inefficient a
"A New Approach to Object-Oriented Middleware" (Score:1)