Mu TSDB PDD: Gorilla-inspired Features (Design Intake)

Source: pdd-gorilla-inspired/index.md

Mu TSDB PDD: Gorilla-inspired Features (Design Intake)

Date: 2026-02-25

Context

Mu is a lean TSDB built for three hard goals:

This document captures implementation ideas worth "ripping" from Meta/Facebook's Gorilla TSDB design and paper, adapted to Mu's goals and constraints.

Primary reference: "Gorilla: A Fast, Scalable, In-Memory Time Series Database" (Teller et al.). https://www.vldb.org/pvldb/vol8/p1816-teller.pdf

Non-goals (for this PDD)

Key decision: "never drop a metric" vs Gorilla availability tradeoffs

Gorilla explicitly tolerates dropping a small amount of recent data under some failure/overload situations to preserve availability. Mu's "never drop a metric" goal implies different defaults:

Design ideas to adopt (with Mu adaptation and phase)

1) Delta-of-delta timestamp bitpacking (per-series)

What Gorilla did:

Why we want it:

Mu adaptation:

Phase:

2) XOR float value compression (per-series)

What Gorilla did:

Why we want it:

Mu adaptation:

Phase:

3) Time-partitioned compressed blocks (2h as a starting point)

What Gorilla did:

Why we want it:

Mu adaptation:

Phase:

4) Open/closed block lifecycle (append-only open, immutable closed)

What Gorilla did:

Why we want it:

Mu adaptation:

Phase:

5) Serve queries by copying compressed blocks (avoid server-side decompression)

What Gorilla did:

Why we want it:

Mu adaptation:

Phase:

6) Slab allocation to control fragmentation

What Gorilla did:

Why we want it:

Mu adaptation:

Phase:

7) Hybrid in-memory index (paged scan + O(1) lookup) with tombstones/free-pool

What Gorilla did:

Why we want it:

Mu adaptation:

Phase:

8) Locking strategy optimized for write-heavy workloads

What Gorilla did:

Why we want it:

Mu adaptation:

Phase:

9) Per-shard persistence format (key dictionary + id-tagged append log + checkpoints)

What Gorilla did:

Why we want it:

Mu adaptation:

Phase:

10) Ops model: dual region redundancy, shard assignment, client buffering, partial results

What Gorilla did:

Why we want it:

Mu adaptation:

Phase:

Additional Gorilla-derived features to consider

11) Hot-window cache with long-term source of truth

What Gorilla did: