Encoding Modes
AXON automatically selects the optimal encoding mode based on your data structure
Compact Mode
Default for uniform arrays
CSV-like columnar format with type annotations. Best for arrays of similar objects.
Nested Mode
For complex hierarchies
Handles objects with arbitrary nesting depth while maintaining compression benefits.
Columnar Mode
For large datasets (1000+ rows)
Column-oriented storage optimized for analytics and large tables.
Stream Mode
For time-series data
Optimized for sequential data with temporal ordering. Applies delta encoding automatically.
Sparse Mode
For data with >50% nulls
Only stores non-null values with position indices, dramatically reducing size.
JSON Fallback
For irregular data
Falls back to JSON for highly irregular data where compression wouldn't help.
Mode Selection Example
You can check which mode AXON would recommend for your data:
import { getModeRecommendation } from '@axon-format/core';
const data = { /* your data */ };
const recommendation = getModeRecommendation(data);
console.log(recommendation.mode); // 'columnar'
console.log(recommendation.reason); // Explanatory text Best Practice: Let AXON choose the mode automatically. Manual override is rarely needed and may reduce compression effectiveness.