Savant icon indicating copy to clipboard operation
Savant copied to clipboard

ReplayDb

Open bwsw opened this issue 2 years ago • 0 comments
trafficstars

The Replay adapter (RPA) accumulates streaming history in storage, such as S3, and can resend the requested data to the specified 0mq socket on demand.

A request is like:

  • source_id
  • UUIDs
  • [sync=true/false]
  • [service_messages=true/false]
  • [shutdown=token]
  • [eos=true/false]
  • [before=N]
  • [after=M]
  • [pts=preserve/contiguous]
  • [webhook]

Where:

  • sync defines whether to send synchronously according to PTS or as fast as possible.
  • source_id is the name to save under, context-specific (files or S3).
  • UUIDS list of keyframe UUID forming payload of the request.
  • before means N fully decodable blocks before the first UUID.
  • after means M fully decodable blocks after the last UUID.
  • webhook is a URL to notify upon completion.
  • service_messages defines whether to send EOS and SHUTDOWN if they are present.
  • shutdown defines whether to send shutdown upon completion.
  • eos defines whether to send EOS upon completion.
  • pts defines how to treat PTS of sent blocks.

Concurrent requests must be served in parallel. When the request is complete, a webhook is called if registered during the invocation.

The basic implementation must keep PTS as is; if the user provides the UUID list with gaps, they must persist.

What is UUID? The UUID is the UUID of the keyframe addressing the block. In the savant-rs 0.2.17, we added a feature to get the UUID of the previous keyframe for any frame. So, the user can place metadata in MongoDB or OpenSearch and extract blocks related to the event. Then, he/she requests the VAP to create a recording.

The VAP works as a pass-through or a sink adapter. Users can specify the socket for incoming and outgoing traffic and the credentials for storage.

Application Modules:

  • adapter itself (separate docker endpoint);
  • query API (separate docker endpoint, can be launched separately for LB);

Works on:

  • MongoDB or RocksDB implementation;

Parameters:

  • Mongo collection TTL;
  • Mongo connection (incl. cluster);
  • Worker pool size.

bwsw avatar Oct 27 '23 09:10 bwsw