On sketches, there is a genre of structure for estimating histogram-like statistics (median, 99th centile, etc) in fixed space, which i really like. Two examples:
t-digest https://github.com/tdunning/t-digest
t-digest https://github.com/tdunning/t-digest
There was a good discussion on approaches to store histogram here: https://news.ycombinator.com/item?id=31379383