πŸ’° Simplified Infrastructure

Eliminate Redis,
Simplify Ops

Replace caching infrastructure with pre-computed table views. Fewer services, simpler operations, lower costs.

Simplify Your Stack β†’

Key Benefits

🚫
No Redis Needed
Table views = caching
πŸ“¦
Fewer Services
Simpler operations
πŸ’Ύ
One Backup
PostgreSQL only
πŸ”’
ACID Everywhere
No cache invalidation

How FraiseQL Simplifies 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.

* Costs based on typical SaaS pricing. Actual savings vary by scale and usage patterns.

What PostgreSQL Provides

FraiseQL's Core Value

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

πŸ”„ Redis β†’ Table Views (Primary Advantage)

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;

πŸ”„ FraiseQL Cascade (No Refetch)

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!

πŸ“‹ tb_entity_change_log (Built-in Audit)

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;

πŸ” Full-Text Search (PostgreSQL Native)

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;

Architecture Benefits

πŸ”’

Single Source of Truth

All data, caching, and logs in one ACID-compliant database. No sync issues, no eventual consistency problems.

⚑

Better Performance

Local PostgreSQL queries faster than network calls to external services. Reduced latency, lower infrastructure complexity.

πŸ›‘οΈ

Enhanced Security

Row-level security, audit trails, and encryption built-in. No additional attack surfaces from external services.

πŸ”§

Simplified Operations

One database to backup, monitor, and scale. Fewer services to deploy, configure, and maintain.

πŸ“Š

Rich Analytics

Query your logs, cache hits, and performance metrics using standard SQL. No complex aggregation pipelines.

πŸ’°

Cost Effective

PostgreSQL is free and open source. Eliminate expensive SaaS subscriptions for basic features.

Migration Strategy

Phased Migration Approach

Migrate services incrementally. Start with the easiest wins and gradually replace complex external dependencies.

Phase 1: Quick Wins (1-2 weeks)

  • β€’ Replace Redis with PostgreSQL APQ
  • β€’ Move simple caching to database
  • β€’ Basic audit logging
  • β€’ Savings: $600-2,000/month

Phase 2: Compute Optimization (2-4 weeks)

  • β€’ Full table view implementation
  • β€’ Reduce API instance count
  • β€’ Performance tuning
  • β€’ Additional savings: $100-300/month

Phase 3: Refinement (1-2 months)

  • β€’ Audit trail setup
  • β€’ Full-text search (if needed)
  • β€’ Query optimization
  • β€’ Operational simplicity achieved

Example Savings Scenarios

🏒 SaaS Startup

Before: PostgreSQL $50 + Redis $100 + 3 API instances $180 = $330/mo
After: PostgreSQL $70 + 1 API instance $70 = $140/mo
Annual savings: ~$2,300
~58% cost reduction

πŸ—οΈ Growth-Stage App

Before: PostgreSQL $150 + Redis $300 + 6 API instances $420 = $870/mo
After: PostgreSQL $200 + 2 API instances $140 = $340/mo
Annual savings: ~$6,400
~61% cost reduction

Operational Benefits

Beyond cost savings, consolidating to PostgreSQL simplifies operations:

  • No cache invalidation: Table views are always fresh after mutations
  • One backup target: PostgreSQL only
  • Simpler debugging: All data in one place
  • ACID everywhere: No eventual consistency issues

Ready to Simplify Your Stack?

Eliminate Redis, reduce compute costs, simplify operations.