The Data Distribution Service (DDS) is a standard for efficient and ubiquitous data sharing built upon the concept of a, strongly typed, distributed data space. The ability to scale from resource constrained embedded systems to ultra-large scale distributed systems, has made DDS the technology of choice for applications, such as, Power Generation, Large Scale SCADA, Air Traffic Control and Management, Smart Cities, Smart Grids, Vehicles, Medical Devices, Simulation, Aerospace, Defense and Financial Trading.
This two part webcast provides an in depth introduction to DDS – the universal data sharing technology. Specifically, we will introduce (1) the DDS conceptual model and data-centric design, (2) DDS data modeling fundamentals, (3) the complete set of C++ and Java API, (4) the most important programming, data modeling and QoS Idioms, and (5) the integration between DDS and web applications.
After attending this webcast you will understand how to exploit DDS architectural features when designing your next system, how to write idiomatic DDS applications in C++ and Java and what are the fundamental patterns that you should adopt in your applications.
3. DDS is a standard technology for ubiquitous,
interoperable, secure, platform independent, and
real-time data sharing across network connected devices
4. Data Distribution Service (DDS)
•
DDS’ Global Data Space is fully
distributed, highly efficient
and scalable
Data
Reader
Data
Writer
QoS
Data
Writer
TopicD
Data
Reader
QoS
TopicA
Data
Writer
QoS
QoS
TopicC
Data
Reader
TopicB
...
Data
Writer
Data
Reader
DDS Global Data Space
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
DDS provides a Global Data
Space abstraction that allow
applications to autonomously,
anonymously, securely and
efficiently share data
5. Data Distribution Service (DDS)
•
Data
Writer
DataWriters and DataReaders are
automatically and dynamically
matched by the DDS Discovery
A rich set of QoS allows to control
existential, temporal, and
spatial properties of data
QoS
Data
Writer
TopicD
Data
Reader
QoS
TopicA
Data
Writer
QoS
QoS
TopicC
Data
Reader
TopicB
...
Data
Writer
Data
Reader
DDS Global Data Space
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
Data
Reader
6. Fully Distributed Data Space
Conceptual Model
Actual Implementation
Data
Reader
QoS
Data
Writer
TopicD
Data
Writer
QoS
QoS
TopicC
TopicD
TopicD
TopicA
QoS
TopicD
Data
Reader
Data
Reader
QoS
Data
Writer
TopicB
Data
Reader
DDS Global Data Space
Data
Reader
QoS
Data
Writer
TopicB
...
Data
Writer
QoS
QoS
Data
Reader
QoS
TopicA
Data
Writer
QoS
TopicA
Data
Writer
QoS
TopicC
Data
Reader
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
Data
Writer
7. Fully Distributed Data Space
Data
Writer
QoS
QoS
TopicD
TopicD
Data
Reader
The
communication
between
the
DataWriter
and
the
DataReader
can
use
UDP/IP
(Unicast
and
Multicast)or
TCP/IP
QoS
Data
Writer
TopicA
QoS
TopicD
Data
Reader
QoS
Data
Writer
QoS
TopicA
Data
Writer
QoS
TopicC
Data
Reader
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
TopicB
8. Key Highlights
Elegant and High Level Data Sharing Abstraction
Polyglot and platform independent
•
•
•
Java, Scala, C, C++, C#, JavaScript, CoffeeScript etc.
Android, Windows, Linux,VxWorks, etc.
Peer-to-Peer by nature, Brokered when useful
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
•
9. Key Highlights
Content and Temporal Filtering (both sender and receiver
filtering supported)
•
•
Queries
20+ QoS to control existential, temporal, and spatial properties of
data
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
10. Key Highlights
•
•
~35-50 usec latency*
7M msgs/sec node-to-node throughput*
(*) Performance measured on Linux Host with i7 processor on a 1Gbps Ethernet network
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
High Performance and Scalable
12. Use Cases
Training & Simulation Systems
Naval Combat Systems
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
Integrated Modular Vetronics
Air Traffic Control & Management
Unmanned Air Vehicles
Aerospace Applications
13. Use Cases
Large Scale SCADA Systems
Smart Cities
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
Agricultural Vehicle Systems
Train Control Systems
Complex Medical Devices
High Frequency Auto-Trading
16. Domain
•
•
DDS data lives within a domain
•
The number 0 identifies the default
domain
A domain represent an impassable
communication plane
DDS Domain
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
A domain is identified with a non
negative integer, such as 1, 3, 31
17. Partitions
•
Partitions are the mechanism provided by DDS to
organize information within a domain
•
•
Access to partitions is controlled through QoS Policies
Partitions are defined as strings:
•
“system:telemetry”
“system:log”
“data:row-‐2:col-‐3”
Partitions addressed by name or regular expressions:
•
•
”system:telemetry”
“data:row-‐2:col-‐*”
Partitions
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
•
•
19. Topic
A Topic defines a domain-wide information’s class
QoS
name: identifies the topic within the domain
•
qos: is a collection of policies that express the
non-functional properties of this topic, e.g.
reliability, persistence, etc.
type: is the programming language type
associated with the topic. Types are extensible
and evolvable
TopicA
QoS
QoS
TopicC
TopicB
...
Name
Topic
e
Typ
•
•
QoS
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
A Topic is defined by means of a (name, type, qos)
tuple, where
TopicD
Qo
S
•
•
20. Topic and Instances
As explained in the previous slide a topic defines a class/type of information
Topics can be defined as Singleton or can have multiple Instances
Topic Instances are identified by means of the topic key
A Topic Key is identified by a tuple of attributes -- like in databases
Remarks:
•
•
A Singleton topic has a single domain-wide instance
A “regular” Topic can have as many instances as the number of different key values,
e.g., if the key is an 8-bit character then the topic can have 256 different instances
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
•
•
•
•
22. Active Floor
•
•
Assume we are building an active floor
•
This information is then used by the
application that uses the active floor for
positioning or entertainment
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
This active floor is made by a matrix of
pressure sensors used to detects position,
and indirectly movement
Cell:
(i,j)
23. Active Floor
•
The generic active cell can be modeled with a
topic that has an instance for each value of (i,j).
The topic type can be defined as:
struct
TCell
{
short
row;
short
column;
float
pressure;
//
in
kPa
};
#pragma
keylist
TCell
row
column
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
Each cell is now distinguishable and associated
with a topic instance
Cell:
(i,j)
24. Active Floor
How can we know when something is on the
cell?
•
The detection can be based on the difference
between the atmospheric pressure, say P0,
and the pressure sensed by the cell
•
We can model this as a Singleton Topic
ReferencePressure defined by the type:
struct
TReferencePressure
{
float
pressure;
//
in
kPa
float
precision;
};
#pragma
keylist
TReferencePressure
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
Cell:
(i,j)
25. Active Floor
time
4
e
ssur
Pre
2
3
•
3
time
Each sensor has associated a topic
instance identified by the
(row,column) coordinate -- the
instance key
struct
TCell
{
short
row;
short
column;
float
pressure;
//
in
kPa
};
#pragma
keylist
Cell
row
column
time
•
Each instance produces a stream
of pressure values that in DDS
terms are called samples
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
1
2
e
ssur
Pre
0
1
e
ssur
Pre
0
27. Active Floors on a Building
ti
me
re
su
es
Pr
1
re
su
es
Pr
2
3
4
Let’s assume now that we
have a building that uses
active floors to detect
presence and movement
How can we organize the
out data model?
ti
me
0
re
su
es
Pr
0
•
•
1
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
2
ti
me
3
28. Active Floors on a Building
1
re
su
es
Pr
1
re
su
es
Pr
2
3
4
ti
me
0
re
su
es
Pr
0
•
The first thing to do is to
introduce the third
dimension to our cell:
struct
TCell
{
short
row;
short
column;
short
floor;
float
pressure;
//
in
kPa
};
#pragma
keylist
TCell
row
column
floor
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
ti
me
2
ti
me
3
29. Active Floors on a Building
ti
me
ti
me
1
re
su
es
Pr
1
re
su
es
Pr
2
3
4
ti
me
0
re
su
es
Pr
0
As we move from a single floor to a
building we need to add some more
structure to our data
•
2
•
We can now use:
•
•
•
•
A Domain for each Building
A Partition for each Floor
A Partition for reference value,
i.e. Partition
A Partition for the configuration
information, e.g. how many floors,
how many rows/cols per floor
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
3
30. Active Floors on a Building
1
re
su
es
Pr
1
re
su
es
Pr
4
Floor Partitions:
•
2
3
Thus the resulting structure is:
ti
me
0
re
su
es
Pr
0
•
•
•
•
•
•
“building:f-‐1”
“building:f-‐2”
...
Reference Values Partition:
•
“building:refvals”
Configuration Partition:
•
“building:config”
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
ti
me
2
ti
me
3
32. DataWriter
Conceptually, the DataWriter QoS should be
the same as the Topic QoS or more stringent
•
However, DDS does enforce a specific
relationship between the Topic and
DataWriter QoS
e
Typ
•
Topic
DW
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
A DataWriter (DW) is a strongly typed
entity used to produce samples for one or
more instances of a Topic, with a given QoS
Qo
S
•
33. DataWriter
Define a new topic instance
Write samples for a topic instance
Dispose the topic instance
e
Typ
•
•
•
Topic
DW
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
The DataWriter controls the life-cycle of Topic
Instances and allows to:
Qo
S
•
35. DataReader
Conceptually, the DataReader QoS should be the same
as the Topic QoS or less stringent
•
However, DDS does enforce a specific relationship
between the Topic and DataReader QoS
e
Typ
•
Topic
DR
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
A DataReader (DR) is a strongly typed entity used
to access and/or consume samples for a Topic,
with a given QoS
Qo
S
•
36. DataReader
time
4
e
ssur
Pre
2
3
•
3
time
time
Depending on its QoS a
DataReader may provide
access to:
•
•
•
last sample
last n samples
all samples produced
since the DataReader was
created
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
1
2
e
ssur
Pre
0
1
e
ssur
Pre
0
37. DataReader
•
3
time
2
time
3
4
e
ssur
Pre
n=3
time
Depending on its QoS a
DataReader may provide
access to:
•
•
•
last sample
last n samples
all samples produced
since the DataReader was
created
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
1
2
e
ssur
Pre
0
1
e
ssur
Pre
0
38. DataReader
•
3
time
2
time
3
4
e
ssur
Pre
n=3
time
Depending on its QoS a
DataReader may provide
access to:
•
•
•
last sample
last n samples
all samples produced
since the DataReader was
created
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
1
2
e
ssur
Pre
0
1
e
ssur
Pre
0
39. DataReader
•
3
time
2
time
3
4
e
ssur
Pre
n=3
time
Depending on its QoS a
DataReader may provide
access to:
•
•
•
last sample
last n samples
all samples produced
since the DataReader was
created
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
1
2
e
ssur
Pre
0
1
e
ssur
Pre
0
40. DataReader
•
3
time
2
time
3
4
e
ssur
Pre
n=3
time
Depending on its QoS a
DataReader may provide
access to:
•
•
•
last sample
last n samples
all samples produced
since the DataReader was
created
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
1
2
e
ssur
Pre
0
1
e
ssur
Pre
0
41. DataReader
•
3
time
2
time
3
4
e
ssur
Pre
n=3
time
Depending on its QoS a
DataReader may provide
access to:
•
•
•
last sample
last n samples
all samples produced
since the DataReader was
created
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
1
2
e
ssur
Pre
0
1
e
ssur
Pre
0
42. DataReader
•
3
time
2
time
3
4
e
ssur
Pre
n=3
time
Depending on its QoS a
DataReader may provide
access to:
•
•
•
last sample
last n samples
all samples produced
since the DataReader was
created
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
1
2
e
ssur
Pre
0
1
e
ssur
Pre
0
43. DataReader
•
3
time
2
time
3
4
e
ssur
Pre
n=3
time
Depending on its QoS a
DataReader may provide
access to:
•
•
•
last sample
last n samples
all samples produced
since the DataReader was
created
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
1
2
e
ssur
Pre
0
1
e
ssur
Pre
0
44. DataReader
e
ssur
Pre
4
Samples are stored in the DataReader
Cache
•
time
2
3
•
3
Samples can be read or taken from the
cache
•
time
•
Samples taken are evicted from
the cache
•
time
Samples read remain in the cache
and are simply market as read
The cache content can be selected
based on content or state. More on
this later...
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
1
2
e
ssur
Pre
0
1
e
ssur
Pre
0
46. DDS Entities
Domain (e.g. Domain 123)
Domain
Participant
Topic
Partition (e.g. “Telemetry”, “Shapes”, )
Topic Instances/Samples
Ta
•
•
•
•
Tb
Publisher
Subscriber
Tx
Ty
Tc
DataWrter
DataReader
DomainParticipant: Provides access to a data cloud -- called a domain in DDS
Topic: Domain-wide definition of a kind of Information
Publisher/Subscriber: Provide scope to data sharing through the concept of partitions
DataReader/DataWriter: Allow to read/write data for a given topic in the partitions their Subscriber/Publisher are associated with.
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
T1
T1 T3
47. DomainParticipant
The DomainParticipant is the programming entity that gives access
to a DDS domain
•
A DomainParticipant is created as follows:
//
ISO
C++
DDS
API
int
domain_id
=
18;
auto
dp
=
DomainParticipant(domain_id);
//
Java
5
DDS
API
int
domain_id
=
18;
DomainParticipantFactory
dpf
=
DomainParticipantFactory.getInstance(env)
DomainParticipant
dp
=
dpf.createParticipant(domainId);
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
48. Topic
Given a DomainParticipant we can define (or discover) Topics
within a domain. This can be done as follows:
//
ISO
C++
DDS
API
auto
topic
=
Topic<TCell>(dp,
“Cell”);
•
//
Java
5
DDS
API
Topic<TCell>
topic
=
dp.createTopic(“Cell”,
TCell.class);
As this declaration does not explicitly provide QoS for the Topic,
the default QoS will be used
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
49. Publisher/Subscriber
Publisher/Subscriber, through the Partitions they are associated
with, define the scope of a write/read operation
•
•
Partitions association is done through the Partition QoS Policy
This association can be defined as a list of string as well as a list of
regular expressions
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
50. Publisher/Subscriber
Definition of a Publisher/Subscriber in the default partition:
//
ISO
C++
DDS
API
auto
pub
=
Publisher(dp);
•
//
ISO
C++
DDS
API
auto
sub
=
Subscriber(dp);
Definition of a Publisher/Subscriber with Partition settings
//
ISO
C++
DDS
API
auto
pub_qos
=
dp.default_publisher_qos()
<<
Partition(”af:telemetry”);
auto
pub
=
Publisher(dp,
pub_qos);
//
ISO
C++
DDS
API
auto
sub_qos
=
dp.default_subscriber_qos()
<<
Partition(”af:telemetry”);
auto
sub
=
Subscriber(dp,
sub_qos);
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
51. Publisher/Subscriber
//
Java
5
DDS
API
Publisher
pub
=
dp.createPublisher();
•
//
Java
5
DDS
API
Subscriber
sub
=
dp.createSubscriber();
Definition of a Publisher/Subscriber with Partition settings
//
Java
5
DDS
API
PublisherQos
pubQoS
=
dp.getDefaultPublisherQos()
.with(pf.Partition(”af:telemetry”));
//
Java
5
DDS
API
SubscriberQos
subQoS
=
dp.getDefaultSubscriberQos()
.with(pf.Partition(”af:telemetry”));
Publisher
pub
=
dp.createPublisher(pubQoS);
Subscriber
sub
=
dp.createSubscriber(subQoS);
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
Definition of a Publisher/Subscriber in the default partition:
52. DataWriter
A DataWriter with default QoS can be declared as follows:
//
ISO
C++
DDS
API
auto
dw
=
DataWriter<TCell>(pub,
topic);
//
Write
the
cell
c(1,1)
using
`writer`
TCell
c11
=
{1,
1,
15};
dw.write(c11);
//
Write
the
cell
c(1,2)
using
the
`operator
<<`
TCell
c12
=
{1,
2,
5};
dw
<<
c12;
//
Java
5
DDS
API
DataWriter<TCell>
dw
=
pub.createDataWriter<TCell>(topic);
TCell
c11
=
new
TCell(1,
2,
15);
dw.write(c11);
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
53. DataReader
A DataReader with default QoS can be declared as follows:
//
ISO
C++
DDS
API
auto
dr
=
DataReader<TCell>(sub,
topic);
//
Read
Samples
auto
samples
=
dr.read();
//
Do
something
with
it
std::for_each(samples.begin(),
samples.end(),
do_something);
//
Java
5
DDS
API
DataReader<TCell>
dr
=
sub.createDataReader<TCell>(topic);
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
55. Topic
JavaScript
var myTopic = new dds.Topic(domainID, topicName, topicType);
Example:
var topic = new dds.Topic(0, 'Cell', 'com.activefloor.Cell');
CoffeeScript
Example:
topic = new dds.Topic(0, 'Cell', 'com.activefloor.Cell')
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
myTopic = new dds.Topic(domainID, topicName, topicType)
56. DataWriter
CoffeeScript
dw = new dds.DataWriter(topic, qos)
Example:
dw = new dds.DataWriter(topic)
dw.write(cell)
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
cell = {}
cell.x = 3
cell.y = 5
cell.pressure = 3
57. DataReader
CoffeeScript
dr = new dds.DataReader(topic, qos)
Example:
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
dr = new dds.DataReader(topic)
58. Binding a DataReader
A DataReader can be bound to a user provided function that will
handle incoming data or to a cache
•
Notice, that as you are in control of how data-readers are bound to
cache you can be very creative
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
59. Binding to User Function
CoffeeScript
dr.addListener(f)
Example:
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
dr.addListener((s) -> console.log(JSON.stringify(s)))
60. Binding to a Cache
CoffeeScript
cache = new DataCache(historyDepth)
bind(keyMapper)(dr, cache)
// Binding
bindCell = dds.bind((s) -> s.x + “-” + s.y)
ccache = new DataCache(historyDepth)
bindCell(cache, cdr)
// Working with the Cache: Compute number of active cells
activeCells = ccache.map((c) -> if (c > p0) then 1 else 0).fold(0)((a, c) -> a + c)
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
Example:
62. Shapes Application
•
The iShapes application is used by DDS
vendors to demonstrate some of the
basic mechanism as well as product
interoperability
•
Three Topics
•
Circle, Square, Triangle
One Type
struct ShapeType {
string color;
long x;
long y;
long shapesize;
};
#pragma keylist ShapeType color
Spotted shapes represent subscriptions
Pierced shapes represent publications
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
65. Data Centricity
•
•
DDS is Data Centric, it provides an
elegant, efficient and scalable data
sharing abstraction
When designing the architecture of
a DDS-based system the DataModel is the first thing that should
be devised
One of the most common question
from DDS novices is how to come
up with a good data model.
Data
Reader
Data
Writer
QoS
Data
Writer
TopicD
Data
Reader
QoS
TopicA
Data
Writer
QoS
QoS
TopicC
Data
Reader
TopicB
...
Data
Writer
Data
Reader
DDS Global Data Space
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
66. Data Modeling in DDS
A good starting point for identifying DDS topics is to describe your
system in a natural language and then use the following table:
English Language
DDS
Common Noun
Topic
Proper Noun
Topic Instance
Transitive Verb
Relationship
Intransitive Verb
Attribute Type
Adjective
Topic Attribute
Adverb
Relationship Attribute
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
67. Relationships
As in DBMS, relationships can be expressed, depending on
cardinality and relation attributes, by:
•
•
Keys and foreign keys
Relationship Topics
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
68. Normalization
•
Notice that the nature of DDS may induce further data
normalization to deal with conflicting QoS requirements, such as:
•
•
Mix of frequently and infrequently changing data
Mix of attributes that have different persistence requirements
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
As in DBMS, Topics should be normalized to improve modularity,
efficiency and limit if not avoid anomalies. Typically you should have
your Topics in the 3NF
70. Summary & Remarks
DDS provides an elegant Data Space abstraction that allows
application to share data ubiquitously and efficiently -- the Data
Space implementation is fully distributed
•
DDS provides primitives for defining classes of information as well
as organizing it
•
Data Modeling and normalization draws heavily from DBMS theory
and practice with some additional considerations w.r.t. the nature of
DDS
Copyright
2013,
PrismTech
–
All
Rights
Reserved.
•
71. :: Connect with Us ::
¥opensplice.com
¥opensplice.org
¥forums.opensplice.org
¥opensplicedds@prismtech.com
¥@acorsaro
¥@prismtech
¥ crc@prismtech.com
¥youtube.com/opensplicetube
¥slideshare.net/angelo.corsaro
¥sales@prismtech.com