
[[time-series-storage]]
= Time Series Database
:description: Overview of OpenNMS time series database options: RRDtool and Newts. Plugins and parallel series writes.

{page-component-title} stores performance data in a time series database (RRDTool by default).
For different scenarios you may want to use a different time series database.
The following implementations are installed by default:

[caption=]
.Default {page-component-title} time series databases
[cols="1,3"]
|===
| Time Series Database  | Description

| RRDtool
| RRDtool is actively maintained and the de-facto standard for time series data.
Data is stored on the local file system of the {page-component-title} node.
Depending on I/O capabilities it works well for small- to medium-size installations.

| Newts
| http://opennms.github.io/newts/[Newts] is an OpenNMS database schema for http://cassandra.apache.org[Cassandra].
The time series is stored on a dedicated Cassandra cluster, which gives growth flexibility and lets time series data persist at a large scale.

| JRobin
| JRobin is a clone of RRDtool written in Java and was the default time series database in prior releases of {page-component-title}.
It does not fully cover the latest RRDtool feature set.
Data is stored on the local file system of the {page-component-title} node.
It is deprecated and support for its use will be removed in a future release.

|===

This chapter describes how to configure {page-component-title} to use RRDtool and Newts.

== Time series database plugins

You can use time series database integrations with plugins based on our OpenNMS Plugin API (formerly OIA).
Several plugins are available as a replacement for the ones shipped with OpenNMS {page-component-title} (see xref:time-series-storage/timeseries/ts-integration-layer.adoc[]).

CAUTION: The way data is stored in different time series databases makes it extremely hard to migrate from one technology to another.
You cannot prevent data loss when you switch from one database type to another.

== Run two time series writes in parallel

The default time series strategy (RRD, Newts, Integration Plugin) is used for both read and write operations.
You can add another time series to write in parallel to the default strategy.
This additional time series database may be used for validation purposes or for staging metrics before moving from one time series to another.
If you plan to migrate to a new storage strategy, you can set the new strategy as a write destination while keeping reads on your current storage.
Once you have written enough data to the new storage, you can then flip the reads over to the new system.

In order for the dual write plugin to work, you must install a time series feature (either Newts or an integration plugin) and leave `org.opennms.timeseries.strategy` at your current value.
This will allow writing to both the strategy and the time series database.

[[ga-dual-write-newts]]
=== Write to Newts in parallel


.Create a file to load the `opennms-newts` feature:
[source, console]
sudo vi etc/featuresBoot.d/newts.boot

.Add the feature and save the file:
[source, newts.boot]
opennms-newts

.Restart {page-component-title} to apply the changes:
[source, console]
sudo systemctl restart opennms

[[ga-dual-write-integration]]
=== Write to time series integration plugin in parallel

You can enable writing to any time series integration plugin in parallel to RRD or Newts by enabling the `opennms-timeseries-api` feature and not setting the strategy to `integration`.
This will direct writes to both your `org.opennms.timeseries.strategy` destination and any installed timeseries integration plugin.

.Create a file to load the `opennms-timeseries-api` feature:
[source, console]
sudo vi etc/featuresBoot.d/timeseries.boot

.Add the feature and save the file:
[source, timeseries.boot]
opennms-timeseries-api

.Restart {page-component-title} to apply the changes:
[source, console]
sudo systemctl restart opennms
