dataloader
dataloader11mo ago

Presence without touching the DB

Have you guys considering exposing the ability to query active connections (with appropriate authorization of course)? Theoretically, "presence" could be done with convex without ever touching the datastore, since it holds active websockets connections to all clients. in most cases it would obviate the need for somethign like https://stack.convex.dev/presence-with-convex and would be 1) faster, 2) lower network bandwidth, 3) lower contention (from mutation transactions) and could make your platform subsume things like https://github.com/yjs/y-websocket
Implementing Presence with Convex
Some patterns for incorporating presence into a web app leveraging Convex, and sharing some tips & utilities I built along the way.
GitHub
GitHub - yjs/y-websocket: Websocket Connector for Yjs
Websocket Connector for Yjs. Contribute to yjs/y-websocket development by creating an account on GitHub.
1 Reply
ballingt
ballingt11mo ago
Yes we've talked through it, re potential for a transient datastore with different guarantees. There's no guarantee that all WebSockets for a deployment will be serviced by the same worker so there's still some coordination here. The thing we came around to was that as long as we can make presence fit well-enough in the core platform path it's worth focusing on that. We're not Cloudflare yet with 100 different (useful!) products or AWS with 200 different (complex!) ones, and don't want to be! We're focusing on making one cohesive platform. Different ways of storing different data could happen, we'll try to do it cohesively if it does. This has been a great path: we've found we can get a lot of performance out of our existing patterns even before applying some the optimizations we designed the system to be able to make later. You're bringing up a lot of good things we've talked about at a faster clip than I remember us getting to them! keep it up and I'll be taking notes soon

Did you find this page helpful?