-
Notifications
You must be signed in to change notification settings - Fork 107
docs(l1): tradeoffs of transactional RocksDB modes #4744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,21 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# Tradeoffs of using or not Optimistic Transaction DB in RocksDB | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
## Advantages of Optimistic Transactions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- Easier to keep consistency between multiple writers. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- Easier to keep consistency with readers. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
## Advantages of Pessimistic Transactions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- Lower memory usage? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The trailing question mark signals uncertainty. Either provide data/supporting rationale or remove the entry until confirmed.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- No conflict resolution. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
## Advantages of Non-Transactional DB | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- `delete_range`: much faster key deletion in bulk, useful during healing. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- Lower memory usage (confirm). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The '(confirm)' note indicates an unverified claim; replace with concrete information or remove pending validation.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- Secondary instances are either much easier or possible. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sentence is ambiguous ('either much easier or possible'). Clarify whether non-transactional mode enables secondary instances at all, or simply reduces complexity.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
## Alternatives to DB Transactions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- We can use snapshots/secondary instances to provide a consistent view to block production and protocols. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- We can provide crash safety by adding checkpoints or explicit markers so we can go back to the last known consistent version. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- We would need to run a healing pass from that point on startup, to fix possible partial changes to tries. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- We would need to add explicit tests for crashing during writes to make sure we recover correctly. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+12
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] Consider explicitly listing required additional mechanisms (healing pass, crash tests, checkpoints) as 'Operational Requirements' to distinguish them from 'Advantages'; current mix may confuse readers about what is a benefit vs. a cost.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback
Comment on lines
+17
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] Consider explicitly listing required additional mechanisms (healing pass, crash tests, checkpoints) as 'Operational Requirements' to distinguish them from 'Advantages'; current mix may confuse readers about what is a benefit vs. a cost.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- L2 can't recover from peers (at least until Based), so it should probably remain transactional. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Term 'Based' is unexplained; add a brief definition or link so readers understand the dependency or future milestone.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heading is grammatically awkward; consider rephrasing for clarity.
Copilot uses AI. Check for mistakes.