Data
Lux provides two data storage options: Tables for relational data and KV Store for key-value storage.
Data Storage Options
Tables (Relational)
SQL-based storage with schemas, perfect for structured data.
- Best for: User records, orders, products, structured entities
- Features: SQL queries, schemas, relationships, migrations
- Backend: Turso (SQLite-compatible)
KV Store (Key-Value)
Fast key-value storage for simple data.
- Best for: Settings, cache, session data, counters
- Features: Get/set operations, fast lookups, TTL support
- Backend: Cloudflare KV
Which Should I Use?
| Use Case | Recommendation |
|---|---|
| User profiles with multiple fields | Tables |
| Product catalog with search | Tables |
| Order history with relationships | Tables |
| User preferences | KV Store |
| Rate limiting counters | KV Store |
| Cache/temporary data | KV Store |
| Session tokens | KV Store |
Data in Flows
Both data types are accessible from Flows:
Trigger → Fetch Data (from Table) → Process → Update DataTrigger → Get KV Value → Check Value → Set KV ValueData Isolation
Data is isolated by:
- Organization - Each org has separate databases
- Project - Projects within an org have separate data
Next: Tables →