You should build one backend that is capable of serving your application’s core data to several frontends, as shown in Figure 4-2.
Layered architecture diagrams always make me think of tasty cakes. This particular diagram makes me think of a tasty cake that comes in four excellent flavors but doesn’t cost the baker much more in baking time. It also makes me think of Mark Andreessen, founder of Netscape and now of OpenSocial partner Ning. If you read the Preface, this probably comes as no surprise. If you didn’t, you might find yourself grasping for a connection between a brilliant serial entrepreneur and baked goods. Look no further than this quote:
As you start planning your application, think about ways in which you can consolidate your business logic, backend code, and data so that your application server is fairly independent of the particular API you need to use to render a page. Although the calls required to display a friend selector, for example, won’t be the exact same on Facebook Platform as they are on OpenSocial, the data returned to your application will still be a selection of friends.
There’s a term that gets thrown around a lot in web development circles that always makes my sub-cockles itchy: future proof. The idea that we can design something today that will be able to withstand whatever the future may throw at it is to give ourselves far too much credit. (Unless you’re Danny Hillis, of course. Danny can give himself that much credit because he deserves it: anyone determined to build a clock that will last for 10,000 years on a hill in the Nevada desert gets pretty much all of my respect. See http://www.longnow.org/projects/clock/.)
At any rate, you don’t need your application to last for 10,000 years, but you do want to try to see around the next curve in the road. There was a time, not too long ago, when everyone thought that Friendster was the best thing since Sir Tim Berners-Lee invented sliced bread, but now it’s a relic of the past. If it had introduced a developer platform back when it was the flavor of the month, we might all still be Friendstering instead of Facebooking.
Following an architecture like the one described earlier frees you from being tied to something over which you have no control. Facebook has real momentum behind it now, so the risk is pretty low, but the Facebook team might also make a decision tomorrow about a new direction for Platform that could significantly affect the viability of your app. If you have no fallback strategy through other delivery channels, you have nothing.
 Thank you, Denis Leary.