cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Perl 5 driver

If you're looking for a Perl 5 driver for Neo4j, here are two options:

REST::Neo4p

Neo4j::Driver

The first one has been around for several years, and includes an OGM style interface, batch processing, and the ability to apply application-level constraints (similar to a schema). However, it hasn't been updated for a while, and seems to have a memory leak, which can be a problem with long-running applications.

The second option is much newer and has fewer features, but it does not rely on the legacy Cypher endpoint, which is apparently due to disappear in Neo4j 4.x. It is also currently described as "pre-release" quality. However I have had good success using it for a while, and would recommend it over the first one. (You may want to increase the HTTP timeout from the default 6 seconds.)

8 REPLIES 8

Haven't used Perl the last 15 years, but quick internet research pointed me to https://github.com/majensen/perlbolt - maybe that's what you're looking for.

Thanks Stefan! I missed that one. Will give it a try. (It looks like Neo4j::Driver is able to integrate with Neo4j::Bolt in order to provide a Bolt transport option in addition to the default HTTP, although Neo4j::Bolt is not yet available on CPAN.)

Hi @stephen.hall, I'm the author of Neo4j::Driver. Glad you had success with it.

Back in May, you suggested a default HTTP timeout of 6 seconds might be too short. At the time, I was actually considering to make it even shorter. Could you elaborate on the specific use case for a longer timeout? Which value would be appropriate in your case?

Cheers,
Arne

Hi Arne,

Yes, Neo4j::Driver has been working very well for me. (It's good to see it's being actively maintained on CPAN too!) My suggestion regarding the HTTP timeout was because I'm using it in long-running data-loading scripts (some take several days), where the network connection between the machine running the script and the server can be a bit flaky. So I bump the timeout up to 60 seconds, just in case. Of course, a much better approach to handling network dropouts would be to wrap the driver calls with something like Try::Tiny::Retry, but I haven't got around to that yet, being lazy by nature

Regards,
Stephen

Hi Stephen,

thanks for your feedback! I'm leaning towards keeping the default timeout at 6s. But I will make sure not to remove the option to change it to whatever is needed.

Anyway, speaking about Perl driver options, there's also DBD::Neo4p and REST::Cypher. But I never really tried either of those.

I guess it would be nice for neo4j.com/developer/perl to list all the options, but I'm not sure how to make that happen. Do you?

Cheers,
Arne

Hi Arne,

Yes, good idea. I will get in touch with Michael Hunger and suggest an update to that page.

Regards,
Stephen

Hi Stephen,

that's great, thanks! Please let me know if there is anything I can do.

Cheers,
Arne

Hi Arne,

Just to let you know that the documentation at https://neo4j.com/developer/perl/ has been updated to include Neo4j::Driver and Neo4j::Bolt.

Regards,
Stephen