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

Do not send the complete payload for the TriggerChannel that stores notification in the DB #67

Open
romank0 opened this issue Nov 15, 2023 · 1 comment · May be fixed by #76
Open

Do not send the complete payload for the TriggerChannel that stores notification in the DB #67

romank0 opened this issue Nov 15, 2023 · 1 comment · May be fixed by #76

Comments

@romank0
Copy link
Contributor

romank0 commented Nov 15, 2023

Currently for the updated django entity that has an associated TriggerChannel the notification payload is sent via postgres NOTIFY and it contains the old and the new serialized entity state. On the listener the payload sent via postgres channel is used only to find the appropriate Notification record from the DB and then the payload from the record is used.

This sending of the complete payload is suboptimal:

  • the serialized size of the record that can be sent is limited by the max payload size (8k) that can be sent via the channel. Given that both old and new records are sent that size is rather small
  • the serialized payload makes roundtrips from postgres to application (in the NOTIFY message) and then back to server (as a query parameter)

The better solution seems to be to send only the notification ID for the TriggerChannel that has a persistent notifications.

@romank0
Copy link
Contributor Author

romank0 commented Feb 8, 2024

I have an implementation of this but it depends and is based on PRs that are not yet merged #66 and #73 and there might be some amendments to the approach there so I'll add a PR for this when it will be clear what migration path will be chosen there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant