eeswar
CDCloudflare Developers
•Created by Nikil on 10/17/2023 in #workers-help
Long-standing websockets & writing to external DB subrequest limit?
I like Dani's solution, I'm just unsure on how to make sure the visual information for the clients and information in the db are always aligned, feels like there'd be a fair bit of edge cases to be wary about.
55 replies
CDCloudflare Developers
•Created by Nikil on 10/17/2023 in #workers-help
Long-standing websockets & writing to external DB subrequest limit?
Haven't built out notifications yet, but yeah it would send a notification over websocket connection to any students linked to a question when a TA assigns themselves to a question.
55 replies
CDCloudflare Developers
•Created by Nikil on 10/17/2023 in #workers-help
Long-standing websockets & writing to external DB subrequest limit?
This sounds like a pretty great solution, I am worried about there being a difference between the information in the database and the overall information broadcasted to everyone. Should I be comparing the both every few minutes or so?
55 replies
CDCloudflare Developers
•Created by Nikil on 10/17/2023 in #workers-help
Long-standing websockets & writing to external DB subrequest limit?
Oh this is a pretty nifty solution. Would this be expensive to do?
55 replies
CDCloudflare Developers
•Created by Nikil on 10/17/2023 in #workers-help
Long-standing websockets & writing to external DB subrequest limit?
This is what I was curious about, right now we make updates to our db by direct http post calls by hitting backend api routes. I was considering making it so the websocket connection and the worker handles any post calls or even just sending a plain message over websocket connection anytime we hit a backend api route, but our issue is our db has roughly 6 seconds of latency between the time we update and the time we're able to fetch the updated information
55 replies
CDCloudflare Developers
•Created by Nikil on 10/17/2023 in #workers-help
Long-standing websockets & writing to external DB subrequest limit?
55 replies
CDCloudflare Developers
•Created by Nikil on 10/17/2023 in #workers-help
Long-standing websockets & writing to external DB subrequest limit?
I'm new to workers and durable objects so my code logic might not be sound, let me share the file
55 replies
CDCloudflare Developers
•Created by Nikil on 10/17/2023 in #workers-help
Long-standing websockets & writing to external DB subrequest limit?
Yep active WS clients isn't the problem. We're just making fetch requests every 2 seconds to an external db in an internal function which ends up exceeding the limit pretty quickly.
55 replies
CDCloudflare Developers
•Created by Nikil on 10/17/2023 in #workers-help
Long-standing websockets & writing to external DB subrequest limit?
Thanks for the advice milan! Sorry if I'm repeating something you already answered, but we're running into the issue of making too many subrequests to our external db to constantly refresh our database and the questions rendered to users. The current code is setup so as long as there is one active websocket connection we will continue to fetch questions from our db.
I can't seem to think of a solution other than simply using a dedicated server to constantly fetch and distribute information across all active connections. Can I make this work using cloudflare?
55 replies