Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Railway 3 min read Case study mediumAdept

How We Rebuilt Our Log Storage and Search Infrastructure for Scale

Railway replaced per-request Docker log polling (every 2 seconds, straining the Docker daemon across 500,000+ deployments) with a centralized log pipeline. Docker's syslog driver forwards container logs to a per-node Vector agent, which ships them to a central Vector instance that writes hourly filesystem buckets for real-time tailing and short-term queries and batches them to Google Cloud Storage for long-term retention. A Go gRPC streaming service serves logs through GraphQL subscriptions to the React frontend, enabling historical deployment logs and keyword filtering, with Vector's Datadog sink used for pipeline monitoring.

Related posts

  • Logarithm: A logging engine for AI training workflows and services

    Meta Engineering mediumAdept

    Logarithm is Meta's internal serverless, multitenant log indexing service, written in C++20 with coroutines, that ingests over 100 GB/s of logs and serves thousands of queries per second with SLOs on freshness, completeness, durability and latency. Its architecture rests on a few choices: a disaggregated compute/storage split, with logs stored as ORC blocks in Manifold and lightweight Bloom-filter secondary indices cached on query clusters, plus tiering across memory, SSD and blob storage. Scribe/LogDevice queues and a sharded MySQL locality service handle durability and block placement, and Shard Manager drives ingestion elasticity. Queries can trade result completeness or ordering for latency, and a randomized streaming API lets AI training dashboards render hundreds of tensor time series incrementally. A per-line metadata API attaches context such as PyTorch rank IDs, which helps debug distributed training failures.

  • Our New Observability Platform for 100B Logs

    Railway mediumAdept

    Railway rebuilt its logging backend on ClickHouse to power Log Explorer, handling about 1 billion new logs per day, 100 billion stored logs and 60 queries/sec at roughly 50ms average latency on a 2-shard/2-replica cluster. The previous system (local filesystem plus GCS, filtering in a single Go process) couldn't do cross-service search, fast far-back queries, horizontal scaling or aggregates. ClickHouse compressed 28TB of tagged logs to 5TB, and the team rolled it out within a week by dual-writing via Vector and translating their filter DSL to SQL. The main production surprise was asynchronous replication omitting recent logs, which an HAProxy primary-routing attempt didn't fix but the insert_distributed_sync setting did.

  • Scaling our Observability platform beyond 100 Petabytes by embracing wide events and replacing OTel

    ClickHouse mediumAdept

    ClickHouse's internal LogHouse platform grew from 19 PiB to over 100 PB of uncompressed logs (about 500 trillion rows), mostly by replacing the OpenTelemetry pipeline for ClickHouse server telemetry with SysEx. SysEx is a pull-based Go exporter that copies system tables byte-for-byte from customer pods into LogHouse in ClickHouse's Native format. It assigns pods to scrapers with a hash ring and queries a sliding time window trailing real time by about five minutes, so internal buffers flush before rows are read. Schema drift is handled with hashed, versioned tables unified through the Merge engine. The OTel collectors needed 800+ cores for 2M logs/s and still dropped events, while SysEx ships 37M logs/s on about 70 cores with no edge loss. HyperDX now replaces the team's Grafana-based UI.

  • Scaling observability at Character.AI: thousands of GPUs, 10x logs, and 50% lower cost with ClickStack

    ClickHouse mediumAdept

    Character.AI consolidated fragmented logging across multi-cloud Kubernetes GPU clusters onto ClickStack (HyperDX UI) backed by ClickHouse Cloud. It ingests 10x more log data at 50% lower cost, and log searches that took minutes now return in seconds. Raw output of about 450 PB/month is tamed with aggressive sampling: errors and warnings are kept in full, while info logs are sampled at 1 in 10,000 for the backbone service and 1% elsewhere. OpenTelemetry Collector DaemonSets insert directly with async inserts and batching. Schema tuning included primary keys aligned to time and service queries, materialized columns extracted from JSON, pruned skip indexes and per-column compression, yielding roughly 15–20x compression. Collector misconfiguration, such as missing batching or unsampled ingestion, caused outages, and a gateway layer plus native JSON and PromQL support are planned next.

  • How we built reliable log delivery to thousands of unpredictable endpoints

    Datadog Engineering mediumAdept

    Datadog's Log Forwarding avoids head-of-line blocking from Kafka's per-partition FIFO ordering by moving logs out of Kafka early into cloud object storage, grouped by destination. A stager service reads logs from Kafka and writes slice files of individually compressed per-destination slices, which it uploads and registers in a metadata store before committing Kafka offsets. A leader-elected planner builds lightweight forwarding tasks from eligible slices based on each destination's batching settings. Shipper workers range-read only the slices they need, send them to the endpoint and retry failures with exponential backoff, which gives per-endpoint isolation without a Kafka topic per destination and scales horizontally to gigabytes per second.

The quest for software engineering knowledge.

Look:
Layout: