Complete Configuration
Architecture Patterns
Deduplication Store
The CAS uses a deduplication store that separates index metadata from content:Why Deduplication? Build artifacts often contain duplicate data across different objects. Deduplication stores content chunks once and uses an index to map multiple object hashes to shared chunks, reducing storage costs.
Fast-Slow Store Pattern
Each store uses a two-tier caching strategy:Compression
The content store uses LZ4 compression before storing to S3:LZ4 Benefits: Extremely fast compression/decompression with moderate compression ratios. Ideal for build artifacts where speed is more important than maximum compression.
S3 Configuration
Provider Options
Retry Configuration
Exponential Backoff: Retries use exponential backoff with jitter to avoid thundering herd problems. With
max_retries: 6 and delay: 0.3, maximum delay is approximately 9.6 seconds.Key Prefix Organization
Use different prefixes to organize data:- Environment separation (prod/, staging/, dev/)
- Independent lifecycle policies per prefix
- Cost tracking by prefix
AWS Credentials
NativeLink uses the standard AWS credential chain:- Environment variables (
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY) - Shared credentials file (
~/.aws/credentials) - IAM instance profile (EC2/ECS)
- IAM role (EKS with IRSA)
Required IAM Permissions
Filesystem Alternative
For local SSD caching instead of memory:Performance Tuning
Memory Cache Size
Adjust based on your working set size:S3 Request Concurrency
Higher concurrency improves throughput for parallel builds but increases memory usage. Start with default settings and increase if S3 becomes a bottleneck.
Cost Optimization
S3 Lifecycle Policies
Set up lifecycle rules to transition old objects to cheaper storage:Request Cost Reduction
- Use larger memory cache to reduce S3 GET requests
- Enable compression to reduce transfer costs
- Use VPC endpoints to avoid NAT gateway charges
See Also
- Basic CAS Configuration - Local filesystem backend
- Multi-Worker Setup - Distributed execution with S3
- Store Types - Complete store configuration reference