Tag Archives: network

Finding your neighbors using Neo4j

In Mr. Rogers’ Neighborhood, the question “Won’t you be my neighbor?” is an invitation for somebody to be close to you. In graphs, it’s an invitation to traverse. The closest neighbors of a node are those reachable by a single relationship hop, but we can also consider nodes two, three or more hops away our neighbors as well. How can we find them in Neo4j? Using the “star”:
Continue reading

Tagged , , , , , , , , , ,

Building a Dating site with Neo4j – Part Twelve

It’s time to add “visions of love” to our dating site. So far our posts have been just text status updates and while it is possible to fall in love with someone’s words, it’s harder if they look like the troll that lives under the bridge. So what’s the plan here? Well… like most databases out there, it’s not a good idea to store images in Neo4j. What we are going to store instead is a link to where the image resides… but we also don’t want to deal with having images all over our file system and then having to worry about storage space and replicating them, geographically distributing them for faster access, etc. Hosting images is a problem solved by the use of Content Delivery Networks. So let’s leverage one and build our feature.
Continue reading

Tagged , , , , , , , , , ,

Building a Dating site with Neo4j – Part Ten

A few days ago I taught the Neo4j Modeling class in Dallas… well my own version of the class since I teach some of the older material plus some of my blog posts. If you ever get the chance, take the class, it will open your eyes at what is possible when “third normal form” gets thrown out the window and a whole new world of possibilities is before you. The next modeling class I’m teaching will be at Graph Connect in NYC on September 20-21, 2018. I recommend you join me, unless of course you are looking at this after it occurred, then catch the next one.
Continue reading

Tagged , , , , , , , , ,

Building a Dating site with Neo4j – Part Nine

Now that our users can high five and low five each other, we want to show the other person those high fives and low fives. Well…do we really want to show the low fives? I’m not sure. A few years ago we talked about how to store the people who “swiped left” on a user (aka the “asholes” of Tinder). In this case, the user is not rejecting a person forever, they are just putting down one of their posts. If it’s two people who are competing for dates, then maybe the low five has a negative intent, but it would make the person who wrote the post feel they are doing something right. If the low five was from a potential mate, it could be a case of “negging” ( which is stupid and you should never do that to people), it could be in jest if it was from someone they already had a conversation with, it could just have negative intent or maybe a clumsy tap on the wrong button. We don’t really know.
Continue reading

Tagged , , , , , , , , , ,

Building a Dating site with Neo4j – Part Eight

Up to this point we have a timeline of posts from people we want to date, but no way to interact with those people. The first step begins today as we will allow users to High Five and Low Five posts. Recall that once a user has high fived your post, you will be able to message them for up to 5 days when the high five expires. If you do not wish to message them, that’s fine, their high five gives you an additional high five to give to someone else in the hopes they message you. Remember that all users get 5 “free” High Fives a day, if they want more they have to earn them. You can get a High Five on a post that is older than 5 days, it still counts. This is needed to create the opportunity to bring back a user who hasn’t been to the dating site in a while with a High Five to an old Post. Otherwise after 5 days of inactivity, those users would be practically deleted.
Continue reading

Tagged , , , , , , , , ,

Building a Dating site with Neo4j – Part Six

Without posts, we can’t have High Fives and that defeats the purpose of our dating site, so it’s time to let our users post things. We want to allow two types of posts, text posts and image posts. Today we’re going to focus on text posts and getting them working and we’ll deal with images in another post. The first thing we want to do is prevent users from posting bad things. So we’re going to create a PostValidator to deal with the user input:
Continue reading

Tagged , , , , , , , ,

Building a Dating site with Neo4j – Part Five

You ever eaten at a “Fusion Cuisine” type of restaurant? It’s a bit of a gamble. Personally I’m always up for eating just about anything… except Pho. That stuff messes me up. But back to fusion cuisine. I think my favorite is Indian and Mexican. Take your favorite Indian dish, wrap that in the warm embrace that is a burrito tortilla, heaven. Well, just about anything wrapped in a burrito is perfect. Why am I taking about Fusion and Wrapping stuff? Well, today we are going to add Auto Complete into our Dating Site, but before we can do that I need to talk to you about Neo4j’s Fusion Indexes and how they wrap the Lucene Indexes as well as our generation-aware B+tree (GB+Tree) indexes.
Continue reading

Tagged , , , , , , , , , ,

Building a Dating site with Neo4j – Part Four

In the last post, we created a User model, built the login and registration pages, hooked everything up in our front end framework Jooby and got the ball rolling. I’m no designer so I am borrowing a Application Bootstrap Theme and tweaking that as we go along (if you are a designer, pull requests are welcomed). At this stage a ton of it is just mockup, but we will replace it with real functionality. This is what we have so far:
Continue reading

Tagged , , , , , , , ,

Building a Dating site with Neo4j – Part Two

We came up with an idea for a dating site and an initial model in Part One. Next we are going to work on a back end HTTP API, because I’m old school and that’s the way I like it. We will build our HTTP API right into Neo4j using an extension which turns Neo4j from a Server into a Service. Unlike last time where we wrote a clone of Twitter, I don’t really know where I’m going with this, so let’s start with some of the obvious API endpoints and then we can design and build more as we go along. Is this Agile or am I just being an idiot? I can’t tell, so onward we go.
Continue reading

Tagged , , , , , , , ,

Building a Dating site with Neo4j – Part One

You might have already heard that Facebook is getting into the Dating business. Other dating sites have been using graphs in the past and we’ve looked at finding love using the graph before. It has been a while though, so let’s return to the topic making use of the new Date and Geospatial capabilities of Neo4j 3.4. I have to warn you though that I’ve been with Helene for almost 15 years and missed out on all this dating site fun, what I do know I blame Colin for it and some pointers from the comments section of this blog post.
Continue reading

Tagged , , , , , , , , , ,