Skip to content
New issue

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

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

Already on GitHub? # to your account

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

Merged
merged 5 commits into from
Feb 15, 2025

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.

@robsdedude robsdedude force-pushed the feat/bolt-5.8-home-db-cache branch from 6f4060d to 99f2000 Compare February 15, 2025 11:16
@robsdedude robsdedude enabled auto-merge February 15, 2025 15:25
@robsdedude robsdedude merged commit 75bac94 into master Feb 15, 2025
18 checks passed
@robsdedude robsdedude deleted the feat/bolt-5.8-home-db-cache branch February 15, 2025 16:03
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant