-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⚡️ Remove server-side Presence transformations
This change addresses a performance issue with Presence, whereby every single Presence update will cause a Database call to fetch the latest ops, and transform Presence up. This can be quite costly if there are a lot of Presence updates, and adversely impact the "normal" operation of ShareDB. This is particularly strange for the "happy case", where two clients are exchanging Presence on the same version of a document (where there should be no need to query the database at all for Presence). We already have mechanisms in the client to transform presence, as well as re-request stale presence, so we can remove the server-side Presence transformations all together. This alleviates pressure on the server, at the cost of decreased performance in edge cases, where clients need to re-request Presence from other clients, or catch up on cached ops. However, this should be a sensible change to make, since we're trying to optimise for the happy path, rather than edge cases. Note that this changes a test case: we have to resubscribe `doc1` in this test case, otherwise it's never up-to-date, and `presence2` continues to throw out its presence updates. This could happen in a real-world situation (where `doc1` stays offline), but it's arguable that this is uninteresting presence anyway, since that client is not "live".
- Loading branch information
1 parent
aa720e9
commit f9ef1ec
Showing
4 changed files
with
30 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters