elixir-ecto / db_connection

Database connection behaviour
http://hexdocs.pm/db_connection/DBConnection.html
306 stars 113 forks source link

Remove Sojourn pool #125

Closed josevalim closed 6 years ago

josevalim commented 6 years ago

:heart: :green_heart: :blue_heart: :yellow_heart: :purple_heart:

hubertlepicki commented 6 years ago

Would it be possible to learn why this is being removed? I am using DBConnection.Poolboy pretty much everywhere but I think Sojourn was the default when no pool type was specified...

michalmuskala commented 6 years ago

DBConnection 2 will only have one built-in pool based on ets that was introduced in https://github.com/elixir-ecto/db_connection/pull/108

The new pool is faster and simpler and allows for some additional nice things - for example regular exceptions for timeouts instead of exits from poolboy. In our benchmarks, the new pool is also just 10% slower than not using a pool at all, so we plan to remove the "no pool" option as well. All of this means significant simplifications of the codebase, which is a priority for us at the moment, given we (or more specifically @fishcakez) don't get help with maintenance of it.

hubertlepicki commented 6 years ago

Nice. I think that would make the API also slightly nicer as you won't have to pass around the info of what type of pool are you using to each query! if you are using one. And for single connections you'd just use pool with size of 1.

I remember there used to be a plan for similar ETS-based solution for Poolboy 2.0 but I don't think it ever reached that stage. I'm not sure what's the status of Poolboy either, seems to me like it's one less dependency we are uncertain if we can rely on being maintained that we can get rid of then.