Choosing a Datastore
Introduction
Datastore is the backend used by CDP Logger, usually some database. The default is CDPCompactDatastore. Currently, the following datastores are provided:
Note: Only one row should be added under CDP Logger Datastore table in Configure mode. Otherwise, the first one is used, others are ignored.
Comparison
Aspect | CDPCompactDatastore | InfluxDB | CSVDatastore |
---|---|---|---|
Description | Default back-end for CDP Logger. Stores data into a local file using a custom format that provides high performance while minimizing disk usage. | Open source time series database. It is designed to handle high write and query loads and provides an SQL-like query language called InfluxQL for interacting with data. | Writes logged data into a local CSV (comma-separated values) file. |
Configuration | Very little configuration is needed and all of it can be done through CDP Studio. | Requires setting up a remote InfluxDB server. Authentication, retention policies, continuous queries aggregating data, etc. must be configured separately through InfluxDB server interface. | Very little configuration. |
Integration with CDP Studio Analyze mode and Database Graph Widget | Data format is optimized for plotting large amounts of data while keeping peak values visible. | Basic integration for plotting data, performance may suffer when the database gets large. For huge data sets it is recommended to set up continuous queries aggregating data and plot data using third-party tools (like Grafana). | Plotting through CDP Studio is not supported. It is recommended to use third-party tools. |
When to Use |
|
| CSV format is supported by many tools (including Microsoft Excel). This makes it easy to analyze the log with third-party tools. |
Custom Datastore
Custom datastores can be implemented to CDPLogger.
- Create a library project.
- In Code mode, right click on your project and select Add Library.... In the wizard select CDP Library and add
cdplogger
as a dependency. - In Code mode, right click on your project and select Add New.... In the wizard choose CDP Node Model and add it to your library.
- Make the added node inherit the abstract class
CDPLogger::Datastore
from<CDPLogger/Datastore.h>
. - In Configure mode, set the BaseModel property of your node to "CDPLogger.Datastore".
- Finally, list your node in [LibraryName]Builder.cpp by editing the
CreateNewCDPNode
method.CDP::StudioAPI::CDPNode *LibraryNameBuilder::CreateNewCDPNode(const std::string &type) { if (type == "LibraryName.MyDatastore") return new MyDatastore(); return CDPBuilder::CreateNewCDPNode(type); }
- Build the library and test your datastore by adding it into a CDP Logger.
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.