I'm sure I picked this up in some pre-teen cafeteria, but it goes something like this: "Hey, you want a jam sandwich?", which is immediately followed by jamming two pieces of plain bread together and taunting the victim with it. Ah, the cruelty of youth. Certainly it's a bit of a broken metaphor for this discussion, but then again the subject itself is somewhat broken as well.
So you want to build some sort of web application. It really doesn't matter what it does per se - it could be a website about pets, astrology or even a (dreamy web 2.0) mashup between the two. (If pets only had opposable thumbs we'd be able to get them to SMS each other twitter messages all day). But in all seriousness, the first picture one comes up with looks something like this:
Now in this case one piece of bread is the web server and the other is the database. What goes in the middle? Most of the time we simply jam these together, with some random oozing stuff keeping it all together.
One thing that comes to mind is that the answer to the big question mark is multidimensional. Some fundamental dimensions to consider are:
- Tiering (1, 2, 3, n)
- Operating System(s)
- Programming Language(s)
Or are these really dimension reduced to:
Certainly this is all very coarse grained, but does it really matter which loaf of bread you choose to make a jam sandwich out of? When I go shopping at the supermarket, I pick up a loaf of generic not-quite-whole wheat bread, nothing too earthy. A reasonable compromise since people aged 4 to 40 have to be happy with it. Given that I come from a J2EE background, I suppose the analogy almost fits. Does this mean that Microsoft is to Wonder Bread as LAMP is to the loaf of gluten-free, hand ground, free trade wheat with hemp seeds that you bake in a solar oven made from recycled soda cans? (Rails must then be an artisan batard with a smug elitist attitude).
Frankly with SOA and things like [Ww]eb [Ss]ervices you can build jam sandwiches with each slice of bread being from any type of bread you like. I don't know about you, but a sandwich with once slice of pumpernickel and the other white is a little odd. To each their own. But like Burger King®, you can Have It Your Way®.
Ok, there is a point to all of this. When you start out considering the infrastructure and architecture of your spiffy web application, all it takes is a decision for one of your slices of bread and wham! spontaneous symmetry breaking occurs and almost always the rest of your "stack" automatically falls into line. As evil as generalities are, let's run with these and see if they are familiar: pick MySQL and you're almost certain to go LAMP top-to-bottom; pick Oracle and J2EE isn't too far behind; pick IIS and here comes .NET, SQL Server and all their friends.
What does this really mean then? Continue to make jam sandwiches with the bread you know and like. Don't get too wound up about your choices, or things get religious and then it's Shia vs. Sunni vs. Kurd (yes, trying to highlight the fifth anniversary of the US invasion of Iraq). Experiment every now and then, learn when the $5 loaf of premium bread makes sense and when you need little slices of baguette for finger food. Most importantly, however and whatever you do, know *why* you're doing it and do it well.
Now that I have managed to mix web application architecture, baking and Iraq into one big mess, I'll let things be.
N.B. The merit and choice of condiment(s) is left as an exercise to the reader.

Comments