Metadata-Version: 2.4
Name: spymonk-db
Version: 0.1.0
Summary: Spanner-inspired distributed database with external consistency
Home-page: https://gitlab.com/shubhajeet.pradhan/spymonk-db2.0
Author: Shubhajeet Pradhan
License: MIT
Project-URL: Homepage, https://gitlab.com/shubhajeet.pradhan/spymonk-db2.0
Project-URL: Documentation, https://gitlab.com/shubhajeet.pradhan/spymonk-db2.0#readme
Project-URL: Repository, https://gitlab.com/shubhajeet.pradhan/spymonk-db2.0
Project-URL: Bug Tracker, https://gitlab.com/shubhajeet.pradhan/spymonk-db2.0/-/issues
Keywords: database,distributed,spanner,sql,nosql,paxos,mvcc
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Database :: Database Engines/Servers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: python-dateutil==2.8.2
Requires-Dist: ujson==5.9.0
Requires-Dist: msgpack>=1.1.0
Requires-Dist: grpcio>=1.60.0
Requires-Dist: grpcio-tools>=1.60.0
Requires-Dist: protobuf>=4.25.1
Requires-Dist: ntplib==0.4.0
Requires-Dist: lz4==4.3.2
Requires-Dist: sqlparse==0.4.4
Requires-Dist: lark-parser==0.12.0
Requires-Dist: asyncio==3.4.3
Requires-Dist: aiohttp==3.9.1
Requires-Dist: prometheus-client==0.19.0
Requires-Dist: structlog==24.1.0
Requires-Dist: opentelemetry-api==1.22.0
Requires-Dist: opentelemetry-sdk==1.22.0
Requires-Dist: pyyaml==6.0.1
Requires-Dist: toml==0.10.2
Requires-Dist: click==8.1.7
Requires-Dist: rich==13.7.0
Requires-Dist: tabulate==0.9.0
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: black>=23.7.0; extra == "dev"
Requires-Dist: flake8>=6.1.0; extra == "dev"
Requires-Dist: mypy>=1.5.0; extra == "dev"
Requires-Dist: isort>=5.12.0; extra == "dev"
Provides-Extra: performance
Requires-Dist: locust>=2.15.1; extra == "performance"
Requires-Dist: py-spy>=0.3.14; extra == "performance"
Provides-Extra: monitoring
Requires-Dist: prometheus-client>=0.17.1; extra == "monitoring"
Requires-Dist: opentelemetry-api>=1.20.0; extra == "monitoring"
Requires-Dist: opentelemetry-sdk>=1.20.0; extra == "monitoring"
Dynamic: home-page
Dynamic: requires-python

# spyMonk-DB Enterprise

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

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)

## 🚀 Quick Start

```bash
# 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

- **[Architecture](docs/ARCHITECTURE.md)** - System design and components
- **[Implementation](docs/IMPLEMENTATION_SUMMARY.md)** - Technical details
- **[Enterprise Features](docs/README_ENTERPRISE.md)** - Advanced features
- **[Benchmarks](docs/README_BENCHMARK.md)** - Performance metrics

## 🎯 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)

```python
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)

```python
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](scripts/build_package.sh) for building wheel packages.

See [scripts/private-pypi/](scripts/private-pypi/) for private PyPI setup.

## 🧪 Testing

```bash
# 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](LICENSE) file

---

**For full deployment guide, see the parent project README**
