Emulating transactionality in a single HTTP request with Apache Tinkerpop Gremlin Server

95 views
Skip to first unread message

Harry Stebbins

unread,
Nov 19, 2019, 5:47:00 PM11/19/19
to Gremlin-users
Howdy folks,

I'm working on using AWS Neptune's HTTP Gremlin endpoint. For local/CI testing, I've configured a local Gremlin Server that tries to emulate AWS Neptune as much as possible.

I know Gremlin Server is fairly simple, but I'm wondering if anyone knows of a way to configure Gremlin Server to implement transactionality over a single HTTP request in the same way that AWS Neptune does.

Basically, this means that if you write a bunch of query strings in a single HTTP request, all of the writes in the HTTP request will rollback. This is so we can write automated tests using transactionality over an HTTP request.

For example, "g.addV().property(id, 'foo') ; <step that raises error>" should rollback the creation of the 'foo' vertex. 

Thanks!
Harry

Stephen Mallette

unread,
Nov 20, 2019, 6:46:56 AM11/20/19
to gremli...@googlegroups.com
well, Gremlin Server does that now. if the script  you send fails at any point it calls g.tx().rollback(). If you aren't seeing that behavior it's probably not because of Gremlin Server but because you are using TinkerGraph as your test graph system. TinkerGraph does not support transaction so the rollback() (or commit()) has no effect. I'd suggest you switch to a transactional graph for testing - perhaps neo4j or maybe JanusGraph with berkleydb. it's too bad Bitsy (https://github.com/lambdazen/bitsy) isn't up to speed with the latest version of TinkerPop or that would be an even better choice than both of those as it is transactional and in-memory. 

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/ace7a2d5-ff2e-47bd-9acc-4db40e376dd0%40googlegroups.com.

Harry Stebbins

unread,
Nov 21, 2019, 12:10:54 PM11/21/19
to Gremlin-users
Thanks for the information Stephen, I appreciate it. Yes, exactly, we're using TinkerGraph right now. I'll look into alternatives -- thanks again! 
To unsubscribe from this group and stop receiving emails from it, send an email to gremli...@googlegroups.com.

Harry Stebbins

unread,
Nov 25, 2019, 3:49:45 PM11/25/19
to Gremlin-users
Stephen,

I tried setting up JanusGraph and neo4j locally. Unfortunately, it seems like neither supports string-type vertex IDs. Since that's all Neptune supports, it seems like neither will work for us... Are you aware of anything I'm missing? It seems like it might be impossible to get a great testing setup here.

Thanks,
Harry


On Wednesday, November 20, 2019 at 6:46:56 AM UTC-5, Stephen Mallette wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to gremli...@googlegroups.com.

Stephen Mallette

unread,
Nov 25, 2019, 4:15:43 PM11/25/19
to gremli...@googlegroups.com
hmm - you're using user supplied ids.....so you need a graph that does that and supports transactions. i'm not sure i know any that do both of those things which are open source and bitsy isn't supporting a version of TinkerPop that matches Neptune. That doesn't leave too many great options unfortunately. I wonder if you could configure JanusGraph with ElementIdStrategy:


which should simulate the id assignment capability that Neptune has. 

If Kelvin is following along, perhaps he can suggest some other approaches..........

To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/9c478aaa-0b7f-4504-8a4d-beda64fb88c2%40googlegroups.com.

Kelvin Lawrence

unread,
Nov 26, 2019, 10:35:31 PM11/26/19
to Gremlin-users
When I am disconnected or just want to work locally, such as in a plane but want to do things with the GLVs, I must admit my go-to setup is Gremlin Server and TinkerGraph. That gives me everything I typically need for local testing other than transactions. You could look at using an in-memory JanusGraph instead of TinkerGraph but as Stephen mentioned I think JanusGraph is still numeric IDs only.

Cheers,
Kelvin

Harry Stebbins

unread,
Dec 1, 2019, 12:34:59 AM12/1/19
to gremli...@googlegroups.com
Looks like I won't be able to set this up in a great way, sadly. Thanks for the input! 

To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/789e448d-32a4-40a0-bcd4-0c07878ba554%40googlegroups.com.

Stephen Mallette

unread,
Dec 2, 2019, 6:58:06 AM12/2/19
to gremli...@googlegroups.com
did you try ElementIdStrategy + JanusGraph? if so, would you mind sharing what didn't work with that?

Reply all
Reply to author
Forward
0 new messages