TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: What is the SQLite of nosql databases?

58 pointsby rhimalmost 4 years ago
I am looking for a simple, file-based nosql database. So basically the sqlite of nosql databases.

30 comments

ludocodealmost 4 years ago
As others have mentioned you have lots of options: LMDB, LevelDB&#x2F;RocksDB, BerkeleyDB. For what it&#x27;s worth, I spent a long time looking for an embedded key-value store for my current native project since I didn&#x27;t need the full complexity of SQL. In the end I chose... SQLite.<p>All of these embedded NoSQL databases seem to be missing critical features. One such feature for my use case is database compaction. Last I checked, an LMDB database file can never shrink. Full compaction of LevelDB is slow and complicated (as I understand it essentially breaks the levels optimization which is the whole point of the thing.) SQLite meanwhile supports fast incremental vacuum, and it can be triggered manually or automatically.<p>SQLite just has everything. Plus the reliability is unmatched. Even if you just need a single table that maps blob keys to blob values, I would still recommend SQLite over any NoSQL database today.
评论 #27492452 未加载
creshalalmost 4 years ago
The SQLite of NoSQL is still SQLite: <a href="https:&#x2F;&#x2F;www.sqlite.org&#x2F;json1.html" rel="nofollow">https:&#x2F;&#x2F;www.sqlite.org&#x2F;json1.html</a>
andrey_utkinalmost 4 years ago
Filesystem.<p>Linux has VFS cache which is very robust and efficient.<p>Remember that it is typical for programs to read &#x2F;etc&#x2F;nsswitch.conf, &#x2F;etc&#x2F;resolve.conf and tons of others at startup time - the filesystem is <i>the</i> datasource in Unix tradition, so the machinery is very well optimized.
评论 #27490728 未加载
评论 #27491397 未加载
quantumofalphaalmost 4 years ago
Isn&#x27;t the main feature of nosql supposed to be easy horizontal scalability, the exact opposite of storing everything in a single file?<p>If you just need a r&#x2F;w store for some jsons in a single file, why not sqlite? You can put arbitrary-length blobs into it. Some sql will be involved but you can hide it in a wrapper class tailored to your application with a few dozen lines of code or so.
评论 #27490556 未加载
评论 #27490520 未加载
评论 #27490498 未加载
Rochusalmost 4 years ago
SQLite has a backend which is well suited as a key-value store.<p>Here is a NoSql database based on the SQLite backend: <a href="https:&#x2F;&#x2F;github.com&#x2F;rochus-keller&#x2F;Udb" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rochus-keller&#x2F;Udb</a>.<p>I use it in many of my apps, e.g. <a href="https:&#x2F;&#x2F;github.com&#x2F;rochus-keller&#x2F;CrossLine" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rochus-keller&#x2F;CrossLine</a>. It&#x27;s lean and fast, and supports objects, indices, hierarchical &quot;globals&quot; like ANSI-M and transactions.
fulafelalmost 4 years ago
NoSQL databases have many different different data models. Eg object, document, graph, and key&#x2F;value DBs. In a lot of cases you should probably just use something on top of SQLite, but you should say more about your requirements.<p>An interesting one I ran into recently is Datalevin, a Datalog DB on top of LMDB for Clojure: <a href="https:&#x2F;&#x2F;github.com&#x2F;juji-io&#x2F;datalevin" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;juji-io&#x2F;datalevin</a>
评论 #27493747 未加载
teekayalmost 4 years ago
One of those I&#x27;ve tried is LiteDB - <a href="https:&#x2F;&#x2F;github.com&#x2F;mbdavid&#x2F;LiteDB" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mbdavid&#x2F;LiteDB</a>. I liked it.<p>It&#x27;s small yet capable. If you are familiar with MongoDB, you will feel right at home.<p>It&#x27;s great for .NET developers as it&#x27;s written in C# but since it&#x27;s Netstandard 1.3 compatible, you can presumably run it under Ubuntu or Mac OS or wherever else the new .NET 5 runtime works. I&#x27;ve got a C# app running on ARM64 the other day - just saying.<p>I wrote about my experience playing with LiteDB here - <a href="https:&#x2F;&#x2F;tomaskohl.com&#x2F;code&#x2F;2020-04-07&#x2F;trying-out-litedb&#x2F;" rel="nofollow">https:&#x2F;&#x2F;tomaskohl.com&#x2F;code&#x2F;2020-04-07&#x2F;trying-out-litedb&#x2F;</a>. It&#x27;s not an in-depth look at all, just a few notes from the field, so to speak.
erk__almost 4 years ago
Probably something like LMDB [0] or Tkrzw [1], though nosql is a bit more diverse in a way SQL is not so it is hard to give a clear answer.<p>[0]: <a href="https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Lightning_Memory-Mapped_Database" rel="nofollow">https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Lightning_Memory-Mapped_Data...</a> [1]: <a href="https:&#x2F;&#x2F;dbmx.net&#x2F;tkrzw&#x2F;" rel="nofollow">https:&#x2F;&#x2F;dbmx.net&#x2F;tkrzw&#x2F;</a>
评论 #27490559 未加载
adamanskyalmost 4 years ago
Take a look on the ejdb2 <a href="https:&#x2F;&#x2F;ejdb.org" rel="nofollow">https:&#x2F;&#x2F;ejdb.org</a>
maxk42almost 4 years ago
Take a look at UnQLite: <a href="https:&#x2F;&#x2F;unqlite.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;unqlite.org&#x2F;</a>
kenOfYugenalmost 4 years ago
I ended up writing a small wrapper on top of SQLite based on this: <a href="https:&#x2F;&#x2F;dgl.cx&#x2F;2020&#x2F;06&#x2F;sqlite-json-support" rel="nofollow">https:&#x2F;&#x2F;dgl.cx&#x2F;2020&#x2F;06&#x2F;sqlite-json-support</a><p>With proper concurrency control, it can work very well even for multi process applications.
xiphias2almost 4 years ago
BerkerleyDB is an older, simpler one, LevelDB &#x2F; RocksDB are more modern, maintained, better for SSD workload
评论 #27491185 未加载
Tptalmost 4 years ago
I like sled that is a nice embedded key value store written in Rust: <a href="https:&#x2F;&#x2F;sled.rs&#x2F;" rel="nofollow">https:&#x2F;&#x2F;sled.rs&#x2F;</a><p>However, it is still in heavy development and a bit of a moving target even if the developers are currently heading toward stabilization of the file format.
throwaway888abcalmost 4 years ago
Check LiteStore as bonus you have api included<p><a href="https:&#x2F;&#x2F;h3rald.com&#x2F;litestore&#x2F;" rel="nofollow">https:&#x2F;&#x2F;h3rald.com&#x2F;litestore&#x2F;</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;h3rald&#x2F;litestore" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;h3rald&#x2F;litestore</a>
1vuio0pswjnm7almost 4 years ago
<a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Cdb_(software)" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Cdb_(software)</a>
Blackthornalmost 4 years ago
tkrzw is basically the modern dbm &#x2F; berkeleydb
评论 #27490670 未加载
abrookewoodalmost 4 years ago
I think you want Mongita. It was featured on HN a while ago: &quot;Mongita is to MongoDB as SQLite is to SQL (github.com&#x2F;scottrogowski)&quot; <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26881915" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26881915</a>
quickthrower2almost 4 years ago
An object reference :-)<p>In memory, high performance, no schema. Get the object to journal to disk and you are almost there!
tutlanealmost 4 years ago
Its same as sqlite. You can get more info in this sqlite tutorial.<p><a href="https:&#x2F;&#x2F;www.tutlane.com&#x2F;tutorial&#x2F;sqlite" rel="nofollow">https:&#x2F;&#x2F;www.tutlane.com&#x2F;tutorial&#x2F;sqlite</a>
评论 #27542956 未加载
pistoriuspalmost 4 years ago
Json on the filesystem
Abishek_Muthianalmost 4 years ago
There are also persistent key-value store like dbm as part of standard library in python and several 3rd party implementations like bitcask for Go.
diehundealmost 4 years ago
You mean an embedded NoSQL database? Because all databases whether SQL or NoSQL are file-based with just different formats and structures.
nicoddsalmost 4 years ago
Personally, I like very much leveldb&#x2F;rocksdb. They&#x27;re very fast and solid.
dvfjsdhgfvalmost 4 years ago
My guess is that although you basically describe BerkeleyDB you probably want Redis.
RustyRussellalmost 4 years ago
I&#x27;d nominate TDB (the trivial database). It&#x27;s small, robust, effective
CRConradalmost 4 years ago
Mostly, but actually not totally, kidding: *.INI files.
jf22almost 4 years ago
RavenDb would be what I would use.
amachefealmost 4 years ago
For now, see Postgres as one
basiclaseralmost 4 years ago
Lodb
voodoochiloalmost 4 years ago
<a href="https:&#x2F;&#x2F;unqlite.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;unqlite.org&#x2F;</a>