File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1+ # Tradeoffs of using or not Optimistic Transaction DB in RocksDB
2+
3+ ## Advantages of Optimistic Transactions
4+ - Easier to keep consistency between multiple writers.
5+ - Easier to keep consistency with readers.
6+
7+ ## Advantages of Pessimistic Transactions
8+ - Lower memory usage?
9+ - No conflict resolution.
10+
11+ ## Advantages of Non-Transactional DB
12+ - ` delete_range ` : much faster key deletion in bulk, useful during healing.
13+ - Lower memory usage (confirm).
14+ - Secondary instances are either much easier or possible.
15+
16+ ## Alternatives to DB Transactions
17+ - We can use snapshots/secondary instances to provide a consistent view to block production and protocols.
18+ - We can provide crash safety by adding checkpoints or explicit markers so we can go back to the last known consistent version.
19+ - We would need to run a healing pass from that point on startup, to fix possible partial changes to tries.
20+ - We would need to add explicit tests for crashing during writes to make sure we recover correctly.
21+ - L2 can't recover from peers (at least until Based), so it should probably remain transactional.
You can’t perform that action at this time.
0 commit comments