Eclipse Zenoh
Eclipse Zenoh: Zero Overhead Pub/Sub, Store/Query and Compute.
Zenoh (pronounced /zeno/) unifies data in motion, data at rest, and computations. It carefully blends traditional pub/sub with geo-distributed storages, queries, and computations, while retaining a level of time and space efficiency that is well beyond any of the mainstream stacks.
Check the website zenoh.io for more information and installation instructions.
See also the roadmap for more detailed technical information.
Storage manager plugin for zenohd router
A plugin that allows connecting zenohd to different storages (e.g., databases). This plugin is a plugin manager
itself that loads its own plugins - backends - specific for the external storage API.
Backends available
-
memorybackendStores data in a hashmap in memory, statically linked to the storage manager.
-
This backend relies on the host's file system to implement the storages.
-
This backend relies on Amazon S3 to implement the storages. It is also compatible with MinIO object storage.
-
This backend relies on RocksDB to implement the storages.
-
This backend relies on InfluxDB server to implement the storages.
Configuring storages
The storages are configured in the storage manager plugin configuration in the plugins section of the
config.json.
There are two concepts in the storage manager: "volumes" and "storages".
The "volume" is a specific database backend plugin (memory, s3, rocksdb, etc.) plus a concrete backend configuration (database name, username, password, etc.).
The "storage" is a mapping from a glob key expression to a volume, defining where data for each path is stored.
Here is a simple example config that sets up two storages. The __path__ explicitly
sets up paths to dynamic plugins for different platforms.
"plugins":
Usage of storages
Assume that we are in the root of the zenoh repository.
Uncomment the following part in the DEFAULT_CONFIG.json5 which demonstrates using
external plugin config files.
"plugins|": ,
Also either change option timestamping -> enabled -> peer to true or change the mode to router to enable message
timestamping which is required by storage manager.
Run the zenohd router with adminspace write permissions enabled:
RUST_LOG=info
The RUST_LOG=info is important to enable logging from zenoh_plugin_storage_manager itself. Otherwise, the logs from plugins are suppressed.
The adminspace write permissions allow you to manage storages dynamically at runtime via the admin space REST API. See the example at the end.
Verify that the plugin loaded successfully: the output should contain lines like:
)
)
)
)
)
)
)
)
)
)
)
)
Now we can store and retrieve data. This can be done by zenoh put and get operations as well as using REST API.
Store and retrieve data
Using zenoh operations
Store some data using put:
Then query the stored data:
Expected output with the stored data
>> Received ('demo/memory/test': 'Hello from zenoh put')
Notice that this would not work without storage enabled. The put operation belongs to the publish/subscribe API, while the get is part of the query/reply API.
It's the storage that runs a subscriber and querier for its key expression. In other words, storages link pub/sub and query/reply APIs together in
the Zenoh network.
Using REST API
Store data via REST PUT:
Retrieve data via REST GET:
Expected output:
Note: Use the application/json content type and quoted value in PUT to get data as a string value in GET json output. Otherwise, the value is base-64 encoded to
ensure correctness of the json format.
Delete stored data with REST DELETE:
You can verify the deletion by querying the key again:
Expected output (empty array, indicating no data found):
Using the admin space to manage storages
You can manage storages dynamically via the admin space - the predefined key expression starting with @/.
To view current storages:
|
Expected output (showing active storages):
Add another memory storage dynamically:
Delete example storage dynamically:
Verify the new memory storage is created and the example storage is deleted:
|