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

Feat: Bolt 5.8 - home db cache & optimistic routing #28

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

robsdedude
Copy link
Owner

@robsdedude robsdedude commented Feb 10, 2025

Introducing support for Bolt 5.8, which (among other things) makes the server echo back the resolved home/default db on starting a transaction as well as a connection hint whether server-side routing (SSR) is enabled. If so, the echoed db can be used together with an optimistic home db cache to guess a client-side route (optimistic routing - falling back to SSR on wrong guesses). This feature saves a round-trip under the following conditions (all must be fulfilled):

  • Server has SSR enabled
  • Sever supports Bolt 5.8
  • A fresh (yet unused) session without an explicitly configured target database starts its first transaction (auto-commit or explicit)
  • There is a cache entry for the current user.
    How exactly "current user" is defined is left as an implementation detail. Currently, this is in order of descending precedence:
    • the impersonated user if any
    • else the session auth token (for basic auth, only the principal is considered) if any
    • else some fallback key representing the driver-level user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant