Storage engine for time-series database