官术网_书友最值得收藏!

The overall architecture

Now that we have seen the interfaces between the different layers of the web development stack, we can visualize the overall architecture of the system:

We can now see a high-level overview of all the components discussed so far. The interfaces between each layer discussed in the previous sections are now represented by the boundaries between each block in the diagram (Public APIs, STDOUT, and Database queries). The system will work as follows:

  • The server application running on the Raspberry Pi interfaces with the rest of the components.
  • It starts the program to get sensor values from the Pi and reads its output through STDOUT.
  • Every time the server application receives a new value, it stores it in memory as well as in the database. The in-memory value is replaced every time a new value is received from the sensor.
  • The client views and interacts with the application by calling APIs exposed by the server:
    • The API to get the current value returns the value that is currently stored in the memory of the server application
    • The API to get historical values has the server query the database and return its results
主站蜘蛛池模板: 格尔木市| 竹北市| 乌兰浩特市| 宁河县| 陇西县| 双牌县| 营山县| 阿克苏市| 韩城市| 屯昌县| 红安县| 兴城市| 嘉黎县| 孝感市| 宁化县| 昌平区| 汶川县| 合肥市| 清远市| 普兰店市| 翼城县| 获嘉县| 河间市| 固始县| 清河县| 五莲县| 平凉市| 绥中县| 东宁县| 武隆县| 澄迈县| 宜宾市| 双峰县| 嘉禾县| 巴东县| 天津市| 高雄市| 晋城| 镇沅| 古浪县| 嘉义县|