This document contains information that has been researched during the course of creating Simple IoT.
An IoT system is inherently distributed. At a minimum, there are three components:
- device (Go, C, etc.)
- cloud (Go)
- multiple browsers (Elm, Js)
Data can be changed in any of the above locations and must be seamlessly synchronized to other locations. Failing to consider this simple requirement early in building the system can make for brittle and overly complex systems.
resgate.io is an interesting project that solves the problem of creating a real-time API gateway where web clients are synchronized seamlessly. This project uses NATS.io for a backbone, which makes it interesting as NATS is core to this project.
The Resgate system is primarily concerned with synchronizing browser contents.
Has some interesting ideas.
- Version Control Systems Version control systems like Git and Mercurial use specialized merkle trees to manage versions of files and even directories. One advantage of using merkle trees in version control systems is we can simply compare hashes of files and directories between two commits to know if they've been modified or not, which is quite fast.
- No-SQL distributed database systems like Apache Cassandra and Amazon DynamoDB use merkle trees to detect inconsistencies between data replicas. This process of repairing the data by comparing all replicas and updating each one of them to the newest version is also called anti-entropy repair. The process is also described in Cassandra's documentation.
One limitation of Merkel trees is the difficulty of updating the tree concurrently. Some information on this:
- Lamport timestamp
- used by Yjs
- Thing properties include the following, which are analogous to SIOT node
- Name (Desription)
- Type (Type)
- Attributes (Points)
- Groups (Described by tree structure)
- Billing Group (Can also be described by tree structure)
- Thing properties include the following, which are analogous to SIOT node fields.
- each type has a specified attributes -- kind of a neat idea