altairbow / django-db-connection-pool

Database connection pool component library for Django
https://pypi.python.org/pypi/django-db-connection-pool/
MIT License
181 stars 24 forks source link

What is the difference between this and pgbouncer / other connection pooling alternatives? #59

Open YPCrumble opened 4 months ago

YPCrumble commented 4 months ago

This is an interesting library as it seems easier to implement than pgbouncer. A section in the README explaining the difference between this and pgbouncer and potentially other libraries would be really helpful.

jkgenser commented 3 months ago

This is an in-process connection pool. It uses sqlalchemy's connection pool.

pgbouncer is a standalone proxy. It can be deployed as a sidecar to a process and function as a pooler for a process which would have a similar effect as this library.

pgbouncer can also be deployed as a proxy that receives n connections, and process/app level pooling would not be needed in such a scenario

altairbow commented 3 months ago

django-db-connection-pool is a wrapper based on SQLAlchemy connection pool, designed based on Django database connection backend, It is a easy way to implement connection pooling for multiple database types in Django.

PgBouncer has an independent connection pool implementation and cannot be used directly in Django