Skip to content
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

Feat transaction #83

Merged
merged 55 commits into from
Mar 21, 2023
Merged

Feat transaction #83

merged 55 commits into from
Mar 21, 2023

Conversation

Leeeon233
Copy link
Member

@Leeeon233 Leeeon233 commented Mar 15, 2023

Feature

A transaction is an important feature. It can support atomicity, operation merging / event aggregation, and even meet the needs of parallel transactions and isolation for CRDT databases in the future. We will implement all the features in multiple versions.

This PR implements the first version of the transaction, or simply understands it as an event aggregator. All operations inside a transaction will be applied immediately. The events will be cached and attempted to be merged, sending them only when the transaction is committed.

We plan to implement the following features in future versions:

  • Abortability (rollback)
  • Merge all Ops inside a transaction into one Change to provide proper semantics for redo/undo
  • Parallel Transaction
    • rebase
    • isolation

TODO

  • use rope to concatenate and split String
  • decode by transaction
  • Origin
  • wasm API
  • ...

#81 has been merged in this pr.

@Leeeon233 Leeeon233 requested a review from zxch3n March 20, 2023 06:56
@Leeeon233 Leeeon233 self-assigned this Mar 20, 2023
crates/loro-internal/src/transaction.rs Show resolved Hide resolved
crates/loro-internal/src/hierarchy.rs Outdated Show resolved Hide resolved
crates/loro-internal/src/log_store.rs Outdated Show resolved Hide resolved
crates/loro-internal/src/prelim.rs Outdated Show resolved Hide resolved
@zxch3n zxch3n merged commit 647ad22 into main Mar 21, 2023
@Leeeon233 Leeeon233 deleted the feat-transaction branch March 21, 2023 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants