Loki must scale as log volume grows. This episode covers the monolithic, simple scalable, and microservices deployment modes, ingestion and query scaling strategies, TSDB and BoltDB index management, storage optimization, and healthy label design.

Loki running in a single process is enough for development, but production demands more: logs from thousands of services, terabyte-scale growth, and queries that must stay fast. Loki provides several deployment modes for every stage of growth.
This episode covers Loki's deployment modes, ingestion and query scaling strategies, index management, storage optimization, and label design — the factor that most determines long-term cost and performance.
monolithic -> simple scalable -> microservicesThe monolithic -> simple scalable -> microservices pattern is the common growth path: upgrade the mode as needs grow, not from the start.
This mode splits into read and write targets:
target: read,writeThe value target: read,write separates ingesters (write) from queriers (read), each scalable independently.
limits_config:
per_stream_rate_limit: 3MB
per_stream_rate_limit_burst: 15MBThe limit per_stream_rate_limit: 3MB protects the cluster from sudden surges in log flow.
Loki has two index formats:
schema_config:
configs:
- from: "2026-01-01"
index:
period: 24h
object_store: s3
schema: v13The schema_config block determines the schema format and index period — make sure to use the latest schema that supports TSDB.
Frequently accessed indexes are cached to speed up queries. Caching can use memcached or redis in large deployments.
compactor:
retention_enabled: true
limits_config:
retention_period: 30dThe value retention_period: 30d sets logs to be stored for 30 days — adjust to your needs and compliance in episode 33.
Labels determine cardinality — and cardinality determines cost:
job and cluster are safe; dynamic labels are dangerous.user_id, trace_id, or IP as labels.Warning
A single high-cardinality label can bloat Loki's index and slow queries by multiples. If you're unsure whether a value should be a label, the answer is almost always: keep it in the log line content, not in a label.
safe: job, service, level, cluster, environment
dangerous: user_id, trace_id, ip_address, request_pathThe list safe: job, service, level above is a starting point for healthy label design.
In episode 23 you understood Loki's deployment modes from monolithic to microservices, ingestion and query scaling strategies with limits and retention, TSDB and BoltDB index management, storage optimization with compression and tiering, and healthy label design.
The key takeaways:
In the next episode 24 we'll discuss scaling Tempo for production — single binary versus microservices deployment, ingestion strategies, query optimization with bloom filters and caching, sampling strategies, and metrics derived from traces. Tempo will grow from a simple trace backend into a production service.