Purpose
LER (Lutaml EXPRESS Repository) packages provide a binary format for distributing EXPRESS schemas as self-contained, optimized files. LER packages offer faster loading times, smaller file sizes, and built-in indexes for efficient querying.
What is a LER package?
A LER package (.ler file) is a ZIP archive containing:
-
Serialized EXPRESS schemas (in Marshal, JSON, or YAML format)
-
Pre-built indexes for fast entity and type lookups
-
Schema manifest describing all included schemas
-
Metadata about the package and its contents
-
Optional original EXPRESS source files
Benefits of LER packages
Performance improvements
- Faster loading
-
Parsing EXPRESS schemas is CPU-intensive. LER packages contain pre-parsed model objects that load instantly.
Example 1. Loading time comparison-
Parsing 100 EXPRESS files: ~45 seconds
-
Loading equivalent LER package: ~2 seconds
-
Speed improvement: ~22x faster
-
- Pre-built indexes
-
Entity and type indexes are included, eliminating the need to build them on load.
Size reduction
- Binary serialization
-
Marshal format provides compact binary serialization, typically 40-60% smaller than source EXPRESS files.
- Compressed storage
-
ZIP compression further reduces file size by 60-80%.
-
Source EXPRESS files: 15 MB
-
Uncompressed LER (Marshal): 6 MB
-
Compressed LER package: 1.2 MB
-
Size reduction: 92% smaller
Package structure
A typical LER package contains:
example.ler (ZIP archive)
├── metadata.yaml # Package metadata and configuration
├── manifest.yaml # Schema manifest with file list
├── repository.marshal # Serialized repository (binary)
├── entity_index.marshal # Pre-built entity index
├── type_index.marshal # Pre-built type index
├── reference_index.marshal # Pre-built reference index
└── express_files/ # Optional EXPRESS source files
├── schema1.exp
├── schema2.exp
└── schema3.exp
When to use LER packages
Production deployments
Use LER packages when:
-
Deploying applications that load schemas repeatedly
-
Distributing schema sets to end users
-
Building services that need fast startup times
-
Working with large schema collections (50+ files)
Package modes
Resolution modes
resolved(default)-
All references between schemas are resolved and stored in the package. Recommended for most use cases.
bare-
Schemas stored without reference resolution. Requires reference resolution on load. Rarely used.
Common workflows
Package operations
The following operations are available for LER packages:
- Building
- Loading
- Querying
- Validating
- Formats
Performance considerations
Memory usage
LER packages load the entire repository into memory:
-
Small packages (<100 schemas): Negligible impact
-
Medium packages (100-500 schemas): 50-200 MB RAM
-
Large packages (>500 schemas): 200-500 MB RAM
Consider memory constraints when building packages for resource-limited environments.
CLI vs API usage
Command-line interface
Best for:
-
One-off operations
-
Scripts and automation
-
Interactive exploration
-
CI/CD pipelines
# Build package
expressir package build schemas/ output.ler
# Query package
expressir package list output.ler --type entity
# Validate package
expressir package validate output.ler --strict
Ruby API
Best for:
-
Application integration
-
Programmatic workflows
-
Custom processing
-
Building tools
# Build package
repository.export_to_package("output.ler")
# Load package
repository = Expressir::Model::Repository.from_package("output.ler")
# Query package
entities = repository.list_entities
Next steps
Explore detailed guides for working with LER packages:
-
Creating Packages - Build LER packages
-
Loading Packages - Load and use packages
-
Querying Packages - Search package contents
-
Validating Packages - Verify package integrity
-
Package Formats - Choose serialization formats
Summary
LER packages provide significant performance and usability benefits:
-
20-30x faster loading than parsing EXPRESS files
-
80-95% smaller than source files
-
Self-contained with resolved dependencies
-
Pre-built indexes for efficient querying
-
Multiple serialization format options
-
Suitable for production deployments
Key takeaways:
-
Use LER packages for production and distribution
-
Develop with EXPRESS files, deploy with LER packages
-
Marshal format offers best performance
-
Include EXPRESS files for debugging capability
-
Validate packages before deployment
-
Automate package creation in CI/CD pipelines