3tears
Run a Python app on one pod and life is simple. Run it on twenty and the simple things break. State scatters across processes. Caches drift apart. Every pod trusts its own copy. No two copies agree.
Coordinating all of that is the real work of scaling horizontally. 3tears does it for you.
The Three Tiers
Every read and write moves through three layers of cache, coordinated automatically.
- L1 (SQLite): Local reads at memory speed. Every pod keeps its own.
- L2 (NATS KV): The sync layer. Pods reconcile here instead of guessing.
- L3 (PostgreSQL / YugabyteDB): Durable storage. The truth that survives a restart.
Three tiers of cache – and none of the tears.
What It Handles
Smart Entities: Change-tracked objects that persist themselves across all three tiers. Modify one, and the write path takes care of itself. No manual invalidation. No stale reads.
Dynamic Tables: The DataStore API creates tables at runtime, with schema migrations and versioned updates. The data model changes while the app keeps running.
Agent-Native: LangGraph checkpoints saved across all three tiers. Agent workflows resume where they stopped, on any pod, after any failure.
Modular by Design
You don’t adopt 3tears. You take the piece you need.
3tears-observe: Structured logging and OpenTelemetry tracing. Add the@traceddecorator and you have both.3tears-models: LangChain adapters.3tears-agent-memory: Persistent memory for agents.
Those three are the front door. Behind it: access control and audit trails, a tool and skill registry, scheduled jobs, object storage, conversation and knowledge stores, MCP wiring. More than twenty packages covering what a distributed app actually needs. Take three, or take twenty.
Need logging and tracing today, distributed cache next quarter? Start with 3tears-observe. Add the tiers when the tears start.
Built With EAD
3tears is built with Enforcement-Accelerated Development. The architectural rules are enforced by tests, not tribal knowledge, which is how a framework this size stays consistent while it grows.
Get It
pip install 3tears
MIT licensed. Python 3.14+.
View on GitHub · 3tears on PyPI
The Stack Is a Choice
Opinionated dependencies? Yes. A framework built for horizontal scale can’t rest on tools that only scale up. Real open source, real horizontal scaling. No fine print.
- NATS: the L2 sync layer. Clustered messaging and key-value that scales sideways.
- YugabyteDB: the distributed L3. PostgreSQL wire-compatible, scaling out where plain Postgres scales up.