Search code examples
gremlintinkerpop3gremlin-server

Can I force a GLV to talk HTTP instead of WS?


Talking to databases that need persisted connections from serverless infrastructures is getting more and more popular. Although websocket connection establishment is not too heavy weight, I'm thinking talking HTTP fits better for my serverless use case and I'm wondering if I can force GLV's to talk HTTP instead of WS. If not supported, does it add value to support that? The current workaround is to construct HTTP requests myself, but writing java code that traverses the graph looks way more cleaner than having to create http requests with string payloads.


Solution

  • Gremlin Language Variants (GLVs) cannot talk over HTTP. That was an explicit design choice. Websockets made it possible to stream results back to the client rather than build up a large result set in memory to return in an HTTP payload. The HTTP endpoint in Gremlin Server that takes Gremlin strings as parameters was built mostly as a bridge from TinkerPop 2.x and Rexster which was REST-oriented in what it did, but TinkerPop doesn't really recommend building applications that way at this point.