Section 3 of 8 Storage & performance
Prefer TieredStorage
ArgusLogs.TieredStorage writes structured records to a SQLite hot database while rolling cold batches to Snappy-compressed Parquet. Compared to append-only JSONL, indexed columns (timestamp, level, traceId, userId) stay queryable without scanning the whole file.
Recommended storage tiers
- ApplicationArgusLogs.core emits structured telemetry at method, SQL, and HTTP boundaries.
- Hot tier (SQLite)Recent records in LogRecords — fast filters for the embedded UI and ad-hoc diagnostics.
- Cold tier (Parquet)Partitioned archives after RetentionDays — compact long-term storage for analytics jobs.
- SQLite keeps the working set small; vacuum and batch inserts avoid unbounded WAL growth.
- Parquet + Snappy dramatically reduces disk versus pretty-printed JSON lines.
- Dedicated UserId column (plus MetadataJson) enables indexed lookups without parsing every row.
- TieredStorage migrates older SQLite schemas automatically — UserId is added if missing.
Enable in AddArgus
Call WithTieredStorage inside AddArgus so sinks register with the same license and options discovery as the core package.
builder.Services.AddArgus(options =>
{
options.WithTieredStorage(tiered =>
{
tiered.Enabled = true;
tiered.SqliteConnectionString = "Data Source=logs/tiered/argus_hot.db;Cache=Shared";
tiered.ArchiveDirectory = "logs/tiered/archives";
tiered.RetentionDays = 7;
tiered.BatchSize = 10_000;
tiered.CompressionMethod = "Snappy";
});
});NuGet package
Install ArgusLogs.TieredStorage alongside ArgusLogs and ArgusLogs.UI for the full embedded diagnostics stack.
dotnet add package ArgusLogs.TieredStorage --version 1.0.11-alpha.2608292142