askrobots / dbbasic-object-primitive
Public
Python functions as REST objects, with clustering, load balancing and state replication; no containers or orchestration.
__init__.py · 1001 bytes · 36 lines
| 1 | """ |
| 2 | Storage backends for the Object Primitive System. |
| 3 | |
| 4 | This module contains storage adapters for different backends: |
| 5 | - TSV: Tab-separated values (human-readable, grep-able) |
| 6 | - FileSystem: Direct file storage |
| 7 | - SQLite: Embedded SQL database |
| 8 | - PostgreSQL: Production SQL database |
| 9 | - Redis: In-memory cache/store |
| 10 | - S3: Object storage |
| 11 | - Custom: Pluggable custom storage |
| 12 | |
| 13 | Objects are stored with: |
| 14 | - Source code (current and all versions) |
| 15 | - Logs (self-logging, TSV format) |
| 16 | - Metadata (creation time, author, etc.) |
| 17 | - Data (state, if stateful) |
| 18 | |
| 19 | Philosophy: |
| 20 | Storage is swappable. Database goes evil? Swap it. |
| 21 | TSV today, PostgreSQL tomorrow, ??? next year. |
| 22 | The endpoint doesn't know or care where data lives. |
| 23 | |
| 24 | Start with TSV (simple, grep-able). |
| 25 | Graduate to databases only when needed. |
| 26 | Always be able to swap back. |
| 27 | """ |
| 28 | |
| 29 | __all__ = [ |
| 30 | # To be implemented in Phase 3+ |
| 31 | # "TSVStorage", |
| 32 | # "FileSystemStorage", |
| 33 | # "SQLiteStorage", |
| 34 | # "PostgreSQLStorage", |
| 35 | # "RedisStorage", |
| 36 | ] |