whether vart is thread safe and how vart is used in production?
skyitachi opened this issue · 1 comments
Firstly, thanks for sharing this repo. Recently I learn about surrealdb use ART in production and created versioned ART, I am very curious about vart and have some question: is it thread safe or how vart is used in production, I can not found vart usage in surrealdb main repo
Hello @skyitachi
Thank you for your interest in this repo. We are using vart in surrealkv internally. Currently, the index folder in the KV store needs to be removed, and we will import vart for reference (both are the same).
Since vart is an immutable copy-on-write (COW) structure, read operations are thread-safe because it allows multiple threads to concurrently read from the same data without any issues. Since the data is immutable, there's no risk of concurrent reads causing inconsistencies.
However, mutable operations are not.