Agree with Colin that InfluxDB is your best bet. Watch out for the not quite SQL syntax though, it does tend to catch people out.
Have a look at the following answer I gave to a question which should help you with the terminology and structures that you probably want.
Need more detailed information on influxdb - General - Node-RED Forum
You should also look at Grafana which is a great way to produce excellent dashboards and charts from InfluxDB data.