Skip to main content
Redis is an in-memory data store used for caching, sessions, and real-time applications.

Quick Start

How Redis Works

Redis is key-value, not relational. It cannot filter data natively like SQL databases. OmniQL bridges this gap by providing filtering logic that works seamlessly with your queries.

Data Model

OmniQL maps entities to Redis Hash structures:

Key Pattern

Examples:

Query Types

Direct Key Lookup (Fast)

When you query by id, OmniQL translates directly to Redis commands:
This is instant - same performance as native Redis.

Filtered Query (Scan + Filter)

When you query by other fields, OmniQL scans keys and filters results:
This works but scans data - use for smaller datasets or with LIMIT.

CRUD Operations

GET (HGETALL)

By ID (direct lookup):
With filtering:
All records:

CREATE (HMSET)

UPDATE (HSET)

DELETE (DEL)

BULK INSERT

UPSERT

DROP TABLE

Filtering Support

OmniQL supports all standard operators for Redis filtering:

Example with Complex Filter

Aggregations

OmniQL provides aggregation operations:

COUNT

SUM

AVG

MIN / MAX

Transactions

Redis supports transactions with MULTI/EXEC:
Translates to:
Rollback:
Note: DISCARD cancels the transaction before execution. Once EXEC runs, changes cannot be rolled back.

Permissions (ACL)

Redis uses ACL for user management:

CREATE USER

GRANT

REVOKE

DROP USER

Note: Redis has users with permissions, not roles. CREATE ROLE, DROP ROLE, ASSIGN ROLE are not supported.

Type Storage

All Redis values are stored as strings: OmniQL automatically converts types when filtering.

Supported Operations

Not Supported

Performance Considerations

Best Practices

  1. Use ID lookups when possible - Direct key access is instant
  2. Always use LIMIT - Prevents scanning entire keyspace
  3. Index hot queries in SQL - For complex filtering, consider PostgreSQL
  4. Use Redis for what it’s good at - Sessions, caching, counters, real-time data

When to Use Redis with OmniQL

Good use cases:
  • Session storage
  • User profiles / settings
  • Caching layer
  • Real-time counters
  • Simple CRUD by ID
  • Aggregations on bounded datasets
Consider PostgreSQL instead:
  • Complex queries with multiple filters
  • Relational data with joins
  • Large datasets requiring full scans
  • Data requiring GROUP BY

Next Steps

PostgreSQL

Full-featured SQL database

Operators

All supported operators