AltCodePro PolyDB
AltCodePro PolyDB is a production-ready multi-cloud database abstraction layer for Python.
It provides a single unified API for SQL, NoSQL, object storage, queues, and blockchain storage across major platforms including AWS, Azure, GCP, Vercel, MongoDB, PostgreSQL, and Web3 networks.
PolyDB enables developers to build cloud-portable applications without vendor lock-in.
It is designed for modern distributed systems that require:
- multi-cloud portability
- hybrid SQL + NoSQL architectures
- distributed storage routing
- event-driven queues
- object storage abstraction
- blockchain storage integration
- enterprise-grade reliability
Architecture
PolyDB unifies multiple storage layers behind a single API.
PolyDB
│
┌──────────────┼──────────────┐
│ │ │
SQL DB NoSQL KV Queue
PostgreSQL Dynamo/Azure SQS/PubSub
│ │ │
└─────── Object Storage ─────┘
S3 / Blob
│
Blockchain
(KV / Blob / Queue)
Project Structure
polydb/
├ adapters/
│ ├ aws/
│ ├ azure/
│ ├ gcp/
│ ├ vercel/
│ └ blockchain/
│
├ core/
│ ├ database_factory.py
│ ├ query.py
│ ├ batch.py
│
├ security/
├ monitoring/
├ cache/
└ multitenancy/
Key Features
Multi-Cloud Support
Works across multiple cloud providers with automatic environment detection.
| Provider | NoSQL | Object Storage | Queue |
|---|---|---|---|
| AWS | DynamoDB | S3 | SQS |
| Azure | Table Storage | Blob Storage | Azure Queue |
| GCP | Firestore | GCS | Pub/Sub |
| Vercel | KV (Redis) | Blob | Queue |
| MongoDB | MongoDB | — | — |
| PostgreSQL | SQL | S3-compatible | — |
| Blockchain | Smart Contract KV | IPFS | Event Queue |
❤️ Support the Project
PolyDB is free and open source.
If you find this project useful, you can support continued development.
Sponsor
Or support the project through AltCodePro:
https://chatgpt.com/g/g-68d6efde65e0819192b9e130fb56b26b-altcodepro-gpt-idea-to-mvps-investor-docs
Your support helps improve:
- multi-cloud database adapters
- blockchain storage integrations
- enterprise scalability features
- developer tooling and documentation
Hybrid SQL + NoSQL
PolyDB allows applications to use SQL and NoSQL together without changing code.
Example architecture:
Application
│
PolyDB DatabaseFactory
│
┌──────────────┬──────────────┐
│ │ │
SQL NoSQL Storage
(Postgres) (DynamoDB) (S3)
Example:
from polydb import DatabaseFactory
db = DatabaseFactory()
db.create(User, {"name": "Alice"})
db.read(User, {"email": "alice@email.com"})
db.update(User, 1, {"status": "active"})
db.delete(User, 1)
Automatic Cloud Provider Detection
PolyDB automatically detects the cloud provider based on environment variables.
| Environment Variable | Provider |
|---|---|
| AZURE_STORAGE_CONNECTION_STRING | Azure |
| AWS_ACCESS_KEY_ID | AWS |
| GOOGLE_CLOUD_PROJECT | GCP |
| VERCEL_ENV | Vercel |
| MONGODB_URI | MongoDB |
| POSTGRES_URL | PostgreSQL |
You can also manually set:
CLOUD_PROVIDER=aws
Object Storage
PolyDB provides a unified API for cloud storage systems.
Supported backends:
- AWS S3
- Azure Blob Storage
- Google Cloud Storage
- Vercel Blob
- IPFS (Blockchain)
Example:
storage = factory.get_object_storage()
storage.upload("file.txt", b"hello world")
storage.download("file.txt")
storage.delete("file.txt")
Queue Abstraction
PolyDB supports distributed message queues.
Supported systems:
- AWS SQS
- Azure Queue
- Google Pub/Sub
- Vercel Queue (cloud REST API, or a plain local
redis://URL for dev/test) - Kafka
- RabbitMQ
- Blockchain event queues
Example (method names below match QueueAdapter's actual signatures —
send/receive/ack/delete, not send_message/receive_message):
queue = factory.get_queue("rabbitmq")
message_id = queue.send({"task": "process"}, queue_name="jobs")
messages = queue.receive(queue_name="jobs", max_messages=1)
queue.ack(messages[0]["receipt_handle"], queue_name="jobs")
Extended queue management (nack/purge/declare/status)
QueueAdapter's base class also defines nack, purge, declare
(explicit provisioning ahead of first use, with optional dead-letter
queue wiring), and status — regular (non-abstract) base methods that
raise NotImplementedError by default, overridden only where a
subclass genuinely implements them. Honest status, verified against a
real local broker/client, not assumed:
- RabbitMQAdapter — all four implemented for real against a live
broker:
nackisbasic_nack(requeue=True)(immediate redelivery, not dead-lettering);purgereads the real purged count offqueue_purge'sQueue.PurgeOkresponse;declarewires real AMQP dead-lettering (x-dead-letter-exchange/x-dead-letter-routing-keyqueue arguments — not a hand-rolled shadow re-router) whendead_letter_queueis given, andstatusreadsmessage_count/consumer_countoff a passivequeue_declare. A message only actually gets dead-lettered by a real reject-without-requeue (basic_nack/basic_rejectwithrequeue=False) or a TTL/ max-length policy —nack()'s own contract is "redeliver now", so it deliberately does not trigger dead-lettering itself.dlq_list/dlq_replayaren't separate adapter methods — they're justreceive/send+ackaimed at the DLQ's own queue name. - KafkaQueueAdapter — only
nackis implemented, and it's a documented no-op:receive()already never commits an offset untilack()/delete()does, so a received-but-unacked message is already effectively "nacked".purge/declare/statusare not implemented — not practical againstkafka-python's client-level API without broker admin tooling; they raise the base class'sNotImplementedError. - SQS / Azure Queue / GCP Pub/Sub / Blockchain — none of the four
new methods are implemented; all raise the base class's
NotImplementedError. No credentials/emulator for any of these three cloud providers, and no real blockchain node, were available where this was built and tested. - Vercel Queue (local-redis mode) — also not implemented for these
four, though flagged as a real, likely-tractable gap for later: Redis
Streams'
XPENDING/XCLAIM/XTRIMcould plausibly backnack/status/purgefor the local-redis mode specifically. Deliberately left out of this round rather than half-implemented.
Blockchain Storage
PolyDB includes experimental blockchain adapters.
Capabilities:
- Smart contract key-value storage
- IPFS blob storage
- Event-based queue systems
Supported networks:
- Ethereum
- Polygon
- BNB Chain
- Avalanche
- Local Ganache
Example:
factory = CloudDatabaseFactory(provider="blockchain")
kv = factory.get_nosql_kv()
blob = factory.get_object_storage()
queue = factory.get_queue()
Advanced Query Engine
PolyDB includes a LINQ-style query builder.
Supports:
- filtering
- ordering
- pagination
- projections
- count queries
Example:
qb = QueryBuilder().where("age", Operator.GT, 18)
results = db.query_linq(User, qb)
Batch Operations
High-performance bulk operations.
db.batch.bulk_insert(User, users)
db.batch.bulk_update(User, updates)
db.batch.bulk_delete(User, ids)
Multi-Tenancy
PolyDB supports SaaS-style tenant isolation.
Isolation strategies:
- shared schema
- separate schema
- separate database
Components:
- TenantRegistry
- TenantContext
- TenantIsolationEnforcer
Caching
Built-in distributed caching using Redis.
Features:
- TTL caching
- LFU tracking
- cache warming
- cache invalidation
Monitoring & Observability
PolyDB provides built-in metrics collection.
Tracks:
- query latency
- slow queries
- error rates
- cache hit rates
Prometheus export supported.
Security
PolyDB includes enterprise-grade security features.
- field-level encryption
- row-level security
- audit logging
- tenant isolation
- data masking
Installation
Install from PyPI:
pip install altcodepro-polydb-python
Optional dependencies:
pip install redis boto3 google-cloud-storage web3 ipfshttpclient
Example
from polydb import DatabaseFactory, polydb_model
@polydb_model
class User:
__polydb__ = {
"storage": "nosql"
}
db = DatabaseFactory()
db.create(User, {"name": "Alice"})
users = db.read(User, {"name": "Alice"})
Why PolyDB
PolyDB replaces multiple infrastructure SDKs with one API.
| Traditional Approach | PolyDB |
|---|---|
| Multiple cloud SDKs | One unified API |
| Provider lock-in | Multi-cloud portability |
| Separate queue/storage clients | Unified infrastructure |
| Complex data routing | Automatic routing |
Roadmap
Planned features:
- GraphQL API layer
- distributed transactions
- vector database support
- AI retrieval pipelines
- edge database adapters
License
MIT License
Links
PyPI https://pypi.org/project/altcodepro-polydb-python/
Website https://chatgpt.com/g/g-68d6efde65e0819192b9e130fb56b26b-altcodepro-gpt-idea-to-mvps-investor-docs
Metadata
Release files for altcodepro-polydb-python 2.5.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| altcodepro_polydb_python-2.5.7.tar.gz | 199.4 kB | Without provenance | Details for altcodepro_polydb_python-2.5.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| altcodepro_polydb_python-2.5.7-py3-none-any.whl | Python 3 | none | any | Details for altcodepro_polydb_python-2.5.7-py3-none-any.whl |
Total release size: 366.9 kB
Release files / altcodepro_polydb_python-2.5.7.tar.gz
| Download URL | altcodepro_polydb_python-2.5.7.tar.gz |
|---|---|
| Size | 199.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a3a3e7e82b9cce30ffba5b79ba60dc7b230798e0a0f5a45ea680d3666c723a30
|
|
BLAKE2b-256 checksum How to use checksums |
408eb867cb122097f9d3ea17b9bebae852f6d8a0cbf33b6c2f6781c065cb712a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Release files / altcodepro_polydb_python-2.5.7-py3-none-any.whl
| Download URL | altcodepro_polydb_python-2.5.7-py3-none-any.whl |
|---|---|
| Size | 167.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ebd9289259f11679eef13ca4f92ed5ffab9c49e60f230eea221f02b86e760b7
|
|
BLAKE2b-256 checksum How to use checksums |
afe91ed56412aafba5ef04763be9be739f47534f2d76fbfe34405686d69d026f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Security for altcodepro-polydb-python 2.5.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.