Skip to main content

Spanner-inspired distributed database with external consistency

Project description

spyMonk-DB Enterprise

A Google Spanner-inspired distributed SQL database with external consistency and horizontal scalability.

License: MIT Python 3.11+

๐Ÿš€ Quick Start

# Install from PyPI
pip3 install spymonk-db

# Start the database server
spymonk-server --port 50051

# Or install from source
git clone https://gitlab.com/shubhajeet.pradhan/spymonk-db2.0.git
cd spymonk-db2.0
pip3 install -e .

๐Ÿ“š Documentation

๐ŸŽฏ Features

  • โœ… External Consistency - Linearizable transactions across distributed nodes
  • โœ… Distributed Transactions - ACID guarantees with 2-Phase Commit
  • โœ… MVCC - Multi-Version Concurrency Control for lock-free reads
  • โœ… Paxos Consensus - Leader-based replication with automatic failover
  • โœ… LSM-Tree Storage - Write-optimized storage with WAL
  • โœ… SQL Support - Standard SQL query interface

๐Ÿ’ป Usage

Embedded Mode (Single Node)

from spymonk_enterprise.client import SpyMonkClient

client = SpyMonkClient("/tmp/spymonk_data")
client.start()

# Simple operations
client.put(b"key", b"value")
value = client.get(b"key")

client.stop()

Distributed Mode (Cluster)

from spymonk_enterprise.client import DistributedClient

client = DistributedClient([
    "node1.example.com:5000",
    "node2.example.com:5001",
    "node3.example.com:5002"
])

# Use same API as embedded mode
client.put(b"key", b"value")

๐Ÿ“ฆ Package Distribution

See scripts/build_package.sh for building wheel packages.

See scripts/private-pypi/ for private PyPI setup.

๐Ÿงช Testing

# Run unit tests
pytest tests/

# Run benchmarks
python benchmarks/throughput.py

๐Ÿ—๏ธ Project Structure

spyMonk-DB/
โ”œโ”€โ”€ spymonk_enterprise/     # Core implementation
โ”‚   โ”œโ”€โ”€ client/             # Client SDK
โ”‚   โ”œโ”€โ”€ storage/            # LSM-Tree & MVCC
โ”‚   โ”œโ”€โ”€ transaction/        # Transaction manager
โ”‚   โ”œโ”€โ”€ replication/        # Paxos consensus
โ”‚   โ”œโ”€โ”€ time/               # Hybrid Logical Clock
โ”‚   โ”œโ”€โ”€ sql/                # SQL parser & executor
โ”‚   โ””โ”€โ”€ schema/             # Directory & schemas
โ”œโ”€โ”€ docs/                   # Documentation
โ”œโ”€โ”€ scripts/                # Build & deployment scripts
โ”œโ”€โ”€ tests/                  # Test suite
โ”œโ”€โ”€ benchmarks/             # Performance benchmarks
โ””โ”€โ”€ examples/               # Usage examples

๐Ÿค Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open Pull Request

๐Ÿ“„ License

MIT License - See LICENSE file


For full deployment guide, see the parent project README

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

spymonk_db-0.1.0.tar.gz (40.3 kB view details)

Uploaded Source

Built Distribution

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

spymonk_db-0.1.0-py3-none-any.whl (141.2 kB view details)

Uploaded Python 3

File details

Details for the file spymonk_db-0.1.0.tar.gz.

File metadata

  • Download URL: spymonk_db-0.1.0.tar.gz
  • Upload date:
  • Size: 40.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for spymonk_db-0.1.0.tar.gz
Algorithm Hash digest
SHA256 43d89c88911398f33588d23a0f6ce5b02ba6b137349d3b0d02f37497b5b29722
MD5 ec538906f9283597c975de1d4c5c74ba
BLAKE2b-256 77ed515fc54b88d9ea197ecadf1841342f4c9c94a8fa49fe8dc3f9a4e1c2af47

See more details on using hashes here.

File details

Details for the file spymonk_db-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: spymonk_db-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 141.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for spymonk_db-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 afce72789cb82e5453db70b85a1111a754b7ba6f6643497d9583e1e68968040f
MD5 7aa0184245ab63aed29a63ebb1af6569
BLAKE2b-256 82118004f980382c2abf10f535c217f76d871b466c72a82f1a51a2d45719c7c0

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