Graph database powers Onefinestay’s room accommodation platform
Innovative business models are a major driver of new Web applications. Increasingly, they are accompanied by similarly innovative data architectures. For example, as London-based Onefinestay rolled out updates to an online platform for booking vacation stays in private homes from London to Los Angeles, its technology leaders opted to employ a graph database.
The roots of the graph DB decision are in the hospitality company’s unique business mission. While a conventional hotel manages standard room accommodations, such as beds, baths, sheets and towels, the upscale boutique approach of Onefinestay works with a more diverse inventory of occasionally empty, upscale homes.
“It was obvious there were deficiencies with standard SQL models around the flexibility of describing the homes,” said Jackson Hull, chief technology officer (CTO) for Onefinestay. “The crux of the problem is we have an inventory of homes, but no two homes are alike.”
The wide variety of characteristics and relationships in the structures in Onefinestay’s housing pool — some as mundane as where the linens are kept — are a difficult match for a conventional relational database, especially with listings constantly expanding.
To keep the Onefinestay innovation engine humming, Hull turned to new graph database technology. Hull said Onefinestay selected the Neo4j graph database from San Mateo, Calif.-based Neo Technology Inc., after assessing several NoSQL database approaches as well as SQL-based in-database graph stores.
Strong open-source support in the form of a Neo4j developer community was a major factor in the selection, he said. As part of a seven-week research and design process, Onefinestay developers went to Neo4j meetups, where they got to kick the tires of the open-source software before starting a six-week implementation project.
What is a graph database?
Graph databases have risen to attention, along with other diverse NoSQL data bases, although they have an antecedent in mathematical graph models, such as Bayesiannetworks that go back to the 1980s, if not further.
The crux of the problem is we have an inventory of homes, but no two homes are alike.
The graph database emphasizes adjacencies of data nodes, focusing on the interconnectedness of data elements. Recent commercial graph databases from Neo Technologies, Franz Inc., Objectivity and others support atomicity, consistency, isolation, and durability (ACID) transactional data traits. A graph processing system called Apache Giraph underlies Facebook’s now-familiar friends networks.
The graph database supports a data architect that is not fully defined at the outset, and which can be easily altered as time goes by, according to Onefinestay’s Hull. He described Neo4J as “infinitely extensible.”
That trait can be seen in contrast to established relational databases, which can be time-consuming to extend once they are built.
“You can’t think of all the questions people have ahead of time,” said Hull. Customers querying the Onefinestay site may ask “Where’s the bedroom?” or “Where’s the bathroom?” as they consider homes. The graph DB can create relationships between such things as rooms in homes, or linens and closets, he said.
Meetups and brainstorms
As a Web-era technology project leader, Hull is mindful of the ways of open source. Hull said that the Neo4j database “aligns very well with our engineering culture, more so than some other commercial offerings.”
“We run a very flat team structure. The developers went out to meetups, thought [Neo4j] was cool, and they naturally introduced it in our project brainstorming,” he said. “I’ve been to the meetups as well.”
He said there were conceptual challenges in taking on graph database development. One clear challenge was the fact that the Onefinestay team had to learn a whole new querying language, known as Cypher. For a time, the graph DB application ran alongside its legacy predecessor, a home-grown files system that lagged in flexibility and ability to support fast queries.
Hull said his team interacted with Cypher and Neo4j, using software libraries specialized for use with Python, a preferred development language in the Onefinestay shop. He said his team has tapped into open source projects, and has in turn contributed software of its own back to open source as well. An example of that is a graph-based object framework for persistence built on top of Neo4j.