Skip to content

08. Plugins

Eneko Gonzalez edited this page Jan 28, 2026 · 5 revisions

Plugins in ChronoLog are lightweight native interfaces that sit on top of the storage layer.
They provide higher-level abstractions that make it easier for applications to interact with ChronoLog without working directly with the low-level API.
By doing so, plugins extend ChronoLog’s capabilities and allow existing systems to adopt it with minimal changes, while still benefiting from its time-structured, multi-tiered data model.

8.1 ChronoKVS

ChronoKVS turns ChronoLog into a multi-version key-value store (MV-KVS). It allows storing, retrieving, and auditing key-value pairs with full version history, enabling temporal queries and state reconstruction at any point in time.

Initialization

Note: The configuration file allows specifying connection details such as server addresses and ports, making it possible to connect to remote ChronoLog clusters or customize local deployment settings.

chronokvs::ChronoKVS();

Default constructor for local deployments. Uses default connection settings.

chronokvs::ChronoKVS(const std::string& config_path);

Constructor with configuration file path. Use this for distributed deployments or when you need to customize connection parameters for personalized local deployments.

API

std::uint64_t put(const std::string& key, const std::string& value);

Stores a key-value pair and returns the timestamp assigned to it.

std::string get(const std::string& key, uint64_t timestamp);

Retrieves the value of a key at the given timestamp. Returns an empty string if no event exists at that exact timestamp.

std::vector<EventData> get_history(const std::string& key);

Returns the complete historical sequence of values for a key.

std::vector<EventData> get_range(const std::string& key, uint64_t start_timestamp, uint64_t end_timestamp);

Retrieves all events for the given key within the half-open time interval [start_timestamp, end_timestamp). Returns events with timestamp >= start_timestamp and < end_timestamp.

std::optional<EventData> get_earliest(const std::string& key);

Retrieves the earliest (oldest) event for the given key. Returns std::nullopt if no events exist for that key.

std::optional<EventData> get_latest(const std::string& key);

Retrieves the latest (most recent) event for the given key. Returns std::nullopt if no events exist for that key.

Clone this wiki locally