coming to terms with writing a time-series database