Comments (5)
The most interesting I have found is level, which bundles levelup, leveldown and encoding-down
https://www.npmjs.com/package/level
- level
- exports a function that returns a levelup instance when invoked
- bundles the current release of levelup and leveldown
- leverages encodings using encoding-down
- levelup
- Fast and simple storage.
- A Node.js wrapper for abstract-leveldown
- leveldown
- provides a pure C++ binding to LevelDB
- LevelDB
- Is a simple key-value store built by Google
- supports arbitrary byte arrays as both keys and values, singular get, put and delete operations, batched put and delete, bi-directional iterators and simple compression using the very fast Snappy algorithm.
- encoding-down
- It allows you to specify an encoding to use for keys and values independently
- The encoding is applied to all read and write operations
- The default encoding is utf8 which ensures you'll always get back a string. You can also provide a custom encoding like bytewise - or your own
from sheikah.
After checking more storage solutions I think this one is better for our needs as it offers serialization:
https://www.npmjs.com/package/lowdb
lowdb
- Small JSON database for Node, Electron and the browser. Powered by Lodash
- Syntax
db.get('posts')
.push({ id: 1, title: 'lowdb is awesome'})
.write()
- FileSync, FileAsync and LocalStorage accept custom serialize and deserialize functions. You can use them to add encryption logic
const adapter = new FileSync('db.json', {
serialize: (data) => encrypt(JSON.stringify(data))
deserialize: (data) => JSON.parse(decrypt(data))
})
from sheikah.
Even though I like the lowdb
API the most, I have a couple of concerns about such solution:
- It seems to me that FileSync handles data as text and writes to the DB file in text mode, so an encoding like
base64
would be needed to represent encrypted data and thus we are forced to bear a 33% expansion. - Its robustness and consistency is questioned for non-trivial use cases, and it has no error correction at all (see discussion here).Their own README says it becomes unreliable as the DB file grows.
Regarding Level, it's true that being a pure key/value store, it lacks rich QL capabilities. But apart from that, it is much stronger than lowdb
in the two areas I'm more concerned about:
- It supports binary mode by instatiating
levelup
with{ encoding: 'binary' }
. In addition, it has native compression (Google's Snappy). - LevelDB is not totally free from corruption, but has been proven to be a reasonably solid solution for embedded DBs (i.e.: Bitcoin Core uses LevelDB for storing the whole blockchain).
@kronolynx What do you think?
from sheikah.
@aesedepece after reading the discussion and your arguments, I think level
should be used.
from sheikah.
Great, we can consider this done. OK to close.
from sheikah.
Related Issues (20)
- Incompatibility between vite and vue-styleguidist HOT 1
- Add new public nodes to Sheikah configuration file HOT 1
- Release v1.11.5 HOT 1
- Assess how to improve Sheikah synchronization
- Add a QR code to export your xprv HOT 5
- Generate transactions without persisting change addresses
- Add shortcut to delete Sheikah files HOT 1
- Fix unit testing in Vue3 branch
- Fix build script in vue3 branch
- [vue3]: Fix settings close button svg HOT 1
- [vue3]: Fix inter process communication
- Release Sheikah 1.12.0-rc HOT 1
- Implement option to send all funds
- Update links HOT 2
- Improve validations
- Release 1.12.0 HOT 4
- Avoid unexpected close when double wallet instance HOT 1
- Merge vue3 branch in main HOT 1
- Upgrade `witnet-request-js`
- Fix operators over an array of integers
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 sheikah.