lesscode.org


The pragmatic’s guide to Web architectures  

By Assaf Arkin under Then you win. on 27. March 2006

There’s a big battle of words raging on to define what the hell we’re doing and why we’re doing it all wrong.

Are Web services on the Web, or do they have to use SOAP? How is low REST different from high REST? Does XML/HTTP work better if we call it POX? When is AJAX not AJAX? Who owns the semantic landscape?

There are also a lot of people building applications, that don’t have time to argue how you call it or what it means, just as long as it works. We call them, “the pragmatics.” This post is for them.

When it comes to designing Web services, there’s a few choices of architecture style, and stacks of technologies to choose from. It’s still undecided which one will rule them all, the race if far from over. Most people who write about that stuff hope their horse is the winning one.

I’m no exception. So I’m going to play pundit and tell you which architecture style I think works best for the Web, which technology stack I prefer to use:

  • Architecture style: use the simplest most common solution to solve your problem.
  • Technology stack: see above.

XML over HTTP (can we please not use an acronym that means a disease?) is great for moving structured data around, and shines at encapsulation. Its loosely coupled document style has too many merits to mention. Except when you’re building a UI that needs to talk back to the server, where tight coupling is good enough, and too much abstraction means you’ll never deliver on time.

RSS is a wonderful way to stream data updates from server to client, not to mention the magical combination that are blogs and feed readers. It’s the ultimate query API. Except when your UI is trying to query the number of unread e-mails in your inbox, and you find out that RSS is anything but simple.

Microformats are amazing in their beauty and simplicity, and let you easily microchunk your content. Until you fall in the 80% of problems they were never intended to solve and… well, just don’t solve.

JSON (not to be confused with Jason, though they both love AJAX) is the simplest form of API you can think of, concise and easy to use. It’s a wonder it wasn’t invented earlier. Except that it’s tightly coupled and still envious of what XML can do for you.

AJAX is great even though almost everybody is using it for HTML. But let’s not get too tangled up in detail, acronyms are not for describing but for branding.

There’s nothing like REST, it powers the Web (can we get a logo for that?). You’ll just have to ignore all those big name Web sites we all like to mention that use cookies for the benefit of their users. And all the REST APIs that violate more constraints than a drunk driver speeding down the wrong side of the road.

RDF is semantic bliss, it gets semantics right and has a thoughtful model for representing and querying it. You can do amazing things with it. But most likely your semantic data is not RDF, and still happens to work, and you’re cursing every time you need to fix Firefox configuration files in all their semantic glory.

The Web thrives not because it uses a strict architectural style and a coherent technology stack. It thrives because so many sites pay little attention to REST and choose to focus on their users instead. It thrives because malformed HTML pages include GIFs and PNGs and Flash and badly written JavaScript that just works. It thrives because people go on the Web to send e-mail, IM, do VoIP and trade BitTorrent files.

The search for the holy grail, the one technology to rule them all, is as old as technology itself. I’m fine knowing we’ll never settle the score, never know whether vi is truely better than Emacs, or whether Eclipse shadows them both. But unless you’re a vendor making money on one horse, it doesn’t matter to you.

If you’re a pragmatic developer, you have one tool in your toolbelt that always wins the day. It’s the ability to think, ask questions and make choices. To choose solutions that are best for the problem you’re tackling right now. And to keep learning. Because there will always be some new technology that’s better at solving some use case or another.

The only architecture that matters is the simplest one you can get to solve the problem at hand.

This post: written in Vim, formatted as HTML, available over RSS.

14 Responses to “The pragmatic’s guide to Web architectures”

  1. Danno:

    Hrm… I kind of disagree:

    The way I think of things, we’ve got four quarters we can divide these technologies into:

    simple
    complicated
    dirty
    clean

    Right now, the web is simple and dirty. It’s simple because we’re dumb and lazy and it’s dirty because we don’t know any better.

    The WS-Whateverthehells are complicated, dirty, clean, whatever. Complicated failes every time because I’ve gotta unwrap an envelope… what the FUCK is an envelope? Fuck that noise.

    The High Rest web promises to clean up the simple web. That’s the vision I see. It’s saying, hey, you think THIS is simple? Check out how simple things are when you’ve got a really clean conceptual model doing the heavy lifting instead of simple hacks patching your stuff together.

    Well, that’s what I hope anyway.

    comment at 27. March 2006

  2. Laurent Szyster:

    RDF is semantic bliss, it gets semantics right and has a thoughtful model for representing and querying it. You can do amazing things with it.

    Amazing things? Which one?

    But most likely your semantic data is not RDF, and still happens to work, and you’re cursing every time you need to fix Firefox configuration files in all their semantic glory.

    That’s a better description of what RDF really is.

    Complicated.

    comment at 27. March 2006

  3. Obie Fernandez:

    Refreshing Advice

    From a recent essay at lesscode.org : “If you’re a pragmatic developer, you have one tool in your toolbelt that always wins the day. It’s the ability to think, ask questions and make choices. To choose solutions that are best for the problem you?re…

    trackback at 27. March 2006

  4. Labnotes » Blog Archive » The pragmatic’s guide to Web architectures:

    […] I’m no exception. So I’m going to play pundit and tell you which architecture style I think works best for the Web, which technology stack I prefer to use … Read the rest of the post here. […]

    pingback at 27. March 2006

  5. Matt:

    I like how the guy preaching simplicity writes his posts in vim.

    comment at 30. March 2006

  6. InformIT XML and Web Services Reference Guide:

    Programming without the hype

    Finally, someone says what I’ve been thinking. It all the hype about all the different architectural styles, there’s really only one lesson you need to know, and Assaf Arkin put it best this morning:

    trackback at 31. March 2006

  7. alexking.org: Blog > Around the web:

    […] The pragmatic’s guide to Web architectures […]

    pingback at 03. April 2006

  8. Web Services Notebook » Blog Archive » Daily Bookmarks - 06 April 2006:

    […] The pragmatic’s guide to Web architectures Some practical considerations about web architectures (Tagged with architecture, development, programming and webservices, 2006-04-05 16:18) […]

    pingback at 06. April 2006

  9. Benjamin:

    Pragmatism for web-development and design is definetely where it’s at for getting things done in a tidy and eleganet manner. Thumbs up!

    comment at 11. April 2006

  10. Aristotle Pagaltzis:

    Matt:

    I like how the guy preaching simplicity writes his posts in vim.

    ED! ED! ED IS THE STANDARD!!!

    comment at 12. April 2006

  11. James:

    I like how the guy preaching simplicity writes his posts in vim.

    Ah. Define “simplicity.”

    It’s one of those words, such as “fair”, “beautiful”, and “right”, that people let slip as though there were an objective, easily grasped, meaning shared by all readers.

    comment at 15. April 2006

  12. assaf:

    I guess simplicity is one of those “I know it when I see it” words.

    I use Vim because it’s simple. Vim is a lot of things, but one thing it’s definitely not is easy. Tools make the complex stuff easy, simple avoids complexity to begin with. As it turns out, the more I use Vim, the easiest it becomes. But complex things seem to only get more complicated the more you use them.

    So think of it as a bit of foresight.

    comment at 15. April 2006

  13. Like Your Work » Blog Archive » links for 2006-07-05:

    […] The pragmatic’s guide to Web architectures (tags: rest soap soa WebServices patterns architecture) […]

    pingback at 04. July 2006

  14. amperspective » Raise your hand if you’re a Pragmatist:

    […] Assaf Arkin has an interesting essay over at lesscode.org titled The pragmatic’s guide to Web architectures. […]

    pingback at 16. July 2006