Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/panda-official/driftprotocol

Protobuf Libraries to encode message in Drift infrastructure
https://github.com/panda-official/driftprotocol

ai drift edge protobuf

Last synced: about 2 months ago
JSON representation

Protobuf Libraries to encode message in Drift infrastructure

Awesome Lists containing this project

README

        

# Drift Protocol

The Drift Protocol is a set of libraries that
use [Protocol Buffers](https://developers.google.com/protocol-buffers/docs/overview) (Protobuf) to encode messages in
the [PANDA|Drift infrastructure](https://driftpythonclient.readthedocs.io/en/latest/docs/panda_drift/). The libraries
provide pre-generated Protobuf messages so that users do not have to install the protobuf compiler and generate them
themselves.

## Implementations

* [For C++](cpp/README.md)
* [For Python](python/README.md)

## Example

The Drift Protocol can be used to create microservice applications. An example of such an application is shown in the
accompanying diagram:

![Drift Protocol Example](docs/img/example.drawio.svg)

The Trigger service publishes a trigger as a [Drift Package](docs/api/common.md#driftpackage) with ID = 1630062869443 and
a [Trigger Interval Message](docs/api/triggering.md#intervaltriggermessage), which contains a time interval [t0, t1], to
the `trigger` MQTT topic.

The Timeswipe service subscribes to the `trigger` topic and receives a trigger package. Then it retrieves data of 48000
samples per second from a vibration sensor for the interval [t0, t1] by using a Time Swipe device, compresses, serializes
the data and sends it to MQTT topic `drift/sensor` as a [Drift Package](docs/api/common.md#driftpackage) with
a [Data Payload](docs/api/common.md#datapayload) inside. It contains a
serialized [Wavelet Buffer](https://github.com/panda-official/WaveletBuffer) in the `data` field. The ID of the packages
is the same ID=1630062869443, so we see that the trigger and the data are connected.

The [Drift Core](https://driftpythonclient.readthedocs.io/en/latest/docs/panda_drift/) services subscribe to all MQTT
topics which have `drift/` prefix, parse [Drift Packages](docs/api/common.md#driftpackage) and stores them in the metric
and blob storages. After that, you can use [Drift Python Client](https://github.com/panda-official/DriftPythonClient) to
request data from the storage.

## Why Protobuf?

We use Protobuf to encode messages in Drift Protocol because it is a very efficient and flexible serialization format,
especially for binary data. It is also very easy to use and has a lot of implementations for different programming languages.

## Related Projects

* [WaveletBuffer](https://github.com/panda-official/WaveletBuffer) - A universal C++ compression library based on
wavelet transformation
* [Drift Python Client](https://github.com/panda-official/DriftPythonClient) - Python Client to access data of
PANDA|Drift