ARTICLE AD BOX
I am experimenting with GridDB for an IoT application where sensors continuously send temperature and humidity readings.
Each record contains a timestamp and the measurements. The container is defined in my Java application like this:
class SensorData { @RowKey Timestamp timestamp; double temperature; double humidity; }Sensor data is inserted continuously using the Java API:
Container<String, SensorData> container = store.getContainer("sensor_data");
SensorData row = new SensorData();
row.timestamp = new Timestamp(System.currentTimeMillis());
row.temperature = 22.5;
row.humidity = 60;
container.put(row);
Because the system stores continuous sensor readings, the dataset will grow very quickly over time. In the production environment we only need to keep the last 30 days of data, and older data should be automatically removed.
I read that GridDB supports data expiration for time-series containers, but I am not sure how this should be configured when using the Java API.
My goal is to automatically delete records older than 30 days without running manual cleanup queries.
My question is:
What is the correct way to configure automatic data expiration (TTL) for a time-series container in GridDB when using the Java client API?
Is the expiration policy defined when the container is created, or can it be updated later for an existing container?
