shardorm 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- shardorm-1.0.0/PKG-INFO +66 -0
- shardorm-1.0.0/README.md +56 -0
- shardorm-1.0.0/pyproject.toml +18 -0
- shardorm-1.0.0/setup.cfg +4 -0
- shardorm-1.0.0/shardorm.egg-info/PKG-INFO +66 -0
- shardorm-1.0.0/shardorm.egg-info/SOURCES.txt +9 -0
- shardorm-1.0.0/shardorm.egg-info/dependency_links.txt +1 -0
- shardorm-1.0.0/shardorm.egg-info/entry_points.txt +2 -0
- shardorm-1.0.0/shardorm.egg-info/requires.txt +2 -0
- shardorm-1.0.0/shardorm.egg-info/top_level.txt +1 -0
- shardorm-1.0.0/shardorm.py +1269 -0
shardorm-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: shardorm
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Eigenbau Sharding-, Replikations- und Failover-Schicht fuer PostgreSQL
|
|
5
|
+
License: MIT
|
|
6
|
+
Requires-Python: >=3.8
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
Requires-Dist: psycopg[binary]>=3.0.0
|
|
9
|
+
Requires-Dist: psycopg_pool>=3.0.0
|
|
10
|
+
|
|
11
|
+
\# ShardORM
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
A lightweight, standalone Python layer for PostgreSQL sharding, replication, read/write failover, and two-phase commits (2PC) – completely \*\*without SQLAlchemy\*\* and \*\*without Alembic\*\*.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
\---
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
\## 🚀 Key Features
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
\* \*\*Consistent Hashing Ring:\*\* Uses virtual nodes (`vnodes`) to distribute records deterministically. Adding or removing a shard only shifts a fraction of the keys instead of remapping the entire cluster.
|
|
28
|
+
|
|
29
|
+
\* \*\*Flexible Table Policies:\*\*
|
|
30
|
+
|
|
31
|
+
  \* `"sharded"`: Records are distributed across a configurable `replication\_factor` of shards using consistent hashing.
|
|
32
|
+
|
|
33
|
+
  \* `"full\_sync"`: Records are mirrored globally across \*\*all\*\* PostgreSQL instances in parallel (ideal for small lookup/global tables like categories or settings).
|
|
34
|
+
|
|
35
|
+
\* \*\*Automatic Failover \& Quorum / 2PC:\*\*
|
|
36
|
+
|
|
37
|
+
  \* \*\*Read Failover:\*\* If a primary shard is unreachable, queries automatically fall back to redundant replicas.
|
|
38
|
+
|
|
39
|
+
  \* \*\*Write Quorum:\*\* Writes are validated against a configured `min\_write\_quorum`.
|
|
40
|
+
|
|
41
|
+
  \* \*\*Two-Phase Commit (2PC):\*\* Optional strict all-or-nothing writes (`write\_mode: "2pc"`) using PostgreSQL's native `PREPARE TRANSACTION`.
|
|
42
|
+
|
|
43
|
+
\* \*\*Built-in Migration System ("Mini-Alembic"):\*\* Keeps schemas synchronized across all shards. Supports ad-hoc CLI commands or timestamped `.sql` migration files stored in a local directory.
|
|
44
|
+
|
|
45
|
+
\* \*\*Online Rebalancing (`rescale`):\*\* Scans the cluster for misplaced data after shard topology changes and safely migrates records to their correct nodes (includes a `--apply` dry-run mode).
|
|
46
|
+
|
|
47
|
+
\* \*\*Connection Pooling:\*\* Built-in connection management powered by `psycopg\_pool`.
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
\---
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
\## 📦 Installation
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
Install the package locally in editable development mode along with its dependencies:
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
|
|
65
|
+
pip install -e .
|
|
66
|
+
|
shardorm-1.0.0/README.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
\# ShardORM
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
A lightweight, standalone Python layer for PostgreSQL sharding, replication, read/write failover, and two-phase commits (2PC) – completely \*\*without SQLAlchemy\*\* and \*\*without Alembic\*\*.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
\---
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
\## 🚀 Key Features
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
\* \*\*Consistent Hashing Ring:\*\* Uses virtual nodes (`vnodes`) to distribute records deterministically. Adding or removing a shard only shifts a fraction of the keys instead of remapping the entire cluster.
|
|
18
|
+
|
|
19
|
+
\* \*\*Flexible Table Policies:\*\*
|
|
20
|
+
|
|
21
|
+
  \* `"sharded"`: Records are distributed across a configurable `replication\_factor` of shards using consistent hashing.
|
|
22
|
+
|
|
23
|
+
  \* `"full\_sync"`: Records are mirrored globally across \*\*all\*\* PostgreSQL instances in parallel (ideal for small lookup/global tables like categories or settings).
|
|
24
|
+
|
|
25
|
+
\* \*\*Automatic Failover \& Quorum / 2PC:\*\*
|
|
26
|
+
|
|
27
|
+
  \* \*\*Read Failover:\*\* If a primary shard is unreachable, queries automatically fall back to redundant replicas.
|
|
28
|
+
|
|
29
|
+
  \* \*\*Write Quorum:\*\* Writes are validated against a configured `min\_write\_quorum`.
|
|
30
|
+
|
|
31
|
+
  \* \*\*Two-Phase Commit (2PC):\*\* Optional strict all-or-nothing writes (`write\_mode: "2pc"`) using PostgreSQL's native `PREPARE TRANSACTION`.
|
|
32
|
+
|
|
33
|
+
\* \*\*Built-in Migration System ("Mini-Alembic"):\*\* Keeps schemas synchronized across all shards. Supports ad-hoc CLI commands or timestamped `.sql` migration files stored in a local directory.
|
|
34
|
+
|
|
35
|
+
\* \*\*Online Rebalancing (`rescale`):\*\* Scans the cluster for misplaced data after shard topology changes and safely migrates records to their correct nodes (includes a `--apply` dry-run mode).
|
|
36
|
+
|
|
37
|
+
\* \*\*Connection Pooling:\*\* Built-in connection management powered by `psycopg\_pool`.
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
\---
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
\## 📦 Installation
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
Install the package locally in editable development mode along with its dependencies:
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
|
|
55
|
+
pip install -e .
|
|
56
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "shardorm"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Eigenbau Sharding-, Replikations- und Failover-Schicht fuer PostgreSQL"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
dependencies = [
|
|
13
|
+
"psycopg[binary]>=3.0.0",
|
|
14
|
+
"psycopg_pool>=3.0.0",
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
[project.scripts]
|
|
18
|
+
shardorm = "shardorm:main"
|
shardorm-1.0.0/setup.cfg
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: shardorm
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Eigenbau Sharding-, Replikations- und Failover-Schicht fuer PostgreSQL
|
|
5
|
+
License: MIT
|
|
6
|
+
Requires-Python: >=3.8
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
Requires-Dist: psycopg[binary]>=3.0.0
|
|
9
|
+
Requires-Dist: psycopg_pool>=3.0.0
|
|
10
|
+
|
|
11
|
+
\# ShardORM
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
A lightweight, standalone Python layer for PostgreSQL sharding, replication, read/write failover, and two-phase commits (2PC) – completely \*\*without SQLAlchemy\*\* and \*\*without Alembic\*\*.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
\---
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
\## 🚀 Key Features
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
\* \*\*Consistent Hashing Ring:\*\* Uses virtual nodes (`vnodes`) to distribute records deterministically. Adding or removing a shard only shifts a fraction of the keys instead of remapping the entire cluster.
|
|
28
|
+
|
|
29
|
+
\* \*\*Flexible Table Policies:\*\*
|
|
30
|
+
|
|
31
|
+
  \* `"sharded"`: Records are distributed across a configurable `replication\_factor` of shards using consistent hashing.
|
|
32
|
+
|
|
33
|
+
  \* `"full\_sync"`: Records are mirrored globally across \*\*all\*\* PostgreSQL instances in parallel (ideal for small lookup/global tables like categories or settings).
|
|
34
|
+
|
|
35
|
+
\* \*\*Automatic Failover \& Quorum / 2PC:\*\*
|
|
36
|
+
|
|
37
|
+
  \* \*\*Read Failover:\*\* If a primary shard is unreachable, queries automatically fall back to redundant replicas.
|
|
38
|
+
|
|
39
|
+
  \* \*\*Write Quorum:\*\* Writes are validated against a configured `min\_write\_quorum`.
|
|
40
|
+
|
|
41
|
+
  \* \*\*Two-Phase Commit (2PC):\*\* Optional strict all-or-nothing writes (`write\_mode: "2pc"`) using PostgreSQL's native `PREPARE TRANSACTION`.
|
|
42
|
+
|
|
43
|
+
\* \*\*Built-in Migration System ("Mini-Alembic"):\*\* Keeps schemas synchronized across all shards. Supports ad-hoc CLI commands or timestamped `.sql` migration files stored in a local directory.
|
|
44
|
+
|
|
45
|
+
\* \*\*Online Rebalancing (`rescale`):\*\* Scans the cluster for misplaced data after shard topology changes and safely migrates records to their correct nodes (includes a `--apply` dry-run mode).
|
|
46
|
+
|
|
47
|
+
\* \*\*Connection Pooling:\*\* Built-in connection management powered by `psycopg\_pool`.
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
\---
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
\## 📦 Installation
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
Install the package locally in editable development mode along with its dependencies:
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
|
|
65
|
+
pip install -e .
|
|
66
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
shardorm
|