Built-in database

mDash has built-in database for MQTT messages. Each message that is sent to the topic that starts with db/, gets automatically stored. There is a limit on a number of stored messages - that limit could be changed on the Account page. If a number of stored messages exceeds the limit, the oldest messages get automatically removed.

Each saved record consists of the topic and a message. A message could be anything - device logs, metrics, etc. Could be in a plain text or in JSON format.

Storage buckets

In addition to the global record limit (configurable on the Account page), it is possible to configure record limits per topic prefix. For example, limit records count on topic that starts with db/logs to 10 records maximum. That gives flexibility in managing data sets.

Arduino example - send free RAM value every 10 seconds

void loop() {
  mDashPublish("db/ram/" DEVICE_ID, "%lu", mDashGetFreeRam());
  delay(1000 * 10);
}