jk-labs-inc / jokerace

contests for communities to run, grow, and monetize.
https://jokerace.io
GNU Affero General Public License v3.0
86 stars 47 forks source link

feat: use redis for live updates instead of alchemy #2105

Open seanmc9 opened 2 months ago

seanmc9 commented 2 months ago

when user loads contest page:

when user leaves contest page:

when user proposes, votes, or comments:


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.

seanmc9 commented 2 months ago

just putting here so I don't lose it - figuring out that --tls flag was necessary bc we use Digital Ocean as our provider took a sec.

redis-cli -a {PASSWORD} -h {HOST_NAME} -p 25061 --tls