Understanding Unicorn: A deep dive into Facebook's Graph Search



MENLO PARK, CALIF. -- On the surface, Facebook's new Graph Search is touted as a new method to enable more connections between people and content worldwide.



Soren Lassen, manager of the search infrastructure team at Facebook, described that "in computer science speak," the Social Graph is a graph data structure involving an "immense map" of people, places, and things and the connections between them.

Because there's a lot of inherent structure to a graph, Curtiss posited that "what would be really cool is if we help people find entirely new haystacks."

"Graph Search was a particularly fascinating opportunity to do something new in the sense that we had a unique and different social set and structure," said Lassen.

With more than one billion active members, Facebook hosts approximately 240 billion photos with 350 million more added every day. The data only continues to expand exponentially with 2.7 billion likes and 2.5 billion items of content shared daily.

Lassen commented that "natural language is very expressive." Thus, one of the principle uses of Graph Search is to ask natural questions about the Social Graph through proper nouns.

Glossing over some of the technical jargon, Facebook software engineer Mike Curtiss continued that Graph Search was "designed from the ground up" to enable users to find nodes in the Social Graph connected to other nodes.

At the heart of Graph Search is this infrastructure dubbed "Unicorn," which is similar to a standard search engine in that it supports common search queries.

But Curtiss stipulated that Unicorn is unique because it supports multi-hop queries that are issued in a series of steps.

He highlighted that there are numbers connected to nodes, which are similar to keywords in a search engine. Curtiss explained they serve a similar role, but these nodes have a numerical structure to them connecting them to the semantics of the Social Graph.

Here's an example of how Graph Search works, according to Curtiss.

Say Curtiss is moving to New York City in a few weeks. He said it would be helpful for him to find which of his Facebook friends live there.

"It's kind of like the flux capacitor," Curtiss quipped, referencing the fictional technology from the film "Back To The Future" that supposedly made time travel possible. "The Apply Operator is what makes Graph Search possible."

The Graph Search process starts with nodes for his friends and then traverses his friend connections, or "edges." Those individuals are connected to him through the "via-friend" edge and "lives-in" edge for New York City.

Curtiss expanded the query to "my friends who live in New York and like Downton Abbey." From here, there was one individual that matched all three constraints: friend connection, lives in New York and likes Downton Abbey.

"This is where things start to get really interesting," said Curtiss. "What I've shown so far is you can apply basic search techniques to the Social Graph. That's a cool idea in itself, but there's more that you can do."


Curtiss explained that means Facebook wanted people to be able to search for both things that they are already connected to but also to items not directly connected to them.

"You'll notice that for this query we just did, we're always a single hop from the initial node that started the query," Curtiss commented. "There's often a lot of interesting queries that require more than one consecutive hop."

Curtiss extended the scenario further to suggest that if he's moving to New York, he might be looking for a job. Thus, one thing he could do is find out more about the employers of his friends.

"The way we would do that is within Unicorn. Start at the node for me, traverse the friend edge, and from those nodes, we can hop to the companies that my companies my friends work at through another edge," Curtiss explained.

This leads into the second step of Unicorn, which Curtiss referred to as the "Apply Operator," which takes a set of input results and applies another query to those results.

Topics: Social Enterprise, Apps, Collaboration, Mobility, Software Development



zdnet_core.socialButton.googleLabel Contact Disclosure


Related Stories

The best of ZDNet, delivered

Subscription failed.