rename project to MultiforaDB
Prose and benchmark tables use MultiforaDB; the binary, the CLI usage line, the log-message prefix and the default database file use multiforadb. Two consequences worth noting: - build.zig.zon's fingerprint is derived from the package name, so it had to change with it (Zig refuses to build otherwise). A consumer pinning this package by fingerprint needs updating. - the default --db path is now multiforadb.log, and getCmdLineOpts reports it as dbpath. An existing mongo-lite.log has to be passed explicitly with --db. The e2e harness abbreviated the old name as ML_; that is now MFDB_, including the documented ML_BIN override (MFDB_BIN) and the scratch file names. MD_ (mongod) is untouched. compare-run.sh spawned the server by absolute path under a sandbox/mongo-lite directory that no longer exists; that block already runs from tests/e2e, so it uses a relative path now. The archived reports under tests/e2e/results/ keep the old name: they record what the old binary measured.
This commit is contained in:
32
README.md
32
README.md
@@ -1,4 +1,4 @@
|
||||
# mongo-lite
|
||||
# MultiforaDB
|
||||
|
||||
A lightweight, embedded MongoDB-compatible document database written in
|
||||
Zig 0.16. Like SQLite, it stores everything in a single file; unlike SQLite,
|
||||
@@ -11,7 +11,7 @@ driver, PyMongo — connect over TCP and just work.
|
||||
zig build # build the server
|
||||
zig build test # run the unit test suite
|
||||
|
||||
zig-out/bin/mongo-lite --port 27017 --db data.log --compact-threshold 256m
|
||||
zig-out/bin/multiforadb --port 27017 --db data.log --compact-threshold 256m
|
||||
|
||||
# in another terminal:
|
||||
mongosh --port 27017
|
||||
@@ -181,27 +181,27 @@ the `tests/e2e/big.js` harness (12-core/32 GB Mac):
|
||||
## Performance vs MongoDB
|
||||
|
||||
`tests/e2e/compare-run.sh` runs the same driver workload (1 GB, 65,536 ×
|
||||
16 KB docs, every write durable — mongo-lite fsyncs per command, mongod
|
||||
16 KB docs, every write durable — MultiforaDB fsyncs per command, mongod
|
||||
runs with `j: true`) against each server and prints a side-by-side table.
|
||||
With the ReleaseFast default build (MongoDB 8.3.7 on the same Mac):
|
||||
|
||||
| benchmark | mongo-lite | mongodb | winner |
|
||||
| benchmark | MultiforaDB | mongodb | winner |
|
||||
|---|---|---|---|
|
||||
| insertOne (sequential) | 0.20 ms | 4.7 ms | **mongo-lite ×24** |
|
||||
| bulk insert (insertMany) | 752 MB/s | 744 MB/s | mongo-lite |
|
||||
| createIndex({k: 1}) | 67 ms | 76 ms | **mongo-lite** |
|
||||
| countDocuments({}) | 2.6 ms | 11.2 ms | **mongo-lite ×4** |
|
||||
| findOne({_id}) | 0.45 ms | 0.65 ms | **mongo-lite** |
|
||||
| findOne indexed | 0.54 ms | 4.6 ms | **mongo-lite ×8** |
|
||||
| insertOne (sequential) | 0.20 ms | 4.7 ms | **MultiforaDB ×24** |
|
||||
| bulk insert (insertMany) | 752 MB/s | 744 MB/s | MultiforaDB |
|
||||
| createIndex({k: 1}) | 67 ms | 76 ms | **MultiforaDB** |
|
||||
| countDocuments({}) | 2.6 ms | 11.2 ms | **MultiforaDB ×4** |
|
||||
| findOne({_id}) | 0.45 ms | 0.65 ms | **MultiforaDB** |
|
||||
| findOne indexed | 0.54 ms | 4.6 ms | **MultiforaDB ×8** |
|
||||
| range-scan count | 13.7 ms | 12.6 ms | mongodb ×1.1 |
|
||||
| sort + limit(20), on `_id` | 2.3 ms | 2.0 ms | mongodb ×1.1 |
|
||||
| sort + limit(20), indexed field | 1.0 ms | — | — |
|
||||
| aggregate $group | 8.1 ms | 12.3 ms | **mongo-lite** |
|
||||
| updateOne({_id}) | 0.15 ms | 0.19 ms | **mongo-lite** |
|
||||
| updateMany (65 docs) | 1.7 ms | 6.1 ms | **mongo-lite ×3.6** |
|
||||
| deleteOne + insert | 0.50 ms | 4.9 ms | **mongo-lite ×10** |
|
||||
| server RSS | 539 MB | 1.3 GB | **mongo-lite ×2.4** |
|
||||
| kill -9 → reopen | 0.8 s | 1.3 s | **mongo-lite** |
|
||||
| aggregate $group | 8.1 ms | 12.3 ms | **MultiforaDB** |
|
||||
| updateOne({_id}) | 0.15 ms | 0.19 ms | **MultiforaDB** |
|
||||
| updateMany (65 docs) | 1.7 ms | 6.1 ms | **MultiforaDB ×3.6** |
|
||||
| deleteOne + insert | 0.50 ms | 4.9 ms | **MultiforaDB ×10** |
|
||||
| server RSS | 539 MB | 1.3 GB | **MultiforaDB ×2.4** |
|
||||
| kill -9 → reopen | 0.8 s | 1.3 s | **MultiforaDB** |
|
||||
| db on disk | 97 MB | 91 MB | mongodb |
|
||||
|
||||
The engine now holds every document as canonical BSON bytes in a
|
||||
|
||||
Reference in New Issue
Block a user