Last week Facebook announced their vision of the Open Graph -- what they call "a more social web." Now that the dust has settled, it stands clear that if Facebook can pull this off it will be a transformative moment for the web.
There are many perspectives on Facebook's move[1] but what makes me most excited is that the announcement was ALL about graphs. From the Facebook Graph API to the Open Graph Protocol, it seems like you can't touch any part of Facebook without getting infected by graphs.
That's ok by me! And since I happen to dabble in graphs for a living, I thought I'd spend some time today picking apart the announcement and talk about how it relates to our corner of the world: graph databases.
Ait, let's get started: what is this Open Graph anyway?
The Open Graph is Facebook's name for all content on the web that "hooks into" the social graph. Examples include people, places, businesses and events. This is nothing more than the regular web content we've always used and loved (for example, a movie listing on IMDB) but it's annotated with structured information so that it can be related to other things in the social graph.
Ok, so what is the Facebook Graph API?
The Facebook Graph API is the interface through which an external software developer interacts with the Facebook service. It's an HTTP API[2] that produces and consumes Open Graph data, i.e. people, places, businesses and the connections between them.
Whenever you as a web developer want to have access to data inside Facebook (say, if you'd like to figure out the friend graph of a visitor), you access that data through the Graph API. Facebook is basically a huge, highly connected graph and the Graph API is the lens through which we mere mortals can view and manipulate it.
Fair enough, then finally what is the Open Graph Protocol?
The Open Graph Protocol is a standard way for website authors to tag their content as part of the Open Graph. Those web pages can then be consumed not only by web browsers (for rendering) but also by services like the social plugins and Facebook (for processing).
If the Open Graph Protocol catches on it will create an unparalleled platform of machine-processable web content. The vehicle for inducing this change is an ecosystem of social plugins that will give website developers a shitload of cool functionality -- if only they sprinkle some Open Graph markup in their pages. Facebook's bet is that these plugins are appealing enough to push site owners over the (admittedly fairly low) threshold to tag their content with Open Graph markup.Example: Let's say you have a website for tracking events such as concerts and book readings. The front page of the site is a chronological list of events. The markup for the front page consists of two things: the content (text saying "Dave Matthews Band") and then the markup (HTML tags and CSS elements saying "blue" and "font size x" or what not).
But there's a Band type in the current iteration of the Open Graph Protocol[3]. So what if you in addition to markup for presentation also added markup to say that the label "Dave Matthews Band" actually refers to a specific band in the Open Graph. Then you can add a social plugin, for example the "Like" button, to your front page, and that plugin can all of the sudden make sense of the content on your site.
When a visitor X to your site clicks "Like," the plugin knows to find the Open Graph content and throw that over the wire to the Facebook service. Suddenly all the friends of X see that X recommends checking out the upcoming Dave Matthews Band concert. Additionally, since your site has access to both the identity and location of X, you of course choose to highlight the events that are local to X as well as rank the events by popularity in amongst X's social graph.
Ok, so what's the bigger story here?
After taking all this in, two high-order bits stand out:
- Facebook is expanding the notion of the social graph to include not only people and their friends but everything of value in the digital world.
- Facebook is determined to capture how things are connected in that graph. Who is friends with whom? How are they friends? Who likes what? How much do they like it? All those questions are about relationships in the graph. Facebook believes they can derive great value from owning the answers to those questions.
This view of the web and of the world is important because now that we enter the age of Facebook, interacting with the Graph API and the Open Graph will be a common task. It will be as natural to the modern developer as storing shopping carts in MySQL tables was to the developer of the previous decade.
That doesn't mean MySQL will be displaced or that the Graph API even solves the same problem. It doesn't. But an entire generation of software developers will grow up and think natively in graphs. And that's a big deal.
How do graph databases and Neo4j relate to all this?
Graph databases are increasingly relevant in a world that's increasingly connected. Facebook's recent move is undeniably a significant step in that direction.
But that's obvious.
So let me dig a little deeper and take this perspective: Facebook seems to think (and I agree with) that in this decade a lot of the value in the web ecosystem will reside in the Open Graph layer. A substantial amount of that value will be captured by Facebook, much in the same way that Google through pagerank captured the value of the link graph of the previous decade.
Image shamelessly stolen from Chris Messina who wrote an excellent post on the Open Graph Protocol, image based on original work by martiniko.
But others clearly won't want to donate that precious information to Facebook. They want to store parts of the Open Graph locally and they want to augment it with their own data, because that's the value of their service.
Of course, that data -- either being directly graph-oriented or operating on graphs -- fits extremely well in a graph database. Why take the pain of squeezing a graph into a table? Especially when the reward for all your hard graph/table mapping work is that you can barely even analyze it! Generally speaking, a relational database breaks down (due to joins) when you try to traverse more than 2-3 hops in any non-trivial connected data set.
Instead, I think the trend will continue where developers migrate towards a data model that fits the natural form of the data they're working with. In this case a graph database. Especially if that graph database is a robust and mature technology like Neo4j with years of solid 24/7 production track record and performance numbers on a level where it can traverse 1-2 MILLION hops per second in a graph.
Oh and wouldn't it also be neat if you could interact with all that data in your local graph and the Facebook graph in a uniform manner? Say, through the same API? Why, that'd be a neat addition to a graph database...
Conclusion
In conclusion, this announcement reinforces the fact that we're moving to a highly connected world. A world where the value lies in how things are connected. This megatrend has so far been mostly visible in the social web space.
But Facebook's gauntlet has been thrown: the Open Graph connects everything of value in the digital world. As Facebook's march towards dominance begins, developers around the world take notice that the natural and most powerful data model for anything web, really anything at all, is a graph.
It's a good time to be in the graph database space.
1] Not the least which is the implications it has for privacy and centralization of power, of course. But I'll try to stand clear of that or it'll take another ten pages before I get to how this all relates to graph databases.
2] The API uses HTTP but it's not fully RESTful. For example, it chooses to expose the identifiers of the connections and then the client use a predefined URI scheme to figure out the final URI of the connection. A RESTful API would use hypermedia to directly link the connection URI.
3] Astute readers will observe that there's a gap here. Who defines these types? Top-down or bottom-up? If bottom-up (as indicated in the spec), how do you define semantic equivalence? There's a lot unsolved (or unrevealed) parts about how all this will be governed.
oOo
It would be awesome when/if you get Neo4J to work as a truly distributed graph DB like this - http://www.cloudera.com/blog/2010/03/how-raytheon-researchers-are-using-hadoop-to-build-a-scalable-distributed-triple-store/
Posted by: Ashwin Jayaprakash | Friday, April 30, 2010 at 03:25
Sounds cool. But can or will NEO4J in the future, dock in with the Facebook nodespace and seamlessly display properties from the two (or more) nodespaces in a common interface?
Posted by: Stefan Windh | Friday, April 30, 2010 at 08:37
Great post. Translated into spanish: http://versae.es/bases-de-datos-graficas-y-el-open-graph-de-fa
Posted by: versae | Monday, May 17, 2010 at 19:24
Here's a Facebook + Neo4j mashup example including working code: http://blog.neo4j.org/2010/05/mashups-with-facebook-graph-api-and.html Time for the MovieNight recommendation engine with Neo4j and the Facebook Graph in tandem!
Posted by: Anders Nawroth | Tuesday, May 18, 2010 at 16:49
Nice debate love to read your post and will bookamrk thanks :)
Posted by: Facebook Applications | Friday, June 24, 2011 at 13:43
Good read. There is currently quite a lot of information around this subject on the net and some are most defintely better than others. You have caught the detail here just right which makes for a refreshing change
Posted by: Facebook Game Company | Tuesday, August 02, 2011 at 05:13
Great post! Expect the default behavior to improve as browsers compete to provide the best experience!!
Posted by: Martin | Tuesday, August 09, 2011 at 03:11
I like your website. Thank you for great information. I will come back to your website again.
best regards
Posted by: pc game | Tuesday, August 23, 2011 at 10:36
Very helpful site for the facebook users.An facebook application programming interface (API) is a particular set of rules ('code') and specifications that software programs can follow to communicate with each other. It serves as an interface between different software programs and facilitates their interaction, similar to the way the user interface facilitates interaction between humans and computers.Facebook development make human life very interactive for the users at diffrentnt locations.
Posted by: Facebook Development | Tuesday, August 23, 2011 at 12:44
Never thought that it was this simple after all. I had spent a good deal of my time looking for someone to explain this subject clearly and you’re the only one that ever did that.
Posted by: Facebook Developer | Tuesday, September 06, 2011 at 09:18
Thank you very much for your very thoughtful and considered comment. I approach the journey in very much the same way as you've described yours.
Posted by: Coach outlet | Wednesday, September 07, 2011 at 08:46
Emil, Great post! I have implemented the Facebook Open Graph api on my site in conjunction with a Like button that will allow people to like individual pages on my site. I think I have a fairly good grasp on what the benefits are, but the documentation for OG seems really code heavy and not very practical.
Do you know of any tutorials that have more real-world examples of what you can do with OG? The IMDB example is clear enough, but what about webmasters who run huge sites with multiple topics about real world items? Open Graph wants us to just list our site as "website" and pages as "article" but it seems like there should be the ability to have a designation for the "item" that the "article" is about in order for the information to be searchable based on what "it" is and not just "article"
Posted by: Wayne Landerson | Friday, October 07, 2011 at 01:42
Thanks for the interesting information and for providing topic of my interest.The Facebook Graph API is great and in one year has thoroughly upgraded Facebook’s approach to its platform. The Graph API is much simpler than previous iterations of Facebook’s APIs and Connection methods. Of course, with the simplicity of the Graph API, it’s still easy to get overwhelmed by just how much information you can easily (with explicit and secure user permission, mind you) get access to and use in your apps.
Posted by: Facebook Application Development | Monday, November 21, 2011 at 06:07
[edit - moderator please remove last comment]
Great article thanks!
I'm checking out Neo4J as I write this (awaiting the build after upping my cloud instance to 1GB).
Purely out of curiosity, does anyone know exactly which graph DB Facebook uses?
I've been searching of course, but it's either a secret, or a needle in a haystack.
Posted by: Atom_zen | Thursday, January 05, 2012 at 04:51
Wow! I love this!*
Posted by: see through toaster | Wednesday, January 18, 2012 at 17:44
Great content posted in this blog. I really appreciate the effort involved in this post. keep it up..
Posted by: seo forums | Tuesday, January 24, 2012 at 06:14