Node嵌入式数据存储 NeDB

码农软件 · 软件分类 · Node.js 扩展 · 2019-04-15 17:57:31

软件介绍

Node.js 实现的嵌入式数据存储,可以部分或全部替代sqlite数据库。可以当内存数据库使用也可本地存储。

NEDB采用非常灵活的查询方式,让你几乎可以忘记他是非关系数据库:

  (1) 可以使用正则查询

  (2) and or where  大于 小于 排序等 

  (3) 索引

数据存储采用JSON新式,可以深度查询。

eg:

// Let's say our datastore contains the following collection


{ _id: 'id5', completeData: { planets: [ { name: 'Earth', number: 3 }, { name: 'Mars', number: 2 }, { name: 'Pluton', number: 9 } ] } }
db.find({ "completeData.planets.0.name": "Earth" }, function (err, docs) { // docs contains document 5 // If we had tested against "Mars" docs would be empty because we are matching against a specific array element });

语法和MongoDB非常相似.

Speed

  • Insert: 5,950 ops/s

  • Find: 25,440 ops/s

  • Update: 4,490 ops/s

  • Remove: 6,620 ops/s

Memory footprint

A copy of the whole database is kept in memory. This is not much on the expected kind of datasets (20MB for 10,000 2KB documents). If requested, I'll introduce an option to not use this cache to decrease memory footprint (at the cost of a lower speed).

缺点:数据加载在内存中进行操作,不适合内存非常紧张的应用。目前作者没有给出细腻度的内存控制方法。

本文地址:https://codercto.com/soft/d/3652.html

大话存储Ⅱ

大话存储Ⅱ

张冬 / 清华大学出版社 / 2011-5 / 99.00元

《大话存储2:存储系统架构与底层原理极限剖析》内容简介:网络存储是一个涉及计算机硬件以及网络协议/技术、操作系统以及专业软件等各方面综合知识的领域。目前国内阐述网络存储的书籍少之又少,大部分是国外作品,对存储系统底层细节的描述不够深入,加之术语太多,初学者很难真正理解网络存储的精髓。《大话存储2:存储系统架构与底层原理极限剖析》以特立独行的行文风格向读者阐述了整个网络存储系统。从硬盘到应用程序,对......一起来看看 《大话存储Ⅱ》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具