14 releases (1 stable)

2.0.0 Nov 4, 2021
0.11.0 Oct 28, 2021
0.10.4 Oct 27, 2021
0.10.0 Feb 19, 2021
0.2.0 Nov 7, 2020

#126 in Database implementations

Download history 7/week @ 2022-01-24 7/week @ 2022-01-31 7/week @ 2022-02-07 5/week @ 2022-02-14 20/week @ 2022-02-21 8/week @ 2022-02-28 4/week @ 2022-03-07 46/week @ 2022-03-14 49/week @ 2022-03-21 8/week @ 2022-03-28 22/week @ 2022-04-04 9/week @ 2022-04-11 6/week @ 2022-04-18 90/week @ 2022-04-25 111/week @ 2022-05-02 18/week @ 2022-05-09

228 downloads per month
Used in polodb_core

MIT license

2.5K SLoC


Build Status Crates.io PYPI version

PoloDB is an embedded JSON-based database.



  • Simple and Lightweight
    • Only cost ~500kb memory to serve a database
    • The database server binary is less than 2Mb
  • Easy to learn and use
    • NoSQL
    • MongoDB-like API
  • Various language bindings
  • Can be embedded or standalone
    • Embedded Mode
      • No standalone processes
      • No cross-process calls
      • No runtime dependency
    • Standalone: Run as a process, communicate with IPC
  • Cross-Platform
  • Multiple backends
    • Filesystem(WAL)
    • Memory

Filesystem Backend

With the filesystem backend, PoloDB stores data in ONE file. All the data are saved persistently on the disk.

It's designed to be flexible, universal, and easy to be searched. All the data are encoded in msgpack format and stored in the PoloDB's btree format.

PoloDB uses WAL(write-ahead logging) to implement transactional writing and protect your data from program crashes.

Memory Backend

With the memory backend, all the data all stored in memory, making PoloDB a pure memory database.


PoloDB is a library written in Rust that implements a lightweight MongoDB.

PoloDB has no dependency(except for libc), so it can be easily run on most platforms (thanks for Rust Language).

The data of PoloDB is stored in a file. The file format is stable, cross-platform, and backwards compatible.

The API of PoloDB is very similar to MongoDB. It's very easy to learn and use.


Theoretically, PoloDB supports all platforms that the Rust compiler supports. But PoloDB is a personal project currently. Limited by my time, I have only compiled and tested on the following platforms:

  • macOS Big Sur x64
  • Linux x64 (Tested on Fedora 32)
  • Windows 10 x64


Developing Plan

The features will be implemented one by one in order.

  • Basic database API
    • CURD
    • Transactions
    • Indexes
    • Aggregation
  • Command line Tools
  • Language bindings
  • Multi-threads support
  • Extension API
    • Data Encryption
    • JavaScript Engine
  • Visualization Tools

V1 to V2

PoloDB V2 uses msgpack to encode data.

PoloDB V1 uses custom format.



Database::v1_to_v2 can be used to migrate from v1 to v2.


polodb migrate --target v2 ./mydb


Module Path Description
Core src/polodb_core The core implementation of the Database
C Library src/polodb_clib The C FFI implementation of PoloDB
CLI tool src/polodb The command line tool of PoloDB
Node.js polodb.js The Node.js binding using N-API
Python bindings pypolodb The CPython binding using Extension API


~16K SLoC