The simplest path to fast repeated queries shouldn't require running a second service, writing invalidation logic, or serialising your data twice.
Most Python applications hit the same PostgreSQL queries hundreds of times per second. The standard answer is Redis — a separate service you have to provision, monitor, serialise data into, and write invalidation logic for. That's a lot of infrastructure for what is, conceptually, a very simple problem: "don't recompute a result if the underlying data hasn't changed."
The alternative — manual in-memory dictionaries — works until your data has JOINs, GROUP BYs, or WHERE clauses. At that point you're maintaining a hand-written incremental view, which is exactly the kind of accidental complexity that causes on-call incidents at 3 am.
CIUF takes a different angle: it parses your SQL query into a Directed Acyclic Graph (DAG) that mirrors the query's logical structure. Each node in the graph holds a materialized slice of the result. When a write happens — an insert, update, or delete — only the affected nodes are recomputed. Everything else is served directly from memory.
The result is sub-millisecond reads for any query that's been registered once, with automatic, correct invalidation. No Redis, no serialization round-trip, no hand-written cache keys.
CIUF is in active development. The core engine — SQL parsing, DAG propagation, LRU/TTL eviction, and thread safety — is complete and tested. We're working toward a public v0.1.0 release on GitHub and PyPI. The library is MIT-licensed and will remain free and open source.
Questions or feedback? Email us at hello@ciuf.io or open a GitHub Discussion.