Hey All,
I have a bunch of questions about JSON API structure but I’ve just got this question about time series data before I create those other discussions.
I am aware that both Tom Dale and Yehuda Katz have mentioned that Ember Data is not designed for time series data, but I’m wondering if that design decision still applies to JSON API?
I’m working on a PR for Kue to add a time series endpoint for jobs that have completed on a hourly basis. The structure that I have for a response at the moment is an object where the key is a timestamp floored to the nearest hour and the value is an array of Job Ids. Here is an example:
{
"complete": {
"1451610000000": [],
"1451613600000": [],
"1451617200000": [],
"1451620800000": [],
"1451624400000": [],
"1451628000000": [],
"1451631600000": [],
"1451635200000": [],
"1451638800000": [],
"1451642400000": [],
"1451646000000": [],
"1451649600000": [],
"1451653200000": [],
"1451656800000": [],
"1451660400000": [],
"1451664000000": [],
"1451667600000": [],
"1451671200000": [],
"1451674800000": [],
"1451678400000": [],
"1451682000000": [],
"1451685600000": [],
"1451689200000": [],
"1451692800000": [
"68",
"69",
"70",
"71",
"72",
"73",
"74",
"75",
"76",
"77",
"78",
"79",
"80",
"81",
"83",
"84",
"86",
"88",
"90",
"93",
"95",
"97"
],
"1451696400000": [],
"1451700000000": [],
"1451703600000": [],
"1451707200000": [],
"1451710800000": [],
"1451714400000": [],
"1451718000000": [],
"1451721600000": [],
"1451725200000": [],
"1451728800000": [],
"1451732400000": [],
"1451736000000": [],
"1451739600000": [],
"1451743200000": [],
"1451746800000": [],
"1451750400000": [],
"1451754000000": []
},
"failed": {
"1451610000000": [],
"1451613600000": [],
"1451617200000": [],
"1451620800000": [],
"1451624400000": [],
"1451628000000": [],
"1451631600000": [],
"1451635200000": [],
"1451638800000": [],
"1451642400000": [],
"1451646000000": [],
"1451649600000": [],
"1451653200000": [],
"1451656800000": [],
"1451660400000": [],
"1451664000000": [],
"1451667600000": [],
"1451671200000": [],
"1451674800000": [],
"1451678400000": [],
"1451682000000": [],
"1451685600000": [],
"1451689200000": [],
"1451692800000": [
"82",
"85",
"87",
"89",
"91",
"92",
"94",
"96",
"98",
"99",
"100"
],
"1451696400000": [],
"1451700000000": [],
"1451703600000": [],
"1451707200000": [],
"1451710800000": [],
"1451714400000": [],
"1451718000000": [],
"1451721600000": [],
"1451725200000": [],
"1451728800000": [],
"1451732400000": [],
"1451736000000": [],
"1451739600000": [],
"1451743200000": [],
"1451746800000": [],
"1451750400000": [],
"1451754000000": []
}
}
Ideally I would like this to be able to be a hasMany
relationship in Ember i.e. making use of JSON API references so that the client can go request the Job details when required instead of having a massive response up front.
Let me know if you want me to explain this more or if you need me to give more examples.