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

connection pool support #23

Closed
canhduong28 opened this issue Apr 10, 2019 · 2 comments
Closed

connection pool support #23

canhduong28 opened this issue Apr 10, 2019 · 2 comments

Comments

@canhduong28
Copy link

Hello,

I am developing a web application in which I use pyexasol to query for data from Exasol.

Is it possible to use a connection pool in pyexasol?

Having a connection pool would allow the web server to maintain long-running connections in memory for efficient re-use.

Thanks

@littleK0i
Copy link
Collaborator

@nautilus28 , it might be a bit difficult to implement proper connection pooling with Exasol due to lack of function to reset session state. At this moment all state changes (e.g. autocommit, query timeout, script languages) will be carried over to the next session.

Also, all result handles and prepared statements will remain opened, unless we manually track the current state of each object.

On top of that, Exasol instance has only 100 slots for parallel query execution. But it's a good idea to keep this number lower than 20-30 and use "Queue" pattern instead to limit parallelism. Instead of having potentially large spikes of workload, just queue it and execute only 5-10 queries at the same time. All jobs will be finished faster that way.

If you have a busy web-interface querying analytical database, it is advised to add a simple caching layer (MySQL, PostgreSQL, Redis, Mongo, SQLite, Tarantool, etc.) and send web requests to this layer instead. You may update data in this layer using ETL process.

@canhduong28
Copy link
Author

@wildraid Great answer, thank you so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants