Giter Club home page Giter Club logo

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
  • Easy to learn and use
    • NoSQL
    • MongoDB-like API
  • Cross-Platform
  • Multiple backends
    • Filesystem(WAL)
    • Memory
    • IndexedDB(WIP)

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_file(db_path)?;
let collection = db.collection::<Book>("books");
collection.insert_one(Book {
    title: "The Three-Body Problem".to_string(),
    author: "Liu Cixin".to_string(),
})?;

Backends

Filesystem Backend

With the filesystem backend, PoloDB stores data in a single 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 bson format and stored in the PoloDB's lsm-tree 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.

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.

  • Backend
    • Memory
    • File
    • IndexedDB(WIP)
  • Basic database API
    • CRUD
    • Transactions
    • Serde
    • Indexes(Alpha)
    • Aggregation
  • Command line Tools
  • Platforms
    • MacOS
    • Linux
    • Windows
    • Web Browser(WIP)
    • iOS
    • Android
  • Visualization Tools

polodb's Projects

polodb icon polodb

PoloDB is an embedded document database.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.