Home / Companies / WorkOS / Blog / Post Details
Content Deep Dive

DBConnection pooling deep dive

Blog post from WorkOS

Post Details
Company
Date Published
Author
William Huba
Word Count
1,867
Company Posts That Month
25
Language
English
Hacker News Points
-
Post removed?
No
Summary

The DBConnection pooling mechanism in Elixir's DBConnection library allows for efficient management of database connections. When a query is sent, the first available connection is found by looking at the ETS queue for a holder reference, and ownership of the holder ETS table is passed to the calling process. The connection is then used to make the query, and once complete, the holder reference is returned to the ConnectionPool process, which updates the ETS table and transfers ownership back to itself. If all connections are in use, queries are added to the ETS queue until a connection becomes available. The pool size determines how many connections are spawned under the DBConnection.ConnectionPool.Pool supervisor. Increasing the pool size can improve performance but also increases resource consumption.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.