4 stable releases

5.1.2 Sep 29, 2024
5.1.1 Sep 3, 2024
5.1.0 Aug 23, 2024
5.0.0 Aug 17, 2024

#86 in Database interfaces

45 downloads per month

Apache-2.0

1MB
10K SLoC

Crates.io Discord docs.rs License

PoloDB is an embedded document database.

| Documentations |

Introduction

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

Why

PoloDB aims to offer a modern alternative to SQLite, which is currently the almost exclusive option for client-side data storage. Although SQLite is an old and stable software, it lacks some modern features. That's why we developed PoloDB, which is NoSQL, supports multi-threading and multi-sessions, and retains the embedded and lightweight features of SQLite.

Features

  • Simple and Lightweight
    • can be embedded library or a standalone server
  • Easy to learn and use
    • NoSQL
    • MongoDB-like API
  • Cross-Platform

Quick start

PoloDB is easy to learn and use:

use polodb_core::Database;
use serde::{Serialize, Deserialize};

#[derive(Debug, Serialize, Deserialize)]
struct Book {
    title: String,
    author: String,
}

let db = Database::open_path(db_path)?;
let collection = db.collection::<Book>("books");
collection.insert_one(Book {
    title: "The Three-Body Problem".to_string(),
    author: "Liu Cixin".to_string(),
})?;

Packages

  • polodb: The standalone server of PoloDB, which is compatible with MongoDB's wire protocol.
  • polodb_core: The core library of PoloDB, which can be embedded in your application.

Platform

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

Manual

Roadmap

The features will be implemented one by one in order.

  • Basic database API
    • CRUD
    • Transactions
    • Serde
    • Indexes(Alpha)
    • Aggregation(Alpha)
  • Command line Tools
  • Platforms
    • MacOS
    • Linux
    • Windows
    • iOS
    • Android
  • Languages
    • Python
    • JavaScript

Dependencies

~31–42MB
~741K SLoC