Successfully reported this slideshow.

DDS vs AMQP

7,360 views

Published on

Middleware technologies today play a key role in the vast majority of mission- and business-critical systems. Choosing the right middleware infrastructure for these systems is a non-trivial task that must take into account many different dimensions ranging from the purely technical to tactical and strategic aspects. This Webcast will compare and contrast the Data Distribution Service for Real-Time Systems (DDS) against the Advanced Message Queuing Protocol (AMQP). The comparison will provide an in depth analysis of the technical differences between the two standards and will detail their technology management and technology strategy standpoints.

Published in: Technology

DDS vs AMQP

  1. 1. OpenSplice DDS Delivering Performance, Openness, and Freedom Angelo Corsaro, Ph.D. Chief Technology Officer DDS vs. AMQP OMG DDS SIG Co-Chair angelo.corsaro@prismtech.com
  2. 2. Agenda ‣Genesis ‣Technology Comparison ‣Code Examples ‣Concluding Remarks
  3. 3. OpenSplice DDS Delivering Performance, Openness, and Freedom Historical Perspectives
  4. 4. Genesis DDS AMQP ‣ Emerged from Aerospace and Defense ‣ Emerged from the Financial Market to address the data distribution from the desire of freeing users from requirement of a large class of mission- proprietary and non-interoperable critical systems messaging systems ‣ Evolved to address on-the-wire ‣ Evolved into an effort to define a interoperability and provide the generic enterprise messaging standard ubiquitous data-bus for mission-critical System-of-Systems
  5. 5. Standardization Organization DDS AMQP ‣ DDS is an Object Management Group ‣ AMQP is standardized by the AMQP (OMG) Standard Working Group ‣ The OMG is a an international, open ‣ The AMQP Working Group is a non- membership, not-for-profit computer profit organization with a free industry consortium since 1989 membership based on interest and ‣ OMG is an ISO PAS submitter, able to merit submit our specifications directly into ISO’s fast-track adoption process.
  6. 6. Standard Evolution DDS v1.0 DDS v1.1 DDS v1.2 DDSI v2.0 DDSI v2.1 DDS-XTopics Dec Dec Jan Apr Jan March 2004 2005 2006 2007 2008 2009 2010 Jun Nov Dec AMQP v0-8 AMQP v0-9-1 AMQP v1-0 draft ??? Dec AMQP v0-10 AMQP v0-9
  7. 7. Scope of Standardization Application Application Object/Relational Mapping Data Local Reconstruction Layer (DLRL) DDS v1.2 Content Ownership Durability Subscription API (?) Minimum Profile Data Centric Publish/Subscribe (DCPS) DDSI v2.1 AMQP v1-0 Advanced Message Queuing Protocol Real-Time Publish/Subscribe Protocol Interoperability Wire Protocol DDS Interoperability Wire Protocol TCP/IP UDP/IP
  8. 8. OpenSplice DDS Delivering Performance, Openness, and Freedom Technology Comparison
  9. 9. Which Versions? In the reminder of this presentation I’ll compare DDS v1.2 / DDSI v2.1 with AMQP v1-0
  10. 10. OpenSplice DDS Delivering Performance, Openness, and Freedom Messages vs. Topics
  11. 11. AMQP v1-0 Messages ‣ AMQP is a standard protocol for messaging ‣ As such AMQP the unit of information that can be sent or received is a message. ‣ An AMQP message encapsulate the “Bare Message”, provided by the application, within an annotated message [Source AMQP specification v1-0]
  12. 12. DDS Topics {Circle, Square, Triangle} Topic ‣ Unit of information exchanged between Publisher and Subscribers. ‣ An association between a unique name, a type and a QoS setting {ShapeType} {...} Topic Type. struct ShapeType { ‣ Type describing the data associated with one long x; or more Topics long y; ‣ A Topic type can have a key represented by an long shapesize; string color; arbitrary number of attributes }; ‣ Expressed in IDL #pragma keylist ShapeType color © 2009, PrismTech. All Rights Reserved
  13. 13. Topic/Instances/Samples Recap. Topics Instances Samples ti tj tnow time © 2009, PrismTech. All Rights Reserved
  14. 14. OpenSplice DDS Delivering Performance, Openness, and Freedom Node/Links vs. Reader/Writers
  15. 15. AMQP v1-0 Conceptual Model ‣ An AMQP Network consists of Nodes and Links ‣ A Node is a named source and/or sink of Messages. A Message is created at a (Producer) Node, and may travel along links, via other nodes until it reaches a terminating (Consumer) Node. ‣ A Link is a unidirectional route between nodes along which messages may travel. Links may have entry criteria (Filters) which restrict which messages may travel along them. The link lifetime is tied to the lifetime of the source and destination nodes. m m Link m Node Node
  16. 16. Destructive Links Destructive Links consume the message from the originating source. Destructive Link Destructive Link Destructive Link m m m m Node 1 Node 2 Node 1 Node 2 Node 1 Node 2 Time
  17. 17. Non-Destructive Links Non-Destructive Links don’t consume messages from the source node. Non-Destructive Non-Destructive Link Link m m m m m Node 1 Node 2 Node 1 Node 2 Node 1 Node 2 Time
  18. 18. Filtered Links Links can have associated filters that allow to predicate on the messages that might traverse. Filter can be based on the non opaque portion of the message. Link Link m {color = red} {color = red} m m m Node Node m m m m Node Link Node Link m {color = green} {color = green} m Node Node Time
  19. 19. Anatomy of a DDS Application Topic Topic Topic Samples Samples Instances Samples Instances Instances 1 1 21 62 21 62 1 1 22 62 22 62 1 1 23 63 23 63 DataReader DataReader 2 20 61 2 19 60 DataReader DataReader 2 20 61 2 19 60 DataWriter DataWriter DataReader DataReader 3 25 70 3 25 71 25 3 25 74 3 3 26 77 26 77 DataWriter DataWriter struct ShapeType { 3 25 70 3 25 71 25 3 25 74 long x; long y; long shapesize; string color; }; #pragma keylist ShapeType color Destructive/Non-Destructive Links can be paralleled with the DDS read/take semantics © 2009, PrismTech. All Rights Reserved
  20. 20. Content Filtering X0 X1 X0 <= X <= X1 ‣ DDS allows to specify content- filtered Topics for which a subset of SQL92 is used to express the filter condition Y0 ‣ Content filters can be applied on the entire content of the Topic Type Y0 <= Y <= Y1 ‣ Content filters are applied by DDS Y1 each time a new sample is produced/delivered © 2009, PrismTech. All Rights Reserved
  21. 21. Local Queries ‣ A subset of SQL92 can be used for performing queries X0 ‣ Queries are performed under Circle Topic user control and Y0 color x y shapesize Y0 provide a result that red 57 62 50 depends on the blue 90 85 50 Y0 <= Y <= Y1 current snapshot of yellow 30 25 50 the system, e.g., samples currently x > 25 AND y < 55 Y1 available color x y shapesize yellow 30 25 50 © 2009, PrismTech. All Rights Reserved
  22. 22. OpenSplice DDS Delivering Performance, Openness, and Freedom Deployment Model
  23. 23. AMQP v1-0 Deployment Model ‣ Nodes within the AMQP network exist within Containers ‣ A container is a physical or logical process to which network connections can be established [Source AMQP specification v1-0]
  24. 24. DDS Deployment Model ‣ DDS is based around the concept of a fully distributed Global Data Publisher Subscriber Space (GDS) Global Data Space ‣ Publishers and Subscribers can join and leave the GDS at any time Subscriber ‣ Publishers and Subscribers Publisher Brokers express their intent to produce/ consume specific type of data, e.g., Topics Subscriber ‣ Data flows from Publisher to Publisher Subscribers DDS © 2009, PrismTech. All Rights Reserved
  25. 25. Domains and Partitions Domain Domain ‣ A Domain is one instance of the DDS Global Data Space ‣ DDS entities always belong to a specific domain Partition ‣ A partition is a scoping mechanism provided by DDS organize a domain DDS Global Data Space Partition © 2009, PrismTech. All Rights Reserved
  26. 26. OpenSplice DDS Delivering Performance, Openness, and Freedom Communication Model
  27. 27. Sessions ‣ A Session is a named interaction [Source AMQP specification v1-0] between two containers providing for a pair of reliable ordered command streams (one in each direction) ‣ Links between nodes in different containers are created on a session ‣ Containers and Sessions form an underlay network, nodes and links an overlay network atop them
  28. 28. Sessions & Commands ‣ Sessions are a transport for commands ‣ Commands are the atomic units of work of the AMQP transport protocol Commands are used to create links between nodes in the source and destination containers, to transfer message data, and to issue and revoke credit ‣ In general an AMQP session will be carried over some form of network layer, thus commands sent on a session are asynchronous. [Source AMQP specification v1-0]
  29. 29. Transport Model m m Link m Node Node Links Links Session Session Links Links Session Transport Connection (TCP/IP) Session Links Links Session Session
  30. 30. Anatomy of a DDS Application Topic Topic Topic Samples Samples Instances Samples Instances Instances 1 1 21 62 21 62 1 1 22 62 22 62 1 1 23 63 23 63 DataReader DataReader 2 20 61 2 19 60 DataReader DataReader 2 20 61 2 19 60 DataWriter DataWriter DataReader DataReader 3 25 70 3 25 71 25 3 25 74 3 3 26 77 26 77 DataWriter DataWriter struct ShapeType { 3 25 70 3 25 71 25 3 25 74 long x; long y; long shapesize; string color; }; #pragma keylist ShapeType color © 2009, PrismTech. All Rights Reserved
  31. 31. Anatomy of a DDS Application Topic Topic Topic Samples Samples Instances Samples Instances Instances 1 1 21 62 21 62 1 1 22 62 22 62 1 1 23 63 23 63 DataReader DataReader 2 20 61 2 19 60 DataReader DataReader 2 20 61 2 19 60 DataWriter DataWriter DataReader DataReader 3 25 70 3 25 71 25 3 25 74 3 3 26 77 26 77 DataWriter DataWriter struct ShapeType { 3 25 70 3 25 71 25 3 25 74 long x; long y; Arrows long shapesize; string color; show }; #pragma keylist ShapeType color structural relationship s, not data- Subscriber Publisher flows Partition © 2009, PrismTech. All Rights Reserved
  32. 32. Anatomy of a DDS Application Topic Topic Topic Samples Samples Instances Samples Instances Instances 1 1 21 62 21 62 1 1 22 62 22 62 1 1 23 63 23 63 DataReader DataReader 2 20 61 2 19 60 DataReader DataReader 2 20 61 2 19 60 DataWriter DataWriter DataReader DataReader 3 25 70 3 25 71 25 3 25 74 3 3 26 77 26 77 DataWriter DataWriter struct ShapeType { 3 25 70 3 25 71 25 3 25 74 long x; long y; long shapesize; Arrows string color; }; show #pragma keylist ShapeType color structural relationship s, not data- Subscriber Publisher flows Partition Domain Participant Domain © 2009, PrismTech. All Rights Reserved
  33. 33. Transport Model Readers Writers Writers Subscriber Publisher Publisher Readers Readers Writers Writers Writers Writers Domain Subscriber Publisher Publisher Subscriber Publisher Publisher Participant Domain Domain Participant UDP (Unicast/MCast) Participant Domain Domain Participant Participant Subscriber Subscriber Subscriber Subscriber Publisher Publisher Readers Readers Readers Readers © 2009, PrismTech. All Rights Reserved Writers Writers
  34. 34. OpenSplice DDS Delivering Performance, Openness, and Freedom Type System
  35. 35. AMQP Type System ‣ AMQP defines a type-system that is used to encode messages and controls sent as part of the protocol ‣ This type system can be also used to encode application data [Source AMQP specification v1-0]
  36. 36. Primitive Types DDS Type System boolean long octet unsigned long char long long wchar unsigned long long ‣ DDS supports the definition of types based on a subset of short unsigned short float double the IDL specification language. long double ‣ This type system is used internally by DDS and is also Constructed Types Example available to user for defining topic types enum enum Dimension { 1D, 2D, 3D, 4D }; Template Type Example string<length = UNBOUNDED> string s1; string<32> s2; struct Coord1D { long x;}; struct Coord2D { long x; long y; }; wstring<length = UNBOUNDED> wstring ws1; struct struct Coord3D { long x; long y; long wstring<64> ws2; z; }; struct Coord4D { long x; long y; long z, unsigned long long t;}; sequence<T,length = UNBOUNDED> sequence<octet> oseq; sequence<octet, 1024> oseq1k; sequence<MyType> mtseq; union Coord switch (Dimension) { sequence<MyType, 10> mtseq10; case 1D: Coord1D c1d; case 2D: Coord2D c2d; union case 3D: Coord3D c3d; fixed<digits,scale> fixed<5,2> fp; //d1d2d3.d4d5 case 4D: Coord4D c4d; };
  37. 37. OpenSplice DDS Delivering Performance, Openness, and Freedom Putting it all Together
  38. 38. DDS AMQP ‣ A generic DDS application is a self-formed ‣ A generic AMQP application is a graph of federation reads and writes topics over the nodes connected by links over which travel Global Data Space application provided messages ‣ Communication is hidden to the applications ‣ The link-related traffic is managed by which is provided with a read/write sematics sessions which in turns communicate via a transport connection. ‣ UDP Unicast and Multicast are available for DDS v1.2, DDSI v2.1 ‣ The only transport currently available for AMQP v1-0 is TCP
  39. 39. AMQP v1-0 StatusDDS AMQP ‣ Addressing Scheme. Does not define a standard ‣ Data Centricity. DDS is about data and it is fair global addressing scheme, this will be part of v1-1 to say that data takes life in DDS, thanks to the ‣ Transport Protocol. Currently only supports support for keys, lifecycle management, etc. TCP, but UDP and SCTP will be added in future ‣ Transport Protocol. Currently supports UDP revisions of the spec (Unicast and Multicast). TCP will be supported in ‣ Broker Management. A SIG is working on upcoming revisions of the standard. However, defining an API for Broker Management, today, there is nothing that prevents DDS today to use each implementation has its own way TCP as a transport ‣ Topology Configuration. The Broker topology ‣ Topology Configuration. Topology is dynamically can be configured via management tools, yet the discovered by DDS via its standard discovery spec does not explicitly supports automatic protocol propagation of queue subscriptions (some product do)
  40. 40. OpenSplice DDS Delivering Performance, Openness, and Freedom Code Examples
  41. 41. Setting-up Subscriptions DDS AMQP std::string exchange = "amq.topic"; dds::Topic<Track> track("TrackTopic"); // Connect to the broker dds::Topic<TrackClass> track_class("TrackClassTopic"); Connection connection; connection.open(host, port); dds::DataReader<Track> tDR(track); dds::DataReader<TrackClass> tcDR(track_class); // Create a session Session session = connection.newSession(); // Decrlare a queue session.queueDeclare(arg::queue=queue, arg::exclusive=true, arg::autoDelete=true); struct Track { struct TrackClass { // Set-up routes short id; short id; session.exchangeBind(arg::exchange=exchange, long x; Classification cls; arg::queue="Track", long y; string descr; arg::bindingKey="Track.#"); }; }; session.exchangeBind(arg::exchange=exchange, #pragma keylist Track id #pragma keylist TrackClass id arg::queue="TrackClass", arg::bindingKey="TrackClass.#");
  42. 42. Writing Data DDS AMQP dds::DataWriter<Track> tDW(track); Track t = { 101, 140, 200 }; dds::DataWriter<TrackClass> tcDW(track_class); Message message; Track t = { 101, 140, 200 }; message.getDeliveryProperties().setRoutingKey("Track.Radar101"); tDW(t); std::stringstream message_data; TrackClass tc = { 101, FRIENDLY, “Some descr.”}; data << t.id << “ “ << t.x << “ “ << t.y; tcDW.write(tc); message.setData(message_data.str()); async(session).messageTransfer(arg::content=message, arg::destination="amq.topic");
  43. 43. Reading Data DDS AMQP std::vector<Track> data; void Listener::received(Message& message) { std::vector<SampleInfo> info; std::string data = message.getData(); Track t; tDR.read(data, info); // Parse the string to extract the data string_to_track(data, t); }
  44. 44. OpenSplice DDS Delivering Performance, Openness, and Freedom Summing Up
  45. 45. Concluding Remarks DDS AMQP ‣ DDS provides the abstraction of a Global ‣ AMQP is provides as basic abstraction that Data Space, a ubiquitous, universal and fully of messages and message routing. distributed data cache. ‣ AMQP standardized the wire-protocol and ‣ DDS makes user data a first class citizen uses this standard to achieve API ‣ DDS provides a standard API as well as an independence interoperable Wire-Protocol DDS and AMQP are very interesting technologies, which at some point might work in synergy. OpenSplice DDS could be using AMQP as one of its wire-protocols. The DDS API over AMQP could be standardize...
  46. 46. Online Resources http://www.opensplice.com/ http://www.slideshare.net/angelo.corsaro emailto:opensplicedds@prismtech.com http://bit.ly/1Sreg http://twitter.com/acorsaro/ http://opensplice.blogspot.com http://www.youtube.com/OpenSpliceTube © 2009, PrismTech. All Rights Reserved

×