Historical data, on the other hand, grows over time by definition. Simply limiting the results to the most recent N records will not suffice for heavy loads or large numbers of users. Somehow, the server needs to filter and sort the data prior to returning it via a REST call. The filtering and sorting parameters must function identically to the filtering and sorting of the active sessions.
For this to work at all, historical data must be removed from the Connection object, and brought to the top level. History records must be queryable in bulk, and in one operation, without having to find their associated connections first.