AxisDB ๐Ÿ—ƒ๏ธ

Problem โ†’ Solution โ†’ Impact

Problem: Small projects often need reliable, lightweight data storage without a full-blown RDBMS.

Solution: AxisDB is a Python-native, atomic, multidimensional key-value JSON database with optional RESTful interface.

Impact: Provides durable and minimal-effort local storage with modern developer ergonomics. Install via PyPI

bash

    
      user@linux:~$ 
      python3 -m venv venv
      
    
    
      user@linux:~$ 
      source venv/bin/activate
      
    
    
      user@linux:~$ 
      pip install --upgrade pip
      
    
    
      user@linux:~$ 
      pip install axisdb
      
    
  

python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install axisdb

Rationale

Because everything else was too normal...

What is it? A lightweight atomic JSON database. Because sometimes SQLite is too much and CSVs make me sad. AxisDB is a tiny embedded document database for Python, designed for simple, reliable storage of JSON documents addressed by N-dimensional coordinate keys.

I've deployed it on PyPi. This was a fun project idea I had and I decided to turn into a real thing. I explored other embedded JSON stores but they didnโ€™t enforce atomic writes in a way I needed here.

Quick start

Create a quick test script (see the install steps in the terminal above):

axisdbmain.py
from axisdb import AxisDB

db = AxisDB.create("./mydb.json", dimensions=2)
db.set(("user1", "orders"), {"count": 3})
db.commit()

ro = AxisDB.open("./mydb.json", mode="r")
print(ro.get(("user1", "orders")))

Or additionally define a field index:

Define a field index
from axisdb import AxisDB

db = AxisDB.create("./mydb.json", dimensions=2)
db.define_field_index("by_customer_id", ("customer_id",))

Or perhaps query with an expression:

Query example
from axisdb import AxisDB
from axisdb.query.ast import Field

db = AxisDB.open("./mydb.json", mode="r")
rows = db.find(prefix=("orders",), where=Field(("customer_id",), "==", "c2"))
bash
user@linux:~$ python -m uvicorn axisdb.server.app:app --reload
python -m uvicorn axisdb.server.app:app --reload

Then the server will start at:

http://localhost:8000

AxisDB

AxisDB is a tiny embedded document database for Python, designed for simple, reliable storage of JSON documents addressed by N-dimensional coordinate keys.

It is library-first, requires no server and stores all data in a single JSON file with atomic, crash-safe commits.

See also: USE_CASES.md - a concise overview of practical applications and patterns enabled by this multidimensional JSON storage model.


Key Properties

  • Library-first design
  • Single-file JSON storage
  • Atomic, crash-safe commits
  • Safe multi-process access
  • Minimal query/indexing support

Features

  • N-dimensional coordinate keys
  • Atomic commit and recovery
  • Multidimensional slicing
  • Query with persisted indexes
  • Optional FastAPI wrapper with Swagger + ReDoc