-
Notifications
You must be signed in to change notification settings - Fork 53
Closed
Description
Many load balancers set session cookies.
The API should throw away all session cookies returned in a response (so subsequent requests can be balanced) except when opening a multi-statement transaction. In this case, the API should cache the cookie in a transaction object and send it in subsequent requests for the same transaction so the load balancer can ensure host affinity (which is necessary for multi-statement transactions).
Maintaining a transaction object requires an interface change:
- The db.transactions.open() function will take an optional parameters object that can specify {loadBalancer:true}
- When load balancer is true, the open() function will return an opaque transaction object instead of a string transaction id
- Functions that accept a string transaction id parameter today will also accept a transaction object in the same position
On the next major semver boundary, loadBalancer will become the default. On the following major semver boundary, the string transaction id will be removed completely in favour of the transaction object.