Understanding the Local Delivery Layer (LDL)
- Last UpdatedDec 01, 2022
- 2 minute read
Once connected to a PubSub Engine, subscribers can subscribe and publishers can publish using the Local Delivery Layer (LDL). This layer is based on the Transmission Control Protocol (TCP) communications protocol, which is a connection-oriented protocol with guaranteed message delivery and ordering.
Subscribers start by sending subscription requests to the PubSub Engine (as shown in the diagram below). Publishers publish data to the PubSub Engine. If the PubSub Engine has a subscriber for the published topic, it saves it into an internal cache and publishes it to all subscribed subscribers.
The following diagram outlines the LDL:

If a new subscription includes a request for an integrity update, the PubSub Engine checks the cache first to see if it already contains data for the topic. If found, the data is sent to the subscriber immediately. If not found, or if the subscription did not request an integrity update, the PubSub Engine does not send any data until the next time an update is published for the topic. This sequence of events is detailed in the following diagram.

Finally, when a subscriber unsubscribes from a topic, the PubSub Engine updates its list of subscriptions and verifies if there are any subscribers left. If there are none, the subscription is removed from the list and from the internal cache.