0

Is it possible to make asynchronous calls to a stored procedure in VoltDB (an insert in a custom Java Stored procedure) using the Python client?

It looks like it isn't supported but is there a way to not wait for the response, or will I have to move to the Java client for async support?

StevieB
  • 3
  • 1

2 Answers2

0

The VoltDB python client does not support asynchronous calls. It may be possible to make calls from a multi-threaded python application, but we've never tested that, so I don't want to lead you into uncharted waters.

The java, C++, and Go clients support asynchronous calls.

If you're mainly trying to do fast inserts, you might leverage csvloader and you could probably execute csvloader from within a python application, but that's probably not what you're looking to do.

Disclosure: I work at VoltDB.

BenjaminBallard
  • 1,482
  • 12
  • 11
  • Thanks for the reply. I've tried from a multi threaded python application with 50-100 threads so far and it seems to work, but I haven't finished testing yet! We're looking to minimise latency on the inserts, would the csv loader increase latency if working in batches? Looks like will need to move to one of the other clients. – StevieB Nov 20 '18 at 11:28
  • For the same request, the latency should be the same regardless of which client is used. But asynchronous requests allow you to send many requests at once so that throughput is not a function of the latency. A multi-threaded client making synchronous requests can also achieve high throughput, but may require a lot of threads to be able to reach the same level as a single-threaded client sending asynchronous requests. – BenjaminBallard Nov 20 '18 at 14:07
  • CSVLoader would generally increase the latency, because it would be sending larger batch insert requests into the queues and these take longer to process than individual inserts. You can optionally call a procedure from CSVLoader using the -p parameter, which is usually slightly lower throughput, but can have less impact on latency. – BenjaminBallard Nov 20 '18 at 14:08
0

I hit this same issue building a Tornado process that is also a VoltDB client. Turned out it's quite easy to split VoltProcedure.call( ) into two funcs, the second to be invoked async by Tornado's ioloop when it detects a response on the socket. I also fixed a bug in writeDate( ). Take a look here: https://github.com/osullivj/voltdb-client-python

osullivj
  • 341
  • 1
  • 5