mvc – Stay N Alive

Twitter Launches Facebook Connect Competitor, @Anywhere

I’ve long talked about the MVC model of the Building Block web.  Data Repositories like Amazon Simple Storage, Facebook Data Store, Google Data, and others comprise the Model of this new platform.  APIs like the Twitter API, the Facebook server-side APIs, or other REST-type APIs compose the Controllers of this web.  Then you have the View – something pretty much only Facebook and OpenSocial/Google Friend Connect have covered thus far.  The View enables developers to easily integrate and access code from a user’s Client, the web browser.  Today Twitter added their entry to that game, @Anywhere.

@Anywhere strives to provide a solution for a huge weakness in the Twitter API Platform thus far.  It provides an entire Javascript, Client-side platform for developers and website owners to integrate Twitter easily and simply right on top of their website, no server-side code involved.  This is the missing link Twitter has needed to have a truly competitive solution against Facebook’s Connect platform.

Facebook Connect relies on Javascript to provide an immersive experience into the Facebook environment right on top of any website owner’s site.  With a few lines of Javascript, and an HTML-like tag language called XFBML, website owners can pretty much copy and paste pieces of code in place and immediately have access to comments, become a fan boxes, post to their stream, and even more if you know a little Javascript as well.  It’s unclear if Twitter will be releasing an XFBML competitor (I’d love to help Twitter test if this becomes the case – I wrote the book on Facebook’s FBML), but Twitter is clearly going up against Facebook Connect to provide similar type tools, and I think it’s a very smart move.

I mentioned earlier I was excited about the entry of Josh Elman as product manager at Twitter.  I’m unclear if he had anything to do with this, but you can clearly see the Facebook influence in Twitter’s new API.  With not only Josh, but several others from the Facebook team now working at Twitter, you can bet they’ve compared and contrasted how they could obtain some of the millions of Facebook developers out there.  Making it as easy as possible is the smartest way to do this, and Twitter has already signed on several very big players in the Facebook Connect space, Huffington Post and Yahoo, to be launch partners in this effort.

In addition to those, the most significant partner that I think should not be ignored is Amazon.  Amazon, IMO, is the holy grail in Social E-Commerce, and despite not having a Facebook Connect solution, they seem willing to integrate Twitter into their environment.  Why they are choosing Twitter over Facebook is beyond me – maybe they have a Facebook deal in the works as well?

I’m very excited about this new announcement.  Soon, it will be easy for any developer to very seamlessly, in a single, well-understood language (Javascript), integrate Facebook and Twitter all on a single website with little effort.  As a developer, I’m drooling a bit over this.  I can’t wait to start playing with it.

The Framework of the Building Block Web – An MVC Perspective

lego houseRecently I talked about the new web being that of “building blocks”, or “Lego bricks” setting the foundations for each application or website which encompasses the new internet.  Applications that embrace this new architecture will both embrace the strengths of other applications and technologies through third-party APIs, as well as provide their own in order to share their own strengths in the building block web.  The idea of the Building Block Web being that of empowering each app that uses your technology to now owning the strengths which you, the developer or entrepreneur or business can add to the puzzle.  I’d like to suggest an overall framework for how Building Block Web apps should be built.  The analogy to me makes sense, and builds off of traditional MVC (Model/View/Controller) models.

Building Block Web – the Model

Let’s talk Model.  The Model component of a traditional MVC framework is intended to provide the structure for abstract data access in a sense that your app never actually sees the underlying data architecture, but rather accesses it through a higher-level layer that can provide inheritance and simple methods for getting at that data.  In the Building Block Web we’re seeing this in the form of Cloud data stores and APIs.

Look at Amazon, for instance.  Amazon provides SimpleDB for abstract data access and storage into the cloud and easy retrieval of serialized information.  Amazon has even provided API methods around processing this information with Hadoop and Mapreduce data processing and crunching (although that could arguably be part of the Controller).  Amazon has provided S3 as a simple file storage and retrieval API.

Other traditional services are also providing their own data store APIs.  For instance, Facebook itself has its own Data store API allowing simple storage of meta information about users and things in its database.  The stream itself allows storage of meta-data with each stream item posted via the API, making the need to build traditional local architecture around social workflows less necessary for the developer.  A simple FQL call to Facebook will pull most of the information necessary from the service.

It should be noted that Google also provides similar services.  The spreadsheet API or even Gmail storage API can be used as simple data storage mechanisms.  Or, for more complex data storage and retrieval, AppEngine provides BigTable for that access, along with an entire API centered around storing, compiling, running code, and retrieving data with that code.  The entire AppEngine API itself is somewhat a Model-based Building Block architecture.

It’s interesting to see people try to compare just the Model component of the Building Block web architecture as Web 3.0.  It’s not – it’s only one component.

Building Block Web – the View

For a Building Block Web app or website to embrace all the components of the Building Block Web, it should also embrace a view of some sort.  Remember a View is code that the user interacts with, usually via a browser, and in the Building Block Web participants must provide components (or “blocks”) that sit at the user level reducing the work a developer needs to do to integrate the blocks into their own environment.  Facebook does this very well with its own internal Applications developers can write, as well as Facebook Connect, enabling developers to integrate  the Facebook environment in their own websites and applications outside of Facebook.

Facebook has provided XFBML and an entire Javascript Client library to enable, at the View, for developers to pull pieces of the Facebook architecture into their own websites and apps.  In addition, they have provided a way for developers to host apps right in the Facebook environment itself, giving an even more native approach to Building Block Web development.  Even the Authorization process is taken care of through the View.  Facebook provides simple HTML and Javascript code (or even an XFBML tag if you want to simplify it even further), and in just a few steps (or even copying and pasting through a Wizard), a popup login box will show up, right on your site, with no backend code necessary to log in the user. Facebook handles the authorization process all for you, giving a unique way to use a user’s Facebook credentials for login and authorization into using Facebook’s pieces of the Building Block Web.

Google does similar with OpenSocial.  Through simple Javascript, any OpenSocial-supported container can run OpenSocial apps.  While not quite as simple as Facebook to integrate into your own environment (due to the decentralization of it all, not a bad point for Google), across multiple environments you can write one simple app that uses Google’s standards to share that app, via simple View (aka Browser-side) code one can add to their environment of choice.  Add to that the ability to embed Waves into any environment, and the simplicity of Friend Connect for finding and communicating amongst users on a 3rd-party website, Google contributes to the View of the Building Block web as well.

It should be noted that Twitter has no View to contribute, and I think if they’re trying to compete against Google or Facebook in the new web they may suffer until they do so.

Building Block Web – the Controller

The Controller is the component of an application that controls the entire application.  It makes the calls to the Model, releases the View code to the browser, and is pretty much the brains of the entire application.  Twitter is mostly a Controller-based Building Block web brick.  When you write a Twitter app, you are writing mostly server-side code that accesses the Twitter API through your server.  No View bricks are provided, and there is no Model API at the moment.  Everything is handled at the application level, making the Twitter API a weak set of bricks in this new Web model.

Facebook also provides a Controller set of bricks through its own REST APIs.  As an application developers I can access the API fully on my own backend and the user never sees that part of the process.  I can even make calls on behalf of the user to do things like send notifications or process data (with the user’s previously given permission at the View level).  I can send data and retrieve data from the Model bricks of the Facebook building blocks.

Google also provides a REST layer to its OpenSocial protocols.  MySpace has implemented it, as has Orkut (I believe).  Developers can do similar things with the MySpace and Orkut APIs that they do Facebook, doing all the work behind the scenes.  The Application layer is critical at handling sensitive data that the user may not have access to.  It is a critical component of the Building Block Web.

Comparison of Various Building Block Web Bricks

I’m sure exceptions could be made for all of this, especially considering the entire idea behind the Building Block Web is that you should be able to mix and match.  For instance, I could technically take an Amazon SimpleDB brick and mix it with an iGoogle brick to give full MVC functionality.  However, this table summarizes the capabilities of various players in the space – note that the space is also much larger than this.  These are only some of the larger players:

Model

View

Controller

Facebook

TRUE

TRUE

TRUE

iGoogle

FALSE

TRUE

TRUE

Twitter

FALSE

FALSE

TRUE

Flickr

FALSE

FALSE

TRUE

MySpace

TRUE

TRUE

TRUE

Orkut

FALSE

TRUE

TRUE

AppEngine

TRUE

FALSE

TRUE

Amazon AWS

TRUE

FALSE

TRUE

Wave

FALSE

TRUE

TRUE

myYahoo

TRUE

TRUE

TRUE

If you’re building for the Building Block Web, you will have the most success finding ways to integrate all three elements of the MVC Building Block Framework.  The idea is to empower users and other businesses in as many ways as possible to fully utilize the strengths you can provide.  If you share graphics (like Flickr or SmugMug for instance), provide not only a REST API to read and post graphics, but a store API for storing meta data about those graphics, as well as a view for enabling developers to create their own wrappers around the graphics. (Note that SmugMug does this, in all 3 layers)

The Building Block Web is about empowering developers and businesses to use a new platform – a platform of platforms, to create, using each brick’s own strengths, their own applications.  Developers and business owners can then take their own strengths and add to that, enabling more bricks to the picture.  My hope is more apps can start to embrace the entire Building Block Web, and not just pieces of it.