π° Simplified Infrastructure
Replace caching infrastructure with pre-computed table views. Fewer services, simpler operations, lower costs.
Simplify Your Stack β| Traditional Stack | FraiseQL Stack | Annual Savings |
|---|---|---|
|
PostgreSQL
$50/mo
|
PostgreSQL (more storage)
$50-80/mo
|
-$360/yr |
|
Redis Cloud
$50-500/mo
Caching layer
|
β
Not needed
Table views provide caching
|
$600-6,000/yr |
|
Extra Compute (4 instances)
$210/mo
More instances for ORM overhead
|
β
1-2 instances
Higher throughput per instance
|
$1,200-2,500/yr |
|
Total Cost
$310-760/mo
|
Total Cost
$120-250/mo
|
$2,300-6,100/yr |
Savings depend on your current stack. If you're running Redis + multiple API instances, expect meaningful savings. Simpler stacks see smaller absolute savings but benefit from reduced operational complexity.
Three key features that simplify your stack:
1. Table views eliminate Redis caching
2. FraiseQL Cascade eliminates refetch queries after mutations
3. tb_entity_change_log provides built-in audit trails
Pre-computed JSONB in table views eliminates the need for Redis caching layer. No cache invalidation logic required.
-- Table view provides caching
CREATE TABLE tv_user (
id UUID PRIMARY KEY,
data JSONB NOT NULL,
updated_at TIMESTAMPTZ
);
-- Synced on mutation, always fresh
-- No TTL, no cache misses
SELECT data FROM tv_user WHERE id = $1;
Mutations return updated projections directly. Clients don't need to refetch after writesβcache updates are automatic.
# Mutation returns updated data
result = await create_post(title="Hello")
# Result includes _cascade with updated entities
{
"status": "success",
"data": {"id": "..."},
"_cascade": {
"updated": [
{"__typename": "Post", "id": "..."},
{"__typename": "User", "id": "..."}
]
}
}
# No refetch needed!
Every mutation logs before/after state automatically. Full audit trail, CDC-ready, no extra infrastructure.
-- Built into every fn_* mutation
INSERT INTO tb_entity_change_log (
entity_type, entity_id, operation,
before_state, after_state,
changed_by, changed_at
) VALUES (
'post', v_post_id, 'INSERT',
NULL, (SELECT data FROM v_post...),
p_author_id, NOW()
);
-- Query history anytime
SELECT * FROM tb_entity_change_log
WHERE entity_id = $1
ORDER BY changed_at DESC;
Built-in full-text search with ranking and highlighting. Often sufficient without Elasticsearch.
-- Full-text search in PostgreSQL
SELECT
title,
ts_headline(content, query) as highlight,
ts_rank(to_tsvector('english', content), query) as rank
FROM tb_article, to_tsquery('english', 'machine learning') query
WHERE to_tsvector('english', content) @@ query
ORDER BY rank DESC;
All data, caching, and logs in one ACID-compliant database. No sync issues, no eventual consistency problems.
Local PostgreSQL queries faster than network calls to external services. Reduced latency, lower infrastructure complexity.
Row-level security, audit trails, and encryption built-in. No additional attack surfaces from external services.
One database to backup, monitor, and scale. Fewer services to deploy, configure, and maintain.
Query your logs, cache hits, and performance metrics using standard SQL. No complex aggregation pipelines.
PostgreSQL is free and open source. Eliminate expensive SaaS subscriptions for basic features.
Migrate services incrementally. Start with the easiest wins and gradually replace complex external dependencies.
Beyond cost savings, consolidating to PostgreSQL simplifies operations:
Eliminate Redis, reduce compute costs, simplify operations.