Skip to main content

A session-scoped self-adaptive database framework for logical object-oriented data management.

Project description

Assignment 3: Logical Dashboard & Transactional Validation

Course: CS 432 – Databases (Semester II, 2025 - 2026)
Instructor: Dr. Yogesh K. Meena

Team Members:

  • Deep Buha (24110082) - 24110082@iitgn.ac.in
  • Devansh Lodha (23110091) - devansh.lodha@iitgn.ac.in
  • Laxmidhar Panda (24110185) - 24110185@iitgn.ac.in
  • Yuvraj Rathod (24110293) - yuvraj.rathod@iitgn.ac.in
  • Viraj Solanki (24110348) - viraj.solanki@iitgn.ac.in

1. Overview

This repository implements the final phase of the session-scoped, self-adaptive database framework. It introduces a purely logical React-based dashboard interface and a robust Transaction Coordination Layer.

The framework autonomously translates abstract JSON requests into complex PostgreSQL LEFT JOIN and JSONB operations. By fully unifying the relational and document-store models into a single PostgreSQL engine, the system eliminates the need for Two-Phase Commit (2PC) coordinators while strictly guaranteeing ACID properties across normalized child tables and schema-less documents.


2. Steps to Execute the Code

Prerequisites

  • Docker Engine (Must be running)
  • Just (Command runner): brew install just / apt install just / choco install just
  • uv (Python package manager): curl -LsSf https://astral.sh/uv/install.sh | sh

Setup & Configuration

Clone the repository and set up the environment variables:

cp .env.example .env

Run the Data Population Pipeline

Initialize the database, start the FastAPI engine, and stream 1,000 highly nested records through the simulation server to trigger autonomous schema inference and DDL materialization.

just demo2

Run the Logical Dashboard

Build and launch the React/Vite dashboard container. The dashboard strictly enforces logical boundaries, hiding all SQL tables and physical JSONB columns.

just webapp

Access the dashboard at: http://localhost:5173

Run the ACID Validation Suite

Execute the automated testing suite validating Atomicity, Consistency, Isolation, and Durability across multi-table insertions and concurrent JSONB mutations.

just test-acid

Teardown

Terminate background processes and destroy database containers/volumes.

just stop
just down

3. Project Structure

chiral-db/
├── demo2.py                          # E2E pipeline trigger (Ingestion -> Analysis -> DDL)
├── Justfile                          # Automation commands
├── src/chiral/
│   ├── main.py                       # FastAPI entry point & Logical Schema APIs
│   ├── core/
│   │   └── query_service.py          # AST Compiler, JSONB abstraction hooks, Logical Reconstruction
│   ├── db/
│   │   ├── query_builder.py          # jsonb_set compilation and parameterized JOIN generation
│   │   └── schema.py                 # DDL Materialization for dynamic parent and child tables
│   └── worker/
│       └── migrator.py               # Data splitting and zero-casting SQL/JSONB inserts
├── tests/
│   └── test_acid_properties.py       # Automated ACID validation experiments
└── webapp/dashboard/
    ├── src/
    │   ├── App.tsx                   # Main SPA shell
    │   ├── CrudPanel.tsx             # Key-Value update builder and Logical CRUD executor
    │   └── api.ts                    # Backend integration and session telemetry fetcher
    └── Dockerfile                    # Containerization for the frontend

4. Key Architectural Implementations

  • Strict UI Abstraction: The React dashboard relies exclusively on the /schema/logical/{session_id} API. It autonomously scrubs physical schema markers. Physical tables (chiral_data_comments) and document-store identifiers (overflow_data) are completely invisible to the client.
  • Logical Data Reconstruction: Flat relational rows generated by dynamic LEFT JOIN queries cause a Cartesian explosion. The query_service intercepts raw SQLAlchemy outputs, hashes parent tuples, and safely merges duplicated rows into unified, object-oriented JSON arrays in-memory.
  • Nested Transaction Atomicity: For synchronous multi-table operations (e.g., inserting a document with nested arrays), the framework relies on sql_session.begin_nested(). If dynamic child-table insertions fail, the parent SQL record is entirely rolled back to prevent orphaned data.
  • JSONB Isolation (No Lost Updates): Concurrent logical updates targeting distinct fields within the same schema-less document are serialized safely. The engine compiles these as atomic jsonb_set(COALESCE(...)) commands, utilizing engine-level row locks to eliminate read-modify-write race conditions.

Project details


Download files

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

Source Distribution

chiral_db-1.0.0.tar.gz (447.8 kB view details)

Uploaded Source

Built Distribution

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

chiral_db-1.0.0-py3-none-any.whl (55.9 kB view details)

Uploaded Python 3

File details

Details for the file chiral_db-1.0.0.tar.gz.

File metadata

  • Download URL: chiral_db-1.0.0.tar.gz
  • Upload date:
  • Size: 447.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for chiral_db-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5a6b1aa9adb771ee6411e1307b3f1702f5191984fb41e8e9f99af5a3e24e4389
MD5 c28bc1d41a486bff4d28da409b7682fb
BLAKE2b-256 0a85616a6477d4d6ad0a39cbfce5f9c0072b6ecaa4b371518ea2601196df45ef

See more details on using hashes here.

File details

Details for the file chiral_db-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: chiral_db-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 55.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for chiral_db-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 18839339f54c6e6a9c0d88943adac3ba4706dc9ddecbeeeb2c1d74eda1fd1815
MD5 2c26905fe71b6f84ee0df13e34f783f2
BLAKE2b-256 6a3876e0e2d8f95f0e9171b0385d8540a16227cbc6113ac639d73da695b60de7

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