Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run concurrent transactions #250

Open
bilalsp opened this issue Jun 12, 2023 · 3 comments
Open

Run concurrent transactions #250

bilalsp opened this issue Jun 12, 2023 · 3 comments
Labels
community community Effort - High Effort - High feature feature Frequency - EveryTime Frequency - EveryTime Priority - Later Priority - Later Reach - Some Reach - Some Severity - S3 Severity - S3

Comments

@bilalsp
Copy link

bilalsp commented Jun 12, 2023

[New Feature Request]

Neo4j driver supports concurrent workflows to interact with the database in an asynchronous way as explained in documentation.

Documentation: Neo4j concurrent transactions

Apparently, gqlalchemy does not support concurrent workflows neither for Neo4j nor Memgraph.
I would appreciate if we implement this feature in gqlalchemy compatible with Python’s asyncio.

@katarinasupe
Copy link
Contributor

Hi @bilalsp, thank you for opening the feature request :) We considered implementing this in the future, so I will leave this issue open to better prioritize later.

Is this a blocker for you? What are you working on?

@katarinasupe katarinasupe added the type: enhancement New feature or request label Jun 12, 2023
@bilalsp
Copy link
Author

bilalsp commented Jun 12, 2023

Hi @katarinasupe,
we are doing planing for our new async microservice which we will be implementing in FastAPI framework.
Graph database is really appealing for our usecase. So, we are considering all the aspects before making our decision to use graph database.

By the way, does Memgraph's python driver pymgclient support concurrent transactions similar to Neo4j driver?
I didn't find any resource related to this.

@alex-linx
Copy link
Contributor

@bilalsp Hi, I ran into this issue as well.
Here is what I found out so far:

  • The only way to parallellize queries with pymgclient is by multiprocessing - using ProcessPoolExecutor, or a helper library such as joblib. It works well, but you are limited by the number of cpu cores.
  • Multithreading doesn't really work with pymgclient because apparently it doesn't release the GIL for I/O activities.
  • The best solution I found is to use the neo4j driver v5 which has asyncio support. I tested it with 1000 concurrent connections and it was extremely fast. Unfortunately, neo4j v5 is incompatible with gqlalchemy that requires v4.4, so they can't exist in the same python env.

@katarinasupe katarinasupe added Importance - I3 Importance - I3 Severity - S3 Severity - S3 Effort - High Effort - High feature feature community community and removed type: enhancement New feature or request labels Dec 28, 2023
@hal-eisen-MG hal-eisen-MG added Priority - Later Priority - Later and removed Priority - Later Priority - Later labels Feb 4, 2024
@hal-eisen-MG hal-eisen-MG added Priority - Later Priority - Later and removed Priority - Later Priority - Later labels Feb 18, 2024
@katarinasupe katarinasupe added Frequency - EveryTime Frequency - EveryTime Reach - Some Reach - Some and removed Importance - I3 Importance - I3 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community community Effort - High Effort - High feature feature Frequency - EveryTime Frequency - EveryTime Priority - Later Priority - Later Reach - Some Reach - Some Severity - S3 Severity - S3
Projects
Status: Todo
Development

No branches or pull requests

4 participants