Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚡️ Remove server-side Presence transformations #538

Closed
wants to merge 1 commit into from

Commits on Jan 17, 2022

  1. ⚡️ 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".
    alecgibson committed Jan 17, 2022
    Configuration menu
    Copy the full SHA
    febb54f View commit details
    Browse the repository at this point in the history