Skip to content
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

Investigate using PostgreSQL NOTIFY and commit hooks #60

Open
hishnash opened this issue Feb 25, 2021 · 0 comments
Open

Investigate using PostgreSQL NOTIFY and commit hooks #60

hishnash opened this issue Feb 25, 2021 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@hishnash
Copy link
Member

Is your feature request related to a problem? Please describe.
Currently this lib uses Django Signals to detect changes however Django does not send these events if you do bulk updates or raw SQL operations and if you have other clients connecting to the database making changes you also do not get any events.

Describe the solution you'd like
PostgreSQL support the concept of NOTIFY and LISTEN, since commit hocks can send NOTIFY messages it would be possible to have PG automatically inform all LISTENs of db changes regardless of were the changes came from.

I would like to investigate a little more how NOTIFY and LISTEN work in PG and how easy/hard it would be to add something to Django's DB manager that automatically adds migrations for ObservableModel classes to trigger the NOTIFY on commit.

As a first pass it could be interesting to implement a PG packed change channels layer that uses the LISTEN and NOTIFY api this could be an interesting option for people who do not want to deploy an additional redis.

@hishnash hishnash added enhancement New feature or request help wanted Extra attention is needed labels Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant