How do I choose between column-family and a document store database?

103 views Asked by At

I'm working on a project, and I'm struggling to make a definitive decision on whether to use a column-family or a document store. My situation is as follows:

The project I am working on is a hass.io application that will visualize certain data for Tesla cars. My project will run on a raspberry pi (pi 3), so database size is an issue. My data will look something like this:

{
"cars" : [
    {
        "car_id" : 3241123,
        "model" : "Tesla S",
        "data" : [
            {
                "timestamp": 23840923804982309,
                "temperature": 24.5,
                "battery_level" : 40,
                "is_charging" : true,
                "speed" : null
            },
            {
                "timestamp": 23840923804982333,
                "temperature": 26.0,
                "battery_level" : 35,
                "is_charging" : false,
                "speed" : 30
            }
        ]
    },
    {
        "car_id" : 3241157,
        "model" : "Renault Zoey",
        "data" : [
            {
                "timestamp": 23840923804982309,
                "temperature": 23.3,
                "battery_level" : 90,
                "is_charging" : true,
                "speed" : null
            },
            {
                "timestamp": 23840923804982350,
                "temperature": 23.0,
                "battery_level" : 92,
                "is_charging" : true,
                "speed" : null
            }
        ]
    }
]

}

  • my project HAS to use a NoSQL database
  • This example is in JSON, but it's just to show the data. It doesn't have to be stored in the database as a JSON file per se.
  • It is expected that the amount of cars will be low (2-4) and the amount of data will grow quite large (a couple of new entries per minute)

I want to be able to plot the data in a graph, so most likely my queries will have to return the timestamp for every data point of every car and some other value, like for example speed or battery level. My database will have a very low amount of clients, and real-time data visualization is not required. Therefore read speed is not very important.

As far as my research has shown according to these requirements, the column-family and document store architectures don't differ too much. Except for scalability, but I don't believe my database will grow to the scale that I will have to start thinking about sharding, and if I do I probably will first have to think about vertical scaling. Am I right in believing this or is there an actual difference?

On a side note: I am asking this question comparing column-families to document store, but perhaps this comparison is futile at this level, and I have to start looking at specific column-stores and document stores. If so any advice in this direction is also appreciated.

0

There are 0 answers