Force.com 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.
Latest posts by Gopal Das (see all)
- Salesforce Certified Platform Developer I – Winter ’18 Release Exam - November 23, 2017
- Salesforce Certified Platform App Builder – Winter ’18 Release Exam - November 22, 2017
- Salesforce Certified Administrator – Winter’ 18 Release Exam - November 21, 2017