1. Jul 8th, 2008

    REST in the front, RPC in the back

    Let’s see. We’ve got the newly released Protocol Buffers, courtesy of Google. I’m guessing to counter-weight Facebook’s Thrift? Guess who else has RPC? Hadoop, of Yahoo fame. And so does Cisco, with Etch.

    What do all four have in common? A thirst for bandwidth and big networks for one. Also, a keen interest in social software networking. Yes, Cisco too.

    Waiting for the MySpace shoe to drop.

    I don’t know if the interest in social networking is indicative or just a coincidence, but if you like to explore the soft (as in human) side of software, I’d start there. It might tell us more about this renewed interest than any discussion over network fallacies and architecture styles.

    Don’t shave this Yak

    At least three of these companies are doing REST big time. We’re talking breadth, billions of pages served, and depth, both UIs, APIs and crawlers.

    Still, convenience over correctness. (Apologies, Steve, I owe you beer)

    I’m working on an interesting project right now. We want to make sure the front-end scales, and by scale I don’t mean page views, but the ability to lay different clients and usage patterns on top of it. It has to be human-facing too (doh), so REST is given. And REST does machine-machine very well, so there’s no reason to use anything but.

    There’s also some back-end processing going on, and I think that part is using DRb for now. But maybe the next update it will switch over to RMI or UNIX pipes or whatever. I don’t much care because the library does the talking, and besides, it’s only distributed in the sense that we have two pieces of code running with different PIDs. Not particularly important what’s happening on the wire, as long as it’s fast.

    Convenience.

    And I’m going to bet this is not an edge case. And I’m not the first, if anything, I’m fashionably late to this party. If you’re working with Ruby, you’re probably already running REST in the front and RPC in the back and not giving it a second though. Other languages too.

    Of course you can’t have an architecture, no matter how banal or obvious, without picking up a name for it. How else would you draw a diagram? So I’ll call this one Rullet. It should be obvious why.

    No SOAP touching my Rullet!

    As much as we’d hate to admit it — can’t we all just get along? — protocol stacks are a zero sum game. You’re spending all this energy building a fancy UI, and you look at the framework, and it winks at you: “hey, buddy, add a line here, I’ll throw in the API for free”. Sure.

    We’re all lazy and you wouldn’t want to build the same stuff twice, and you get more out of REST anyway, so why SOAP? Frameworks that do REST well don’t leave room for SOAP in the front.

    That part is convenience. The other part is convenience, too. Don’t care what happens in the back, as long as I don’t have to use tools that suck the life out of me. And given the options, SOAP is not necessarily the best preference.

    I don’t consider two machines strapped together with an ethernet cable (or any N>1 extrapolation of that) as an interesting distributed problem requiring more thinking that whatever RPC happens easily to me.

    Just let it grow

    Here’s another thing that’s common to Protocol Buffers, Thrift and Etch.

    REST is all about the protocol: many in theory, HTTP in practice. Besides, most people looking at REST are actually obsessing over the HTTP parts, not the hypermedia, so I’ll sin for a minute and lump them both together. SOAP is all about the protocol: it solved CORBA by thoughtfully mixing XML with HTTP.

    Those all happened a decade ago. What else happened a decade ago? A lot of people obsessing over interoperability and fearing vendor dominance. So we got coopetition, and enough working groups to fill up the yellow pages.

    From SOAP we learned two lessons. One, don’t pick an acronym that’s supposed to stand for something. The other, premature standardization is the root of all evil.

    Check those press releases again. There’s no mention of fast tracking anything through the W3C, OASIS or IETF. Working groups might happen, but they’re not where the action is. If you want a dance partner for this party, bring some code.

    Thirft does C++, C#, Erlang, Haskell, Java, Objective C, OCaml, Perl, PHP, Python, Ruby, and Squeakr. Phew. Etch does C# and Java, and promises Ruby, Python and C. Protocol Buffer does all the three Google languages, but I wouldn’t worry about the small set size. Give it a week. I bet twenty projects started to fill the gap before I’m done writing this post.

    And don’t forget JSON(-RPC) which is ramping up language support, even without big vendor help.

    If your language is easily supported, the runtime fits on a floppy disk, and it costs $0 in licensing and support contracts, do you care what the protocol looks like?

    I don’t.

    Interesting thing is happening in the post-SOAP world. RPC is no longer a protocol. RPC is the absence of one.

    Which is not entirely a bad thing when all you care for is convenience. REST in the front, RPC in the back. It might be ugly, but if it just works …

    1. Jul 8th, 2008

      Patrick Mueller

      Of course, anyone with an app that uses an out-of-process DB (ie, not SQLite, Berkeley, etc) is already using an RPC on the back-end. Called your database driver. Attempts at HTTP-izing, REST-izing the DB driver are interesting, but not clear they provide any super value.

    2. Jul 8th, 2008

      Assaf

      I certainly don’t care which RPC mechanism my database connector is using, but I think that comes from years of working with databases and just accepting it as immutable fact.

      If I decided to write a new database from scratch, I would do the same as CouchDB, and pick JSON and REST. Why?

      I wouldn’t have to worry about writing drivers and plugging them to different languages and maintaining all the different drivers and their quirks. We take for granted that it just works when we use Oracle or MySQL, but the early years these were painful. Different platforms had different bugs, and some companies (I worked on a such project) paid dearly to write drivers to support their platform.

      I don’t have to reinvent things like client-side caching or method semantics, HTTP already does that.

      I have existing solutions that deal with caching, proxying, security, load balancing, all that good stuff. I used MySQL for years, still don’t know how to run more than one server. I’ve yet to actually use CouchDB, but I already know how to put a load balancer in front of it!

      And of course, I can easily expose it as a storage service, on the cloud or behind the firewall.

      So if my client is decoupled from the service, I would opt to use REST, it pays in the long run, even in places it wasn’t done historically (you live, you learn). If my client is tightly coupled from the service, most often I’ll gravitate towards convenience.

    3. Jul 10th, 2008

      Labnotes » 10-70

      [...] RPC you use will come to bite you when you least have time to deal with it. Which is why I think Rullet is such a fitting [...]

    4. Aug 15th, 2008

      Labnotes » RPC taking over the Web

      [...] only is RPC the new cool, it’s also taking over the Web. Give it enough time and RPC will author the Web once over. [...]

    Your comment, here ⇓

    Or using OpenID