-
Notifications
You must be signed in to change notification settings - Fork 146
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
Shared database connection pools #216
Conversation
Database connections used by an event store instance are tied to whatever schema has been configured for the event store. This is because the Postgres This limitation means that sharing a connection pool won't work as expected if the event stores have been configured to use different schemas which is highly likely. Thus sharing the connection pool requires further work to include the event store schema when making all database requests. |
Include #216 in CHANGELOG
d7bd0c9
to
1a8b65a
Compare
Include #216 in CHANGELOG
1a8b65a
to
b990cde
Compare
Include #216 in CHANGELOG
b990cde
to
84e04dc
Compare
Include #216 in CHANGELOG
84e04dc
to
5bc89fa
Compare
Include #216 in CHANGELOG
5bc89fa
to
9c67f78
Compare
Thank you for making this work on #217 🎖️ |
By default each event store will start its own
Postgrex
database connection pool. The size of the pool is configured with thepool_size
config option.When you have multiple event stores running you will also end up with multiple connection pools. If they are all connecting to the same physical Postgres database then it can be useful to share a single pool amongst all event stores. This pull request adds the
shared_connection_pool
config option to specify a name for the shared connection pool. Then you can configure the event stores you'd like to share the pool by using the same name.This can be done in config:
Or when starting the event stores, such as via a
Supervisor
:Not specifying the
shared_connection_pool
config option indicates the event store will start its own connection pool. This is the existing behaviour. Not using this new shared pool feature should have no affect.Closes #198.