Which LISTEN/NOTIFY implementation is more performing and resource efficient? Please explain why.
With dynamic channel
// Send message to user with ID = 1 with content hello
NOTIFY message_1, 'hello';
user with listen using a unique channel. Unique per user
LISTEN message_1
or
Dynamic Payload
// Send message to user with ID = 1 with content hello
NOTIFY message, 'id=1;content=hello';
every user with listen using the same channel and get the content based on their id
LISTEN message
I’ve tried to implement websocket notification using pg_notify, i’ve tried to use dynamic channel but kinda curious about the performance if i just combined all of them into one single channel.