Streaming API Overview Streaming API uses publish/subscribe model for data transfer, where salesforce admin creates one or more topics, each of which is associated with a SOQL query. Applications may subscribe to one or more topics, using the Bayeux protocol. CometD implements the Bayeux protocol. Client applications must provide a session ID (sid) in all interactions.


As relevant data is updated, the platform re-evaluates the query and, when a change occurs that alters the results of the query, the platform publishes a notification to subscribed applications.

The Bayeux protocol and CometD both use long polling.

Bayeux is a protocol for transporting asynchronous messages, primarily over HTTP.
CometD is a scalable HTTP-based event routing bus that uses an AJAX push technology pattern known as Comet. It implements the Bayeux protocol.

Streaming API vs. REST API

They both were designed for different use cases. The Streaming API is used to run uninterrupted, capturing everything from a continuous stream of data in real time. REST API is used to take a number of requests to perform a number of tasks, like getting weather report data, costing streams, and taking smaller samples of streams.

Gopal Das
Follow me

Gopal Das

Founder at GopalDas.Org
He is a technology evangelist, Salesforce trainer, blogger, and working as a Salesforce Technical Lead. After working in Java based project implementation, he jumped to the Salesforce system on a whim and never looked back. He fell in love with Salesforce’s flexibility, scalability, and power. He expanded his knowledge of the platform and became a Certified App Builder, Administrator, Platform Developer I, SalesCloud Consultant while leading the Salesforce implementation and technology needs. He has worked in a wide variety of applications/services like desktop, web and mobile applications.
Gopal Das
Follow me

Leave a Reply

Your email address will not be published. Required fields are marked *