[Part 1 offers an overview of web services and how they can enable smart objects to be efficiently integrated into existing IT and enterprise business systems. Part 2 examines the question "Can smart objects maintain a good performance for web services?"]
9.3 PACHUBE: A WEB SERVICE SYSTEM FOR SMART OBJECTS
To ground the discussion about web services and RESTful interfaces for smart objects, we investigate Pachube, one particular real-world instantiation of a RESTful interface for smart objects.
Pachube is a web site, as shown in Figure 9.9, to which users can submit sensor data from sensor networks and upload and store the data on the Pachube server. The sensor data can later be retrieved and processed from the Pachube servers. The Pachube web site lists several ideas for which Pachube can be used such as electrical usage monitoring and management, real-time pollution monitoring, and home automation.
FIGURE 9.9 The Pachube web site. Data sources are marked on a world map.
The developers of Pachube envision it as the fabric on which smart object systems and applications can be built. Smart objects, sensor networks, and telemetry systems submit data to the Pachube servers where the data are stored for later retrieval. The data can be retrieved by stand-alone applications that process the data to either visualize the data for human users, or to autonomously operate on the data.
Examples of applications that may want to work on these data without a human in the loop are building automation systems or electricity savings systems. The input to such a system consists of temperature data and electricity readings from sensors that submit their data to Pachube. An excerpt of the Pachube web site that illustrates this concept is shown in Figure 9.10.
FIGURE 9.10 Pachube is intended to be an intermediary for smart object applications.
We use Pachube as an example because of its status as an emerging service provider in the ecosystem that is about to form around smart objects. Pachube provides an open Application Program Interface (API) based on the RESTful architectural model and allows remote sensors to send their data to the Pachube servers over an HTTP connection. Where many of the applications for smart objects target industrial applications, Pachube illustrates the possibility of a consumer-oriented service for smart objects.
Figure 9.11 shows how data stored on the Pachube server can be displayed directly in a web browser window, but this is only one of the many available alternatives for accessing the data. Since the data stored on the servers are opaque, the data can be retrieved and processed independent of the API.
FIGURE 9.11 A feed of sensor data from the Pachube web site.
Pachube provides an open API for accessing the sensor data stored on the servers over the Internet. It is intentionally simple and provides methods for uploading and downloading data. Application complexity is held outside of the system. Applications only query the Pachube servers for data, and any processing is performed on the application side.
Pachube data are divided into feeds. Roughly speaking, one feed corresponds to one instance of a particular application. For example, a building automation system built on Pachube may use one feed for the sensor data and control from one building.
Feeds are further subdivided into data streams. A data stream can come from one particular sensor or one particular physical location such as a room. Applications that work on the data can choose to collect data from one stream or many streams from the same feed, depending on the application.
Many of the sensors that serve their data to the Pachube servers are connected to the Internet via an external device such as a PC. As the field of smart objects continues to grow, we are likely to see IP-based smart objects that communicate directly with the Pachube server.