Comments (4)
The backstory of abstract-level
can be found in the FAQ: What is abstract-level
?
The short version, that I hope will answer your more specific questions, is this:
- LevelDB is a C++ project by Google. We're not affiliated with Google.
leveldown
was a Node.js binding for LevelDBlevelup
wrappedleveldown
in a more convenient interface, later indeed including promisesleveldown
andlevelup
are now legacy modulesclassic-level
is effectively a merger ofleveldown
andlevelup
. It's thus a binding to LevelDB with a convenient interface. I say effectively because the real story is more nuanced and can be found in the FAQ that I mentioned.
If I instead were to explain the relationships to someone that's new to Level (and thus doesn't have to know about leveldown
and levelup
), then I would say, using OOP terms:
AbstractLevel
is an abstract class for a lexicographically sorted key-value database. It handles state, encodings and other generic behaviors that can be implemented in pure JavaScript.ClassicLevel
implements that abstract class, using LevelDB for storage.
from classic-level.
In case your question is, should I use classic-level
or leveldown
? Then the answer is classic-level
, without a doubt.
Legacy modules like leveldown
are no longer maintained. They work perfectly fine, but won't get new features, performance improvements or other updates. Feature-wise, classic-level
has the following additional features:
- Sublevels
- Support of Uint8Array
iterator.nextv()
anditerator.all()
- Built-in TypeScript types
And more features are coming soon:
- Hooks
- Support of
AbortSignal
- Explicit snapshots (this one will probably take longer)
from classic-level.
AbstractLevel
is an abstract class for a lexicographically sorted key-value database. It handles state, encodings and other generic behaviors that can be implemented in pure JavaScript.ClassicLevel
implements that abstract class, using LevelDB for storage.
Thanks a lot, I saw the compare with levelDB and rocksDB in internet, it is said rocksDb is the better one. By your mention, I could write code with abstractlevel or classiclevel, but if i want in the future, i could just simply replace the require/import package, it is that right?
will you plan to upgrade the rocksdb package to the abstractlevel style?
from classic-level.
We don't have a (new) RocksDB binding yet, see Level/abstract-level#14. I can't say when that will happen, it's low priority atm.
But yes, once that's available, you could replace const { ClassicLevel } = require('classic-level')
with const { RocksLevel } = require('rocks-level')
and you'll get the same interface.
PS. "Better" is subjective. LevelDB is a good choice (and the most popular among Level users) when you want small binaries, a wide range of supported platforms, and good general performance (that isn't optimized for one particular scenario like SSDs). RocksDB does have more features, but the majority are not exposed in our bindings because those features don't fit in the abstract-level
interface and RocksDB receives less attention from us.
from classic-level.
Related Issues (20)
- missing try/catch for bad_alloc
- Seek while next is executing HOT 2
- Seek data race HOT 1
- Segmentation Fault alpine linux in Docker on arm mac HOT 9
- How to make backups? HOT 1
- How can I compile the latest LevelDB version HOT 1
- Specify a custom prebuilds location HOT 2
- Compacting the database on close: advice or feature request HOT 3
- Infinite compaction loop?
- A database modified in Linux fails to open in Windows? HOT 1
- Support for readonly mode HOT 1
- Error While Installing Hardhat HOT 1
- `linux-arm` and `linux-arm64` prebuild comes with GLIBC which is too new for Raspberry Pi HOT 8
- QOL API methods HOT 4
- RSS memory spike using batchDelete HOT 1
- "database is not open" on NFS HOT 14
- No native build was found for platform=darwin arch=arm64 HOT 2
- `classic-level` rebuild failed when `electron-forge package` HOT 3
- Possible memory leak when putting a value with the same key HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from classic-level.