Ecto DBConnection Pool

I’ve been working with Mint & Finch http client for a while now, the idea of avoiding message passing between processes seems cool in this context(IMHO).

I was wondering if the same works/can work with Ecto as DBconnections(AFAIK) are kept in processes; implying data retrieved from DB must be copied over(might not be entirely the case if the data is of a certain size - correct me if otherwise.) into the client process.

I’m by no means an expert, just learning and exploring elixir - a bit of education on this will help.

I haven’t looked at the details, but the “Design” section of the db_connection README suggests it does that already:

One important design detail in DBConnection is that it avoids copying data. Other database libraries would send a request to the connection process, perform the query in the connection process, and then send it back to the client. This means a lot of data copying in Elixir. DBConnection keeps the socket in the holder and works on it directly.

1 Like

You’re right, there’s no data copying.