Tag Archives: software

Flight Search with Neo4j

I think I am going to take the opportunity to explain why I love graphs in this blog post. I’m going to try to explain why looking at problems from the graph point of view opens you up to creative solutions and makes back-end development fun again. The context of our post is flight search, but our true mission is to figure out how to traverse a graph quickly and efficiently so we can apply our knowledge to other problems.

A long while back, I showed you different ways to model airline flight data. When it comes to modeling in graphs, the lesson to take away is that there is no right way. The optimal model is heavily dependent on the queries you want to ask. Just to prove the point, I’m going to show you yet another way to model the airline flight data that is truly optimized for flight search. If you recall, our last model looked like:
Continue reading

Tagged , , , , , , , , , , ,

Building a Twitter Clone with Neo4j – Part Seven

Alright, we’ve had enough back-end work on our Twitter Clone. Let’s switch gears and get to work on the front end. I’ve decided I’m going to use a Java micro framework for my front end, but if your language of choice is Ruby, Python, Go, or whatever, find an alternative library and follow along.

Continue reading

Tagged , , , , , , , , , , ,

Building a Twitter Clone with Neo4j – Part Six

We are getting close to wrapping up the back-end API for our Twitter clone, so thank you for sticking with this awfully long series since the beginning. One of the big community features of Twitter is the Trending Hashtags. It lets users know what is being talked about even if the people a user follows aren’t talking about it. It’s kind of weird in that way since part of the point of Twitter is following just a few hundred or thousand people to reduce the noise, and here we are bringing noise back in to our feed. Regardless, this is actually pretty easy to implement, so let’s have a crack at it.
Continue reading

Tagged , , , , , , ,

Building a Twitter Clone with Neo4j – Part Five

In part four, we continued cloning Twitter by adding hashtag and mentions functionality. Then we went beyond it by adding the ability to edit a post. So we have a social network where people can follow each other and post stuff. Today we’re adding the ability to say a user likes a post, reposts a post and the most important query of all, being finally able to see our feed or timeline.
Continue reading

Tagged , , , , , , ,

Building a Twitter Clone with Neo4j – Part Four

We left off last time having just added the ability to follow people, see who we’ve followed and has followed us, block and unblock people and finally see whom we have put on our naughty list of blocked users. So we have a social network where people can create relationships, but they have nothing to say because we haven’t implemented that yet!
Continue reading

Tagged , , , , , , , ,

Building a Twitter Clone with Neo4j – Part Three

In part two we defined our API and got registering a user, checking a user and getting a user profile. A social network of unconnected people doesn’t live up to its name, so let’s go ahead and build the ability to follow people.

Continue reading

Tagged , , , , , , , ,

Building a Twitter Clone with Neo4j – Part Two

One of the aspects of my job that I love is the week long proof of concept bootcamps. What it entail is me (or one of my team members) coming onsite to work with your team to build out a POC in just one week. They all vary some what, but I try to stick to a formula that works for me. I spend the first day with the whole team ironing out the Model. This is the trickiest part to get right, because if the model is right, the queries will fall right into place. If the model has to be changed significantly on day 3 let’s say, then a ton of work has to be redone or at least greatly modified. The goal of the end of day one is to have something that looks like the following:
Continue reading

Tagged , , , , , , , ,

Building a Twitter Clone with Neo4j – Part One

Would you believe there is no shortage of Twitter Clone example applications…maybe because they are easy to replicate (ba dum tss, I’ll be here all week.) The earliest one I remember was written by Salvatore Sanfilippo creator of Redis.
It’s a pretty good read, where he explains the basics of Redis (a Key Value store on steroids) and how to model a social network in it. One of the interesting bits to me is how the status updates (tweets) are handled.
Continue reading

Tagged , , , , , , , , ,

Searching for objects using multiple dimensions

Lets take a look at a scenario where you are trying to search for things by their attributes, not their description. They can be users, documents, or any object that could be described by discrete values in multiple dimensions. What does that mean exactly? Well, let me give you an example: searching for a dog. My family includes 2 four legged furry creatures named Tyler and Ronnie. They are my half lab, half golden retrievers. Dogs come in all shapes and sizes, from teacup breeds with adult weights around 5 lbs, to giant Mastiff breeds over 150 lbs. But most people don’t care exactly how much a dog weights, only their general size.


Continue reading

Tagged , , , , , , , , ,

Neo4j is faster than MySQL in performing recursive query

5mysql

A user on StackOverflow was wondering about the performance between Neo4j and MySQL for performing a recursive query. They started with Neo4j performing the query in 240 seconds. Then an optimized cypher query got them down to 40 seconds. Then I got them down to…
Continue reading

Tagged , , , , , , , , , , ,