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

Implementing transaction on top of LevelUp? #691

Closed
endyjasmi opened this issue Mar 21, 2020 · 2 comments
Closed

Implementing transaction on top of LevelUp? #691

endyjasmi opened this issue Mar 21, 2020 · 2 comments

Comments

@endyjasmi
Copy link

Hello, I am currently implementing a document engine on top LevelUp with support for transaction. The transaction implementation is greatly inspired by this article from 2015. Sadly there is no way to follow down that path as currently LevelUp does not support snapshot.

  1. I am wondering if there's a plan to implement snapshot feature?
  2. If not, if there's a plan to implement .prev method on the LevelDown iterator?
  3. If not, if there is other method of implementing transaction on top of LevelUp?

The reason I am sticking with LevelUp is because I need the document engine to runs on browser also on nodejs (that rule's out sqlite).

Thanks in advance.

@vweevers
Copy link
Member

  1. I am wondering if there's a plan to implement snapshot feature?

Iterators do operate on a snapshot; if that isn't sufficient see Level/community#47 (TLDR: we need a good use case and a good API).

  1. If not, if there's a plan to implement .prev method on the LevelDown iterator?

See Level/abstract-leveldown#339 and Level/leveldown#646.

  1. If not, if there is other method of implementing transaction on top of LevelUp?

Various people have attempted it: https://github.com/Level/awesome#atomicity

I need the document engine to runs on browser also on nodejs (that rule's out sqlite).

In that case, exposing a snapshot can't be done, because IndexedDB doesn't have the necessary primitives.

@endyjasmi
Copy link
Author

Well, thank you for reply. I'll explore the links you shared. Worst come to worse, maybe I'll implement on top of sqlite for nodejs and indexeddb for browser but it's going to take twice the work and I am reluctant to do it.

Anyway, thanks once again.

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

No branches or pull requests

2 participants