Skip to main content

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

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: nack is basic_nack(requeue=True) (immediate redelivery, not dead-lettering); purge reads the real purged count off queue_purge's Queue.PurgeOk response; declare wires real AMQP dead-lettering (x-dead-letter-exchange/x-dead-letter-routing-key queue arguments — not a hand-rolled shadow re-router) when dead_letter_queue is given, and status reads message_count/ consumer_count off a passive queue_declare. A message only actually gets dead-lettered by a real reject-without-requeue (basic_nack/basic_reject with requeue=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_replay aren't separate adapter methods — they're just receive/send+ack aimed at the DLQ's own queue name.
  • KafkaQueueAdapter — only nack is implemented, and it's a documented no-op: receive() already never commits an offset until ack()/delete() does, so a received-but-unacked message is already effectively "nacked". purge/declare/status are not implemented — not practical against kafka-python's client-level API without broker admin tooling; they raise the base class's NotImplementedError.
  • 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/XTRIM could plausibly back nack/ status/purge for 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.20

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for altcodepro-polydb-python 2.5.20
File Size Uploaded Provenance Actions
altcodepro_polydb_python-2.5.20.tar.gz 227.8 kB Without provenance Details for altcodepro_polydb_python-2.5.20.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for altcodepro-polydb-python 2.5.20
File Interpreter ABI Platform Actions
altcodepro_polydb_python-2.5.20-py3-none-any.whl Python 3 none any Details for altcodepro_polydb_python-2.5.20-py3-none-any.whl

Total release size: 403.9 kB

Release files / altcodepro_polydb_python-2.5.20.tar.gz

Download URL altcodepro_polydb_python-2.5.20.tar.gz
Size 227.8 kB
Tags Source
SHA-256 checksum
How to use checksums
657f27d41280fb1b0185cf28869ba131079a3d674ce4de378c45457d732d18af
BLAKE2b-256 checksum
How to use checksums
654be4c59f9f866eabc0a6b828965f43454b87077f2e72676d161f2d76318d93
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.20-py3-none-any.whl

Download URL altcodepro_polydb_python-2.5.20-py3-none-any.whl
Size 176.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3615b8681d9f4356c00caf6988d011a16d5930e934a887e26948948842f9d6a2
BLAKE2b-256 checksum
How to use checksums
687c5ed88b96949250c1570e717d8fead700a229bd01ddab1424c443b61844ae
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.20

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.

Release history Release notifications | RSS feed

This release

2.5.20 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page