This repository has been archived by the owner on Dec 2, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 12
Drop support of memdb #83
Labels
semver-major
Changes that break backward compatibility
Comments
vweevers
added a commit
that referenced
this issue
Apr 4, 2020
DeferredOpen means that the db opens itself and defers operations until it's open. Currently that's only supported by level(up) and friends. Before, subleveldown would also accept abstract-leveldown db's that were not wrapped in levelup. Opening and closing a sublevel no longer opens or closes the parent db. The sublevel does wait for the parent to open (which in the case of levelup already happens automatically) but never initiates a state change. Drops support of old modules: - memdb (use level-mem instead) - deferred-leveldown < 2.0.0 (and thus levelup < 2.0.0) - abstract-leveldown < 2.4.0 Closes #84, #83 and #60.
vweevers
added a commit
that referenced
this issue
Apr 4, 2020
DeferredOpen means that the db opens itself and defers operations until it's open. Currently that's only supported by level(up) and friends. Before, subleveldown would also accept abstract-leveldown db's that were not wrapped in levelup. Opening and closing a sublevel no longer opens or closes the parent db. The sublevel does wait for the parent to open (which in the case of levelup already happens automatically) but never initiates a state change. Drops support of old modules: - memdb (use level-mem instead) - deferred-leveldown < 2.0.0 (and thus levelup < 2.0.0) - abstract-leveldown < 2.4.0 Closes #84, #83 and #60.
vweevers
added a commit
that referenced
this issue
Apr 5, 2020
DeferredOpen means that the db opens itself and defers operations until it's open. Currently that's only supported by levelup (and levelup factories like level). Previously, subleveldown would also accept abstract-leveldown db's that were not wrapped in levelup. Opening and closing a sublevel no longer opens or closes the parent db. The sublevel does wait for the parent to open (which in the case of levelup already happens automatically) but never initiates a state change. If one closes the parent but not the sublevel, subsequent operations (like get and put) on the sublevel will yield an error, to prevent segmentation faults from underlying stores. Drops support of old modules: - memdb (use level-mem instead) - deferred-leveldown < 2.0.0 (and thus levelup < 2.0.0) - abstract-leveldown < 2.4.0 Closes #84, #83 and #60.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In favor of the newer
level-mem
. I already planned to dropmemdb
; I'm writing this because @bcomnes asked for some context in bcomnes/level-hookdown#29 (comment).Warning: this is a long story. You can skip it if you accept "memdb is old" as a good enough reason 😉
When we moved
subleveldown
to the Level org and updated it to work with latest Level modules, we did not account formemdb
(aslevel-mem
was already the preferred module). It's pure luck that wrappingmemdb
withsubleveldown
still works today. I recently added an integration test (#75) to avoid breaking it (after seeing thatmemdb
is still depended upon). However, we're now at a point where continued support is just madness.A typical db passed to
subleveldown
consist of several "layers". E.g.leveldown
wrapped inencoding-down
wrapped indeferred-leveldown
wrapped inlevelup
. Behind the scenes,subleveldown
unwraps that db to get toleveldown
, then wraps it in a layer that prefixes keys, then (re)wraps that withencoding-down
andlevelup
. For more background, see Level/community#82.The problem with
memdb
is that it depends on an old version ofdeferred-leveldown
(< 2.0.0) which when closed, doesn't expose its underlying db. Sosubleveldown
can only unwrap after opening.This limitation means we can't add a manifest (Level/community#83), which allows to inspect what features a db supports via
db.supports
. For example,db.supports.permanence
indicates whether the underlying storage is persistent. Would be true forleveldown
, false formemdown
. Forsubleveldown
to determine that, it must inspect the manifest of the unwrapped db, and this must happen synchronously, possibly before the db is open. Then you would be able to do:If we drop support of
memdb
, we can unwrap synchronously and expose a manifest.Manifests also make the long-term merging of
levelup
withabstract-leveldown
(Level/community#58) easier. They allow us to determine which features a db already has and skip adding those. Because at some point, db's will be a mix oflevel(up)
andabstract-leveldown
features. Eventually, the unwrapping insubleveldown
will also become simpler (thanks to needing less layers). Full circle :)The text was updated successfully, but these errors were encountered: