5G-ERA / middleware

Middleware for orchestration and lifecycle management of the could-native robotic applications
Apache License 2.0
8 stars 3 forks source link

Heartbeat data storage #209

Closed Artonus closed 8 months ago

Artonus commented 11 months ago

Storing heartbeat in its current form in the Redis is inefficient when storing historical data and retrieving the most up-to-date information. A possible switch to Redis TimeSeries or InfluxDB would be a great improvement to the usability. It would also enable easier development of the features correlated to the Heartbeat.

Artonus commented 9 months ago

The list of steps we need to take to migrate existing heartbeat data to InfluxDB:

  1. Deploy InfluxDB in the cloud
  2. Add a new InfluxDB.Client package to the DataAccess project
  3. Create a new InfluxConfig class that will hold values for the Address and API Key to the database. InfluxConfig will have 2 properties: Address and ApiKey
  4. Create new InfluxRepository : IBaseRepository, ITimeSeriesRepository
  5. The New Interface ITimeSeriesReposiotry needs additional methods allowing to query for the device/location/robot within a selected time frame: 1. GetByIdBetween(Guid id, DateTime? start, DateTime? end) DateTime properties being nullable allow to specify only the beginning or the end of the timeframe
    1. GetBetween(DateTime? start, DateTime? end) get all values
  6. Create a new InfluxRobotStatusRepository that will use the newly created InfluxRepository
  7. Create a new InfluxNetAppStatusRepository that will use the newly created InfluxRepository
  8. Replace existing repositories and services in Orchestrator to use new Influx repositories.
  9. Happy using :)