Tag Archives: graph

Let’s build something Outrageous – Part 4: Creating and Retrieving Nodes

When I was first introduced to graph databases I had a hard time trusting them. When a node gets created, where does it go? There are no tables in graph databases, so I was missing that loving embrace, I mean arrangement of rows and columns. It made me a little paranoid, like what if I lost them? I built some projects storing all the data in Postgres first, so if anything happened to the graph I could rebuild it. That warm protective security blanket is something we’re bringing back. We’re taking another walk through a door and arranging all nodes and properties of each type in a set of Vectors (well, one per Shard of course).

Continue reading
Tagged , , , ,

Let’s build something Outrageous – Part 3: Node Types

Jim Morrison died in 1971, I wasn’t even alive then. I didn’t learn about The Doors until the Val Kilmer film from the 90s. I was still too young to really understand them but I became a fan of the music nonetheless. In the last few months I’ve learned more about doors. I learned about this concept of one way and two way doors. The idea being that one way doors can only be broken through once, but if you don’t love the decision you made you can walk through the door two times and be back to where you started.

Continue reading
Tagged , , , , ,

Let’s build something Outrageous – Part 2: Shards are ok!

When I was a new Java developer I would sometimes wake up in the middle of the night hyperventilating and covered in sweat. Usually from a nightmare about Maven and fighting with pom.xml. We dream of Software, but does Software dream? I don’t know, but I hope when Maven goes to sleep at night, it wakes up screaming thinking about CMake and CMakeLists.txt… I know I do.

Rather I should say, “I did”, because I went looking for help on youtube and ran into a template for C++ projects by Jason Turner which made the nightmares stop. We’ll start our new project by blindly copying that into our repository and removing a few GUI related things we won’t be using. Watch the video for all the details, I only understood half of it, but it was enough. There I learned about Conan.

Continue reading
Tagged , , , , ,

Let’s build something Outrageous

I could not decide if I wanted a Rhinoceros or Cthulhu as a mascot for this new project, so I went with both. The image you see above is what I ended up with. It’s absolutely outrageous and fits perfectly with our theme. That was going to be the name by the way “Outrageous DB” but it was kind of long, so I went with “Rage DB” instead. Right about now you may be thinking, wait, what are we doing, what is this new project? What is going on?

Continue reading

Tagged , , , , ,

Changes in Direction with The Traversal API

We got an odd request in User Slack the other day. A user wanted to find paths between nodes where the direction of the relationships changes up to just one time. Cypher doesn’t have a good handle on the concept of Direction beyond specifying it on a path. APOC doesn’t seem to have a method to figure this one out either… but to be fair I may have missed it since there are hundreds of awesome stored procedures now. Regardless, lets go ahead and build it the “old school” way. Using the Traversal API… and just to be slick, we’ll use the Bidirectional Traverser.

Continue reading

Tagged , , , , , , , , ,

Faux Bitmap Indexes in Neo4j Part Two

Last time we introduced the problem of single model, multiple property search queries taking a bit of time in Neo4j. We saw that using composite indexes or using “additional” labels can help us in some situations but not all. I promised you a stored procedure to build fake bitmap indexes could help, so today we’re going to see how to build one.
Continue reading

Tagged , , , , , , , , ,

Faux Bitmap Indexes in Neo4j

If you’ve ever watched my talks about Neo4j, I tend to say we’re not very well optimized for Single Model queries where relationships aren’t considered. In fact, we’re kinda bad at it. Things got better when Composite Indexes were introduced, but we still have some limitations to deal with. Today we’re going to explore the issues and build our own faux “bitmap indexes” to get around this problem.
Continue reading

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

Stored Procedures in Neo4j Are NOT Evil

Some of you may be too young to remember this, but writing your application logic in Stored Procedures was all the rage back in the day (PG devs you wouldn’t understand). That is mostly because they were typically written by consultants from IBM and Oracle that cost a fortune and told you to do it this way. Eventually people wised up and realized they (both) sucked and as all things in Software Development, the pendulum swung the other way and people started treating databases like dumb storage. A 15 year old blog post from Jeff Atwood lists some of the problems:

  1. Written in T-SQL/PL-SQL, not a real programming language.
  2. Cannot be debugged in the same IDE
  3. Little to no feedback when things go wrong
  4. Can’t pass objects.
  5. No idea what a proc is doing

Continue reading

Tagged , , , , , , ,

Updating your Neo4j 3.x Unmanaged Extensions to 4.x

Neo4j 4.0 has been out for a few months now, but since the whole world is on lock down, it didn’t get a chance to make a grand entrance at Graph Connect 2020. It comes loaded with some great new features but I’m not here to tell you about all that. There are plenty of better places for it. Instead I’m going to tell you about an old feature that got a bit of an update. Unmanaged Extensions. Yup, those things have been with us since dinosaurs roamed the earth and they are still in Neo4j 4.0. Why you ask? Because they let you turn Neo4j into an HTTP API style service making it super easy to integrate into your existing infrastructure. It’s still one of my favorite ways to build Neo4j applications because once you have the documentation of the API locked down, you can crank out the endpoints quickly and the service is done before you know it.

Continue reading

Tagged , , , , , , , , , ,

Composite Indexes in Neo4j 4.0

Neo4j 4.0 has officially launched and folks are very excited about some of the new features including multiple graphs and schema based security. But you should also be excited about some of the more “quality of life” improvements in the product. One we will talk about today is the upgrade that composite indexes received.

Continue reading

Tagged , , , , , , , ,