Building the apps
We can start from the embedded app, which will be very close to what we just did. Before we start writing the code, we need to figure out the data flow between the machines.See the following diagram:
You probably already noticed that the embedded devices are gRPC servers instead of clients and our middle app, the Gateway between the sensors and the cloud is a gRPC client and a server. The other way around is probably the easiest and the least complicated setup where all the sensors are clients that connect to one gRPC server (the Gateway). There is one reason this setup may not work in some cases and all depends on the IT rules and the infrastructure of the company.
For example, if this is a residential home with wired sensors to the home network, it makes perfect sense to have them as gRPC clients who connect directly to a Gateway machine or even directly to the cloud. In the enterprise often it is not that simple. Usually, these devices will be sitting behind a firewall...