Course contentsShow
← Cloud and Infrastructure
Lesson 2035 of 2,98943. Observability - LoggingFree lesson

Loki Components and Deployment Modes

Learn Loki's microservices (distributor, ingester, querier, compactor) and deployment patterns from monolithic to scaled architectures.

Loki Components and Deployment Modes

What you'll learn: How Loki's modular microservices fit together and how to deploy them from simple to highly scaled configurations.

Understanding Loki's Microservices

Loki breaks logging responsibilities into specialized components that can run together or separately:

Distributor: Acts as the front door. It receives log streams from agents, validates them, hashes labels to determine which ingester should store them, and forwards logs. Think of it as a mail sorter directing packages to the right warehouse.

Ingester: Holds recent logs in memory, creates chunks, compresses them, and flushes to object storage. It's your temporary warehouse before permanent archival.

Querier: Handles LogQL queries by fetching data from both ingesters (recent logs) and object storage (historical logs), merging results before returning them to users.

Compactor: Runs background maintenance—deduplicating index entries, compacting files, and managing retention policies. It's the janitor keeping your storage efficient.

Deployment Modes

Loki offers flexibility based on scale:

Monolithic mode: All components run in a single process. Perfect for development, testing, or small deployments (under 100GB/day). Simple to operate but doesn't scale horizontally.

Simple scalable mode: Components grouped into read, write, and backend services. The write path (distributor + ingester) scales separately from reads (querier). Good middle ground for moderate scale.

Microservices mode: Every component runs independently with dedicated replicas. Maximum scalability and resilience for production at scale, but requires orchestration complexity (typically Kubernetes).

You choose based on log volume, query load, and operational maturity—start simple, scale as needed.

Key Takeaway: Loki's modular architecture lets you deploy as a single binary for simplicity or as separate microservices for massive scale, with each component handling a specific part of the log ingestion and query pipeline.