memgraphdb

Parallelizing query execution with Memgraph C++ Client


I inherited a project that requires efficient data handling and query execution. I'm interested in optimizing performance and I'd like to know about the feasibility of parallelizing query execution using the Memgraph C++ client.

Is it possible to execute multiple queries in parallel directly through the Memgraph C++ client? If it can be done, what is the recommended approach to implement this? Are there specific patterns to follow (e.g., managing connections, handling concurrency, etc.)?


Solution

  • The mgclient doesn't expose specific parallelization primitives (every instantiated client/connection is separated, independent, and synchronous). Despite that i t's possible to execute queries in parallel by instantiating the client (example can be found at basic.cpp file) inside multiple C++ threads. Basic parallelization should be possible in a reasonably simple way.