<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Chris Warner</title>
    <description>The latest articles on Forem by Chris Warner (@chris_warner_f0238f9f0cb3).</description>
    <link>https://forem.com/chris_warner_f0238f9f0cb3</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3606479%2Fbf718f72-d9c2-487b-9e45-9dd55ec977e1.jpg</url>
      <title>Forem: Chris Warner</title>
      <link>https://forem.com/chris_warner_f0238f9f0cb3</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/chris_warner_f0238f9f0cb3"/>
    <language>en</language>
    <item>
      <title>Building a Neo4j NIF for Elixir: When the Ecosystem Doesn't Have What You Need</title>
      <dc:creator>Chris Warner</dc:creator>
      <pubDate>Tue, 11 Nov 2025 20:17:52 +0000</pubDate>
      <link>https://forem.com/chris_warner_f0238f9f0cb3/building-a-neo4j-nif-for-elixir-when-the-ecosystem-doesnt-have-what-you-need-1maa</link>
      <guid>https://forem.com/chris_warner_f0238f9f0cb3/building-a-neo4j-nif-for-elixir-when-the-ecosystem-doesnt-have-what-you-need-1maa</guid>
      <description>&lt;p&gt;I'm building Grimoire, a tool that helps story writers create AI-powered content for games. Writers define quests, locations, and narrative guardrails—then the system generates infinite personalized content for players.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Graph Database Problem
&lt;/h2&gt;

&lt;p&gt;Story data is inherently relational. The connections between characters, locations, and plot points matter more than the nodes themselves. A traditional relational database doesn't capture this well.&lt;br&gt;
Neo4j made sense. I needed to store story graphs and traverse them efficiently. For production, that meant Neo4j Aura with SSL connections.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Driver Problem
&lt;/h2&gt;

&lt;p&gt;I'm building Grimoire in Elixir. When I tried the existing Neo4j drivers:&lt;br&gt;
&lt;strong&gt;The official driver&lt;/strong&gt;: Unmaintained, doesn't support modern Neo4j versions&lt;br&gt;
&lt;strong&gt;bolt_sips&lt;/strong&gt;: Couldn't handle Aura's SSL connection requirements (bolt+s:// protocol)&lt;br&gt;
I was stuck.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Wrong Solution
&lt;/h2&gt;

&lt;p&gt;My first instinct: build a gRPC service as a proxy. Elixir talks to the service, service talks to Neo4j.&lt;br&gt;
I started implementing it, but something felt wrong. I was building a relationship database repository pattern when what I actually needed was graph traversal. I wanted to write Cypher queries and get graph results back—not abstract it away behind an API.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Right Solution: Rust NIFs
&lt;/h2&gt;

&lt;p&gt;After some research, I discovered Rustler makes it straightforward to build Native Implemented Functions (NIFs) for Elixir. And because it's Rust, I get type safety and memory safety.&lt;br&gt;
I found neo4rs, a well-maintained Rust driver for Neo4j that supports everything I need—including Aura's SSL connections.&lt;br&gt;
The NIF setup was easier than expected. Now I'm working through the neo4rs Row API implementation to properly return query results to Elixir.&lt;br&gt;
Current Status&lt;br&gt;
Working:&lt;/p&gt;

&lt;p&gt;✅ Connections to Neo4j (including Aura)&lt;br&gt;
✅ Query execution framework&lt;br&gt;
✅ Comprehensive type conversion for Neo4j types&lt;/p&gt;

&lt;h2&gt;
  
  
  In progress:
&lt;/h2&gt;

&lt;p&gt;🚧 Row API implementation for returning actual results&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/chwarner-solo/neo4j_nif" rel="noopener noreferrer"&gt;https://github.com/chwarner-solo/neo4j_nif&lt;/a&gt;&lt;br&gt;
I'm building this in public. If you've worked with neo4rs or have experience building Elixir NIFs for database drivers, I'd love your input.&lt;br&gt;
This library will be published to Hex once the Row API is complete—the Elixir ecosystem needs a maintained Neo4j driver.&lt;/p&gt;

&lt;p&gt;Tags: #elixir #rust #neo4j #buildinginpublic #nif&lt;/p&gt;

</description>
      <category>elixir</category>
      <category>rust</category>
      <category>neo4j</category>
      <category>nif</category>
    </item>
  </channel>
</rss>
