Hey everyone! 👋
After years of making CLI tools and small Node.js scripts, I kept running into the same problem:
“How do I reliably store local data without spinning up a full database engine?”
Most of the existing JSON databases for Node.js are either:
- too simple (no crash protection)
- too slow
- or completely skip important features like WAL or fsync
🧠 So I built WiseJSON
A reliable, segment-based embedded JSON database for Node.js.
With full support for:
✅ WAL (Write-Ahead Logging)
✅ Checkpoints (segment-based, fast recovery)
✅ fsync for safety
✅ In-memory indexes (including unique ones)
✅ CLI support
✅ Zero dependencies except uuid
✅ pkg-friendly (can be bundled into binaries)
🔧 What makes WiseJSON different?
- Everything is stored in the filesystem — no daemon, no server
- You can use it in CLI apps, scripts, microservices
- Recovery is safe even after crashes or power loss
- Checkpoints are written in segments to keep things scalable
🚀 Install & Use
npm install wise-json-db
npx wise-json insert users name=Alice email=alice@example.com
npx wise-json list users
Example .js
usage:
const WiseJSON = require('wise-json-db');
const db = new WiseJSON('./my-db');
(async () => {
const users = await db.collection('users');
await users.createIndex('email', { unique: true });
const user = await users.insert({ name: 'Alice', email: 'alice@example.com' });
console.log(user._id);
await db.close();
})();
💬 Why I’m proud of this project
This is honestly the first open source project I’ve built where I took the time to get everything right:
- Proper fsync safety
- WAL + segmented checkpoint logic
- Clean CLI
- Real-world tests (including crash tests and stress tests)
- Full documentation and even a logo
It’s not the fastest database — and it’s not meant to be.
It’s built to be safe, predictable, and easy to reason about.
🧪 What’s tested
- Thousands of WAL writes under fsync
- Segment splitting with small limits
- Recovery after crash or deletion
- Manual flush and checkpointing
- Segment-level file validation
You can find all test scripts under
/test
in the GitHub repo.
🔗 Links
- GitHub: github.com/Xzdes/WiseJSON
- npm: wise-json-db
🙏 I’d love feedback — or just a star if you like the idea.
Thanks for reading!
There is a new super version of WiseJSON, see the post on the channel