Week 5: More Databases

This week we practiced with three additional database services: MongoDB, InfluxDB, and TimescaleDB. Each has their advantages. Here’s a quick summary for my future reference:

  • MongoDB works well for document storage and retrieval (such as photos). It’s easy to get data in, but writing those queries to get the data out is tortuous. Reading JSON in the terminal, every pretty printed, is terrible. But I can see how this would be useful in JS applications. The return-time on queries is a bit sluggish.

  • InfluxDB was built to store measurements and makes it really easy to group by time with the interval function. Compared to all others, I prefer the syntax of writing in this SQL-like language. Don’t forget to set the timezone at the end of each query!

  • TimescaleDB is an extension of PostgreSQL and structures all inputs by time; time is the primary key for records. Queries are quick and the time_bucket function makes it very easy to group data by different time interval (last week we used extract). Our practice TimescaleDB database is running on a DigitalOcean Droplet. My understanding from class is that this cannot be installed on Amazon’s nor Google’s servers at the moment. Good to know for future.

See this document for the results of my queries this week.

Added March 16, 2019: there are indeed MUCH simpler solutions to the first question linked in the document above. These were Don’s solutions:

Screen Shot 2019-03-16 at 4.46.13 PM.png
Screen Shot 2019-03-16 at 4.46.27 PM.png