joshvince / commuter

The Node.js version of a web service that provides additional data about the London Underground
0 stars 0 forks source link

Capture historical data #13

Open joshvince opened 7 years ago

joshvince commented 7 years ago

This should capture historical data rather than just throwing it away every five minutes.

Once, per hour, something should get a snapshot of each line and should update a separate table in the DB with a timestamped object (these eventually need to be searchable)

joshvince commented 7 years ago

A schema for this:

Table: history Contains an object:

lineStatus: {
    201701100900: {
      time: 201701100900,
      data: {
        northern: [10,10,10,10],
        central: [5,5,5,5,5]
      },
    201701101000: {
      time: 201701101000,
      data: {
        northern: [10,10,5,5],
        central: [10,10,5,5,5]
      }
  }