Schema V1 (Deprecated)
V1 is the original ACOR storage schema. It uses multiple Redis keys per collection.
V1 is deprecated and read-only as of
v1.5.0. Reads,Suggest, andInfowork, andMigrateV1ToV2converts a collection in place, butAddandRemovereturnErrV1ReadOnly.Flushalso still works, and still deletes every key in the collection — read-only refuses keyword writes, it does not protect the collection fromFlush. It gains no features either: preset engines andEnableCacheboth require V2. New collections should use the default V2 schema. The read path stays for the wholev1line and is removed no earlier thanv2.
Overview
V1 creates approximately 5 keys per 100 keywords:
| Key Pattern | Purpose |
|---|---|
{name}:keyword | Set of keywords |
{name}:prefix | Trie prefix edges |
{name}:suffix | Trie suffix links |
{name}:output:{state} | Output keywords per state |
{name}:node:{keyword} | Node metadata |
Performance Characteristics
| Operation | Complexity |
|---|---|
| Find() | O(N×3-5) RTT |
| Add() | O(M×3-10) RTT — no longer reachable; kept to explain the migration’s value |
Where:
- N = number of trie states visited
- M = keyword length
When to Use V1
- Existing collections using V1
- Small keyword sets (< 10,000)
- Migration not feasible
Migration to V2
# Preview migration
acor -name mycollection migrate --dry-run
# Execute migration
acor -name mycollection migrate
# Rollback to V1
acor -name mycollection migrate-rollback
Key Structure Diagram
graph LR
A[keyword set] --> B[prefix trie]
B --> C[suffix links]
C --> D[output sets]
D --> E[node metadata]
Limitations
- Higher memory usage
- More Redis keys to manage
- Slower Find() operations
- More network round-trips
Recommendation
Migrate to V2 for new collections or when performance is critical.