DarkWanderer / ClickHouse.Client

.NET client for ClickHouse
MIT License
315 stars 62 forks source link

Understanding connection lifetime & pooling #457

Closed pkese closed 5 months ago

pkese commented 6 months ago

A appologize in advance, this is not an issue but more of a question.

I read the page about connection lifetime & pooling and it is rather technical, e.g. to understand what is going on, one would ideally have deep understanding what System.Net.Http.HttpClient does, how does it do pooling internally and how it gets used by ClickHouse.Client.

What I'd like to know is simply: if I have an open connection, what happens if I pass the same connection to two async tasks, that might use that same connection concurrently?

Will in such case ... a) all hell break lose, b) or it will run but operations will be passed to the database sequentially, c) or it will run fine with requests passed to the database concurrently?

Ideally, a short paragraph about that would be nice also in the above document (implementation information is useful for hardcore dotnet developers, but not many people are familiar with all the nitty gritty technical details and would benefit more with a clear explanation of what happens and what the best use pattern is).

Thanks. I love this driver.