Scalable datastore for metrics, events, and real-time analytics