this message gets published via the live-updates Redis channel to all clients currently subscribed to it (all users that currently have the contest page open)
these users' frontends read the message and then grabs the relevant updated information from the contest's respective chain
Digital Ocean's Managed Caching (it's just Redis but they had to change the name because Redis the company went back on their word on committing to open-source so Digital Ocean has to be careful what they call their offering) looks like the best option pricing, ease of use, and optionality-wise here so can very easily set that up and scale it if we need to. DO MC limits here - need to turn off trusted IP addresses so users can hit it, still protected by password which will be an env var though.
Def want to implement this in a resilient way where the Digital Ocean env vars are optional and if a build doesn't have them then it just doesn't have live updates and that's alright.
Also want to make sure that if the redis server fails or goes down at any point that doesn't break anything either (for example if the listeners are up and running but the server fails).
And then last step is fully removing Alchemy live updates.
when user loads contest page:
live-updates
redis channel (super basic outline at https://github.com/seanmc9/testredis/blob/main/test.js, also this or this or this might be helpful as well?? not sure, just thought I'd link things as I find them)when user leaves contest page:
live-updates
redis channelwhen user proposes, votes, or comments:
analytics_contest_participants_v3
table, a message with the below is sent to thelive-updates
redis channellive-updates
Redis channel to all clients currently subscribed to it (all users that currently have the contest page open)Digital Ocean's Managed Caching (it's just Redis but they had to change the name because Redis the company went back on their word on committing to open-source so Digital Ocean has to be careful what they call their offering) looks like the best option pricing, ease of use, and optionality-wise here so can very easily set that up and scale it if we need to. DO MC limits here - need to turn off trusted IP addresses so users can hit it, still protected by password which will be an env var though.
Def want to implement this in a resilient way where the Digital Ocean env vars are optional and if a build doesn't have them then it just doesn't have live updates and that's alright.
Also want to make sure that if the redis server fails or goes down at any point that doesn't break anything either (for example if the listeners are up and running but the server fails).
And then last step is fully removing Alchemy live updates.