MatrixAI / js-db

Key-Value DB for TypeScript and JavaScript Applications
https://polykey.com
Apache License 2.0
5 stars 0 forks source link

Serializable Snapshot Isolation #40

Open CMCDragonkai opened 2 years ago

CMCDragonkai commented 2 years ago

Specification

Currently there's still a concurrency anomaly even with SI. And that's called write skew.

SSI is an innovation on top of SI that completely removes concurrency anomaly.

I'm not sure how difficult it is to implement, cockroachdb did it on top of rocksdb, but I cannot find the source.

Doing this, should eliminate any need to have DBTransaction.getForUpdate, it would be sufficient to just use get.

This trades off a little higher conflict contention, because there can be some false positives when throwing a transaction conflict.

At the end of the day, PCC locking should be used anyway to prevent contention in these scenarios.

Additional context

Tasks

  1. ...
  2. ...
  3. ...