Discussion: Should we be read-only by default?
See original GitHub issueRelated to #178
It may be worth to add a readOnlyTransact
which is basically transact
but setting / overriding the transaction config to have AccessMode.Read
. However, IMHO, it only makes sense to add this if we use it for operations like single
or list
.
The pros of this would be to improve the performance of such operations for users having a multi-node cluster with nodes specialized in read-only operations. The cons are that this change may break existing applications without no-one noticing until execution (be it runtime or a test).
Finally note that if we do not do this, then people wanting to take advantage of the read-only optimizations need to write extra code. Whereas if we do, then people wanting to write inside a “read” query would need to add the extra code.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
@BalmungSan Thanks for the feedback!
@geoffjohn11 I like the idea of having both
query
andcommand
and thatquery
would be read-only by default. However, I took a quick look at your branch and I have some general comments:command
also needs to be parametrized since you can get other things out of a command, like anExecutionResult
not onlyUnit
also:command
also needs to provide all the other operations likesingle
since some users may combine writing and reading in a single query.query
andcommand
may share a common interface, but not a big deal.command
or aquery
MUST be shared, the algorithm of transforming aDefferedQuery
into aQuery
is too complex to have it duplicated.