Mechanism and Techniques for Scoping Information
DDS provides two mechanism for scoping information, domains and partitions. A domain establishes a virtual network linking all the DDS applications that have joined it. No communication can ever happen across domains unless explicitly mediated by the user application.
Domains can be further organized into partitions, where each partition represent a logical grouping of topics. DDS Partitions are described by names such as SensorDataPartition, CommandPartition, LogDataPartition, etc., and have to be explicitly joined in order to publish data in it or subscribe to the topics it contains. The mechanism provided by DDS for joining a partition is very flexible as a publisher or a subscriber can join by providing its full name, such as SensorDataPartition or it can join all the partitions that match a regular expression, such as Sens* or *Data*. Supported regular expressions are the same as those accepted by the POSIX fnmatch function.
To recap, partitions provide a way for scoping information. You can use this scoping mechanism to organize topics into different coherent sets. You can equally use partitions to segregate topic instances. Instance segregation can be necessary for optimizing performance or minimizing footprint for those applications that are characterized by a very large number of instances, such as large telemetry systems, or financial trading applications, and for which one can come up with natural segregation.
If we take as an example our temperature monitoring and control system, then we can come up with a very natural partitioning of data that mimics the physical placement of the various temperature sensors. To do this, we can use a partition naming scheme made of the building number, the floor level and the room number in which the sensor is installed:
Using this naming scheme, as in Figure 3, all the topics produced in room 51 on the 15th floor on building 1 would belong to the partition "building-1.floor-15.room-51". Likewise, the partition expression "building-1.floor-1.room-*" matches all the partitions for the rooms at the first floor in building.
In a nutshell, you can use partitions to scope information, you can also use naming conversions such as those used for our temperature control applications to emulate hierarchical organization of data starting from flat partitions. Using the same technique you can slice and access data across different dimensions or views, depending on the need of your application.