Four Minute Paper: Facebook’s time series database, Gorilla

Premise for the paper

Back in 2013 Facebook’s monitoring system, an HBase time series db (TSDB), was not scaling sufficiently. Reads from the system were becoming too slow. Since there wasn’t a TSDB solution on the market that addressed their need of storing massive amounts of data in real-time, Facebook developed Gorilla, an in-memory TSDB.

Whats unique about Gorilla

The attributes that set Gorilla apart from other TSDBs were that its an in-memory TSDB that functions as a write through cache for monitoring data and that it prioritizes reads/writes over availability of older data.

Use cases for Gorilla

  • Observability for hundreds of different systems, focusing on reliable real-time monitoring of production systems.
  • Identify issues with new software releases.
  • Be highly available and continue to operate with network failures.
  • Be fault tolerant with multi-region architecture.

Attributes of Gorilla

  • Gorilla is a write thru cache.
  • It’s aggregate data is more important than individual data points.
  • Recent data points are of higher value (85% of queries read past 26 hrs of data).
  • ACID guarantees are not necessary, but a high percentage of writes must succeed.
  • Optimized for being available for reads and writes in the face of failures prioritized over availability of any older data.


  • High data insertion rate.
  • Total data quantity.
  • Real-time aggregation.
  • Reliability requirements.


  • In-memory cache (past 26 hrs) of the on-disk persistent store.
  • Compressed data to reduce size of cache 12x.
  • Multi-instance Gorilla architecture (reads go to closest instance) for fault tolerance.


  • Compression algorithm
  • In-memory data structure
  • Persistent on-disk data structure
  • Fault tolerance


Gorilla reduced Facebook’s production latency by 70x compared to their on-disk TSDB and has doubled in size with relatively low admin costs to do so all while maintaining high availability.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store