Comments (5)
We have designed the project structure to also support other protocols. But SignalR does not really solve any problem. SignalR is great because of the backplane, but the general problem is that we don't have an architecture for clustering yet.
Yjs documents are potentially big states and you might receive hundred of updates within a short time. Therefore you cannot load the state from the storage for each update. You need to keep it in memory or at least I think that this would be the best option. If you have multiple servers you also don't want to have a copy on each server because you need to synchronize them.
So I think you have a several solutions:
- Sticky load balancer sessions using the document ID.
- Use something like Microsoft Orleans to have an actor per document (then you can use SignalR) again.
- Use a single server.
from ydotnet.
@SebastianStehle thanks for the response!
I ended up implementing a SignalR server to see how that would perform. It honestly performs well, but likely won't scale as good as WebSockets.
In my use case I don't see that much concurrent users, so it would work for quite some time before it really requires a refactor. But I definitely understand why it would be much better to use WebSockets in the future.
I will close this for now. Thanks!
from ydotnet.
I am not so concerned about the transport protocol. You can just embed the binary protocol in a message and go. if you want to contribute, you are more then welcome. But I don't see how SignalR helps with scaling.
We designed the library to support other protocols, so you contribution would be awesome :)
from ydotnet.
SignalR doesn't help with scaling, but it does help if your infrastructure doesn't support websockets, etc. That was my initial problem.
We have a limitation on our infra since it runs on stateless pods and there is no way of keeping an open connection to the pods. Besides that, we also don't have a load balancer that is able to direct all websocket calls to the same pod.
I will definitely contribute once my solution is working decently hehe. Right now it is a mess of code spread everywhere.
from ydotnet.
Even if you use SignalR, you get problems, if you have more than one server. It depends on your use case, but if you use ydotnet for a text editor (like prosemirror), you handle every single key stroke. So you get a lot of messages and you cannot load the document for every single key stroke. Perhaps you can use signalr for that together with a stateful set. So you use a stable number of servers and assign the documents based on the hashset of the pod name. Then use SignalR groups and messaging to redirect the message to the correct pod. But it is also not ideal.
Btw: Even with stateless pods your web socket connection should stay open as long as no one closes it. But afaik SignalR also requires sticky sessions: https://learn.microsoft.com/en-us/aspnet/core/signalr/scale?view=aspnetcore-8.0
from ydotnet.
Related Issues (20)
- NuGet handle HOT 3
- Fix Publish workflow HOT 1
- Integrate new method ytransaction_alive HOT 5
- Demo client project problems HOT 3
- Improve the README
- Update to .NET 8
- Fix unit tests
- WebSocket Client HOT 1
- Use `y-crdt/y-crdt` to build the Rust binaries
- Unable to load shared library 'yrs' or one of its dependencies. HOT 8
- Support for Weak Types?
- How would you persist the data in SQL Server? HOT 3
- Initial sync not working on latest version of the codebase. HOT 2
- v0.2.13 release? HOT 1
- Exception calling Get* on top level field without first defining it HOT 7
- YDotnet.Extensions: Exception converting Map to strongly typed model HOT 1
- Exception in Rust code bringing the entire dotnet server down HOT 5
- YDotNet stops persisting to storage after 1st invalidation HOT 36
- Update core bindings to Yrs v0.18 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ydotnet.