C# programming: Neo4j.Driver or Neo4jClient?

1,601 views
Skip to first unread message

Bassman

unread,
Jan 22, 2017, 6:40:55 PM1/22/17
to Neo4j
I see 2 very different approaches to C# programming with Neo4j:
The Neo4j.Driver approach, as documented in the "Neo4j Developer Manual for .NET" lets me simply send a Cypher command (single text string) and get results.  This seems more flexible for my humble needs than the Neo4jClient approach.

Question, please:  Which of the 2 approaches is "best" in terms of long-term support in future versions of Neo4j, for a C# programmer?

Apologies to the Java enthusiasts, but I'm more of a "data scientist" these days than a programmer, and I'm sort of wedded to Microsoft...

Tatham Oddie

unread,
Jan 22, 2017, 7:00:44 PM1/22/17
to ne...@googlegroups.com

Hi,

 

I’m one of the original authors of Neo4jClient.

 

Some history: At the time we started it, Cypher didn’t exist yet (it was all Gremlin), the only wire protocol was REST (no Bolt), and there were no real .NET clients available. Since then, the official driver (Neo4j.Driver) has been released, based on Cypher and Bolt. Neo4jClient has been updated along the way to provide great support for both of these things too.

 

Why maintain both? Neo4j.Driver is quite raw: it takes a string of Cypher, and gives you some objects back. You need to make sure that your schema, queries, and objects all stay in sync. If they get out of sync, it’ll just fail at runtime. Neo4jClient gives you some syntactic sugar for building Cypher queries as fluent calls in C#, with a fair degree of type safety and compile-time checking. It also provides nice wrappers for things like transactions.

 

Use whichever makes you happier. Both will support Neo4j long-term. Both allow you to make arbitrary Cypher calls. Neo4jClient gives you more compile-time structure, which may or may not be useful to you.

 

If you’re working with a team of people, on a reasonably complex application, where you want to be able to refactor queries and trace property usage, consider Neo4jClient.

 

If you just want to be able to quickly throw queries at the wire, and don’t need refactoring tools in VS to understand those queries, then consider Neo4j.Driver.

 

 

Hope that helps,

 

 

--

Tatham

--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages