Our great sponsors
- Onboard AI - Learn any GitHub repo in 59 seconds
- InfluxDB - Collect and Analyze Billions of Data Points in Real Time
- SaaSHub - Software Alternatives and Reviews
-
I've been working on a JS database to support optimistic concurrency control. I did some research and arrived on 2 seemingly related concepts but from independent research lines. Software transactional memory in functional programming/Haskell land versus snapshot isolation in database research.
After reading them both, I asked this unanswered question on SO: https://stackoverflow.com/q/72084071/582917. My theory is that STM is the same as SI, but most SI database implementations don't just do value comparisons, but actually check a logical timestamp. This is probably done for performance reasons as databases handle larger pieces of data than functions would when using STM.
Along the way I also discovered SSI serializable snapshot isolation but it isn't yet available in rocksdb but cockroachdb apparently has a fork of rocksdb with it but I couldn't find it.
Anyway the db library which wraps around rocksdb is available to be used embedded in any nodejs program at https://github.com/MatrixAI/js-db.
-
I think you are right about STM being roughly equivalent to snapshot isolation.
What STM offers is an easy way to invent "containers for snapshotted values" aka TVars. Using them carefully may result in better scaling: https://hackage.haskell.org/package/stm-containers
-
Onboard AI
Learn any GitHub repo in 59 seconds. Onboard AI learns any GitHub repo in minutes and lets you chat with it to locate functionality, understand different parts, and generate new code. Use it for free at www.getonboard.dev.
-
Common Lisp has it too, via https://stmx.org/ I believe it supports the Intel TSX stuff if present and falls back to a software implementation if not present.
-
I have a repo with six sample algorithms of increasing complexity: https://github.com/jasonincanada/stm-haskell
Related posts
- How to achieve "Run at most one parallel async action per user"?
- Loole, A safe sync/async multi-producer, multi-consumer channel, Boosted Async Performance Up to 17%
- What Are The Rust Crates You Use In Almost Every Project That They Are Practically An Extension of The Standard Library?
- LMAX Disruptor – High Performance Inter-Thread Messaging Library
- OCaml: a Rust developer's first impressions