question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Discussion: Should we be read-only by default?

See original GitHub issue

Related 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:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
geoffjohn11commented, Jun 1, 2022

@BalmungSan Thanks for the feedback!

1reaction
BalmungSancommented, May 31, 2022

@geoffjohn11 I like the idea of having both query and command and that query 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 an ExecutionResult not only Unit also:
  • command also needs to provide all the other operations like single since some users may combine writing and reading in a single query.
  • query and command may share a common interface, but not a big deal.
  • The creation of a command or a query MUST be shared, the algorithm of transforming a DefferedQuery into a Query is too complex to have it duplicated.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Readonly everything by default #42357 - microsoft/TypeScript
⭐ Suggestion. Right now default is that all record/array/tuple properties are mutable, and if you want any of them to be readonly/immutable you ......
Read more >
Sharing Documents Defaults to Read Only
Hey y'all! Some of my users have mentioned that when the share documents in personal chats in Teams, the documents always default to...
Read more >
What are the benefits to marking a field as `readonly` in C ...
The readonly keyword compiles down to . initonly which is verifiable by the CLR. The real advantage of this keyword is to generate...
Read more >
Why anti-virus default profile is read-only? - LIVEcommunity
All the security profiles which are default are Predefined and are read only as it is by design. Normally anything which is Predefined...
Read more >
Standard Change - Set Default Values to Read Only
Currently, the default values are set correctly but users are still able to amend them - I need to be able to lock...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found