Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
package-lock.json
.idea
22 changes: 3 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
## MQTT DB Nodes
## Google IoT core nodes

The MQTT DB Nodes are a clone of the built in MQTT nodes modified to optionally persist
messages in a lightweight local database in case of a lost connection, crash or Node-RED restart.

### How it works

The mqtt client used by the node is configured to store incoming and outgoing messages using the NeDB database. Messages are stored in the `mqttdb` directory in the Node-RED directory. In there, for each
broker configuration node, here is a directory containing incoming and outgoing message collections.

To enable persistent storage for input and output messages, click on the appropriate check boxes. You can change the *compaction interval time* to compact the internal database and remove deleted messages.

Database files for a connection are stored in the Node-RED directory under the *mqttdb* directory. These can be safely removed after stopping Node-RED to clear unsent messages. The database
used is [NeDB](https://github.com/louischatriot/nedb).

### Known Issues

1. When a broker connection node is configured to persist incoming messages, the messages can be corrupted. We recommend only configuring outgoing persistence for now.

2. The NeDB database is similar to REDIS in that it maintains data in RAM and writes to a file in case it goes down. Since it is RAM based, I expect it can only run so long storing messages before it runs into trouble.
The Google IoT core nodes are a clone of the [MQTTDB](https://github.com/SenseTecnic/node-red-contrib-mqttdb) nodes modified for
easier connecting Node-RED to the Google IoT core MQTT broker.
Loading