Salesforce offers two variants of the Streaming API – PushTopic and Generic.
In Summer '17 (v40.0) Platform Events are now also Generally Available (GA).
How do they differ and why would you use one over the other?
Salesforce offers two variants of the Streaming API – PushTopic and Generic.
In Summer '17 (v40.0) Platform Events are now also Generally Available (GA).
How do they differ and why would you use one over the other?
Best Answer
Very generally, the Streaming API was created primarily to update UI components(Source) where as Platform Events are for integrations via a Message Bus.
With a PushTopic from the Streaming API you are limited to receiving events notifications when the configured query and event occur. There is no capacity to manually generate these events beyond causing the criteria required by the query and event.
Generic Streaming via the Streaming API is similar to Push Topics but is not bound to specific changes to Salesforce data. Instead you control when to publish an event. The trade off is that the payload of the event is a 3000 character string rather than a defined structure like that of a PushTopic.
Platform Events provide the defined notification structure of a PushTopic with a more flexible model than Generic Streaming for raising and subscribing to the events. They can be published and subscribed to via Apex in addition to the APIs.
As Mohith commented, there are differences with the limits between Platform Events and the Streaming API.
E.g.
UE: 100 EE: 50 All other editions: 40
UE: 1,000 EE: 1,000 PE: 1,000 Free: 200
UE: 100 EE: 50 All other editions: 5
Another interesting difference is that PushTopics are limited to 2,000 clients/subscribers across all topics for Unlimited Edition orgs. Where as for the Generic Streaming that limit is 2,000 clients/subscribers per generic streaming channel. Platform events don't currently have a documented limit on subscribers.
From What Is the Difference Between the Salesforce Events?