-
I know this is not a relational database but are there any capabilities / strategies for getting consistent reads across keys other than locking? In this case I don't care if the values are updated during the read I just want to see a consistent snapshot of the values at a point in time (similar to a select query in a database, eg. postgres, with read committed isolation). The groups of keys to be read together consistently would be known on insert so could be organized in a way to support this (eg. key naming for hashing etc). If not are there limitations / recommended upper bound on number of keys to be shared locked at same time? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You can wrap the reads into a transaction, then you will get a consistent read across the keys. Performance should be good for many keys, as long are there isn't a lot of contention with writes. https://microsoft.github.io/garnet/docs/extensions/transactions |
Beta Was this translation helpful? Give feedback.
-
Any non-transactional alternatives, eg. if using the AOF / WAL are there any utilities to scan this as a background process to create a consistent non-write blocking view over the database? |
Beta Was this translation helpful? Give feedback.
You can wrap the reads into a transaction, then you will get a consistent read across the keys. Performance should be good for many keys, as long are there isn't a lot of contention with writes.
https://microsoft.github.io/garnet/docs/extensions/transactions