Skip to main content

A log-structured, partitioned NoSQL database engine with full-text search, numeric indexes, and dual TCP/HTTP protocols.

Project description

MkDB

MkDB is a Custom Log-Structured Merge & Partitioned Redundant Storage Engine built entirely in Python. It provides a robust, highly-available NoSQL/Document database experience with secondary indexing, full-text search, and dual-protocol network access.

Architecture Highlights

  • Rolling Log Storage Engine: Append-only storage format guaranteeing high write availability with safe background compaction.
  • RAM Cache & Debounced Write Queue: In-memory caching and debounced batching for extreme performance under high write load.
  • Query Engine & Secondary Indexes: Fully featured query evaluation including numeric range checks and tokenized full-text inverted indexes.
  • Data Integrity: Multi-disk mirroring and Reed-Solomon parity encoding for proactive self-healing and failover.
  • Dual Protocols: Accessible via high-speed, persistent TCP WebSockets or standard stateless REST HTTP endpoints.
  • Web Administration UI: Includes an embedded web control panel out-of-the-box (/control endpoint).

Project Structure

  • src/db/: The core database engine (storage primitives, RAM caching, query evaluator, auto-compaction and parity management).
  • src/server/: The networking boundary. Houses the TCP Socket and HTTP REST servers, as well as the web-based Control Panel.
  • src/config/: Configuration schemas for tailoring memory limits, storage thresholds, and cluster layout.
  • sdk/: The official MkDBClient for programmatic interaction from Python code.

Getting Started

Prerequisites

  • Python 3.10+
  • The database storage format is built into MkDB natively, but you'll need the following for advanced data integrity features (Reed-Solomon logic):
    pip install reedsolo
    

Starting the Server

MkDB operates as a CLI tool. Launch the engine by pointing it to your desired database directory (which must contain a config.json file configuring your stores and network bindings):

python mkdb.py /path/to/your/db

Once running, the database will host both TCP socket and HTTP interfaces as specified in your config.json. The web control panel is accessible via your browser (check server output for the bound port, normally http://localhost:<port>).

Using the Python SDK

The MkDBClient connects seamlessly to your database and abstracts the dual-protocol system:

from sdk.mkdb_client import MkDBClient

client = MkDBClient()
client.connect(host="127.0.0.1", port=8080)

# Writing a document (computes delta updates intelligently)
client.set(
    store="products",
    record_id="prod_001",
    data={"name": "Steel Bolt", "price": 9.99, "category": "fasteners"}
)

# Reading a document
record = client.get("products", "prod_001")

# Querying with filters
results = client.query("products", filter={
    "price": {"<=": 10.00},
    "category": ["fasteners"]
})

See the docs/ folder for comprehensive guides on the Query Syntax and SDK Reference.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymkdb-0.1.3-py3-none-any.whl (211.1 kB view details)

Uploaded Python 3

File details

Details for the file pymkdb-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pymkdb-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 211.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.7

File hashes

Hashes for pymkdb-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ca28b1c17e18eb45503a7356bc4b499bafec53e24bb70636a5f6de9f411ccbd9
MD5 1a464a4b58c62c47baa8c9296d9e685d
BLAKE2b-256 4c81e93b5f7b941b3718148552d0b2b992851269a0753bfeaffcf5a61d2fb369

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page