Jayant Jindal
Fremont, CA Salesforce User Group Lead
https://www.linkedin.com/in/jayantjindal
@jayantjindal
Streaming API
This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the
assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we
make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber
growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any
statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services.
The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new
products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays
in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the
immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth,
new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger
enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form
10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important
disclosures are available on the SEC Filings section of the Investor Information section of our Web site.
Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be
delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available.
Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.
Forward-Looking Statement
Statement under the Private Securities Litigation Reform Act of 1995
• Check-In : 5 min.
• Streaming API: 40 min.
• Icebreaker : 5 min.
• Networking Reception: 10 min.
Agenda
What is the Streaming API
Technology Behind it
Underlying Mechanisms
How is the connection negotiated & maintained
Four Streaming APIs
Streaming API
• A Single Technology
• Pub/sub, event-driven architecture
• PUSH technology with replay capability.
• Event-driven systems streamline the communication between distributed
enterprise systems, increase scalability, and deliver real-time data
• Use Cases
• System integrators
• Devices
• Real time apps
Difference between Streaming APIs
Platform Events and Change Data Capture
Platform Event – Sequence
EMP API Lightning Component
Hands-On
CDC-When to Use
• Receive notifications of Salesforce record changes, including create, update, delete, and
undelete operations.
• Capture all field changes for all records.
• Perform data updates using transaction boundaries when more than one operation is part of
the same transaction
• Subscribe to mass changes in a scalable way.
• Get access to retained events for up to 3 days
Hands-On – Use Cases
• UC would like to send notifications to their external recruiters whenever a position is open and
has the status high or critical.
What’s New in Summer ’19/Winter ’20
Platform Events & CDC – Summer 19
• Summer 19
• lightning-emp-api LWC
• Platform Events
• Publisher behavior (immediately or after commit)
• Resume checkpoint for process events in triggers
• Asynchronous process events publish error notifications (Beta)
• CDC
• Triggers
• Custom CDC <group> channels
• Standard CDC events
Platform Events & CDC – Winter 20
• Platform Events
• Receive Relevant Event Messages Using Event Filters with a CometD. E.g.:
/event/Low_Ink__e?Model_Number__c='XZO-5'&&Ink_Percentage__c=0.2
• Monitor Platform Event Publishing Usage in REST API
• HourlyPublishedPlatformEvents—High-volume platform event notifications
published per hour
• HourlyPublishedStandardVolumePlatformEvents—Standard-volume platform
event notifications published per hour
• Platform events provide a form of reliable messaging. Salesforce pushes the event to
the subscribers. If the message doesn’t get picked up by the subscriber, the
subscriber may choose to replay the messages using the replay ID of previously
received events.
• Configure Streaming API Settings with Metadata API
• Use the new EventSettings Metadata API type to configure Streaming API
settings, such as enabling Streaming API and dynamic generic event channel
creation. Also, you can configure settings related to Event Monitoring and Platform
Events
Platform Events & CDC – Winter 20
• CDC
• Migrate Change Data Capture Channels and Members with Metadata API and Tooling
API
• Enrich Change Event Messages with Fields That Are Always Included
• Determine Which Fields Changed with the New changedFields Header Field
• Receive notifications of record changes for the AuthorizationFormConsent,
ContentPointTypeConsent, and Individual objects.
Icebreaker
1. What is the Change data capture event name for
direct database changes ?
2. What is the Change data capture event name for
more than 100k changes ?
References
• Appexchange Tool: Streaming Monitor:
https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FYEEWUA5
• https://www.youtube.com/watch?v=iFBATeMo2Es
• https://trailhead.salesforce.com/en/content/learn/projects/workshop-platform-
events/platform-event-define
• https://developer.salesforce.com/events/webinars/change-data-capture
• https://developer.salesforce.com/docs/component-
library/bundle/lightning:empApi/documentation
• https://developer.salesforce.com/blogs/2018/07/which-streaming-event-do-i-use.html
REFERENCES
Q/A
Salesforce Fremont, CA User Group

Salesforce Streaming Api

  • 1.
    Jayant Jindal Fremont, CASalesforce User Group Lead https://www.linkedin.com/in/jayantjindal @jayantjindal Streaming API
  • 2.
    This presentation maycontain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site. Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements. Forward-Looking Statement Statement under the Private Securities Litigation Reform Act of 1995
  • 3.
    • Check-In :5 min. • Streaming API: 40 min. • Icebreaker : 5 min. • Networking Reception: 10 min. Agenda
  • 4.
    What is theStreaming API
  • 5.
  • 6.
  • 7.
    How is theconnection negotiated & maintained
  • 8.
  • 9.
    Streaming API • ASingle Technology • Pub/sub, event-driven architecture • PUSH technology with replay capability. • Event-driven systems streamline the communication between distributed enterprise systems, increase scalability, and deliver real-time data • Use Cases • System integrators • Devices • Real time apps
  • 10.
  • 11.
    Platform Events andChange Data Capture
  • 12.
  • 13.
  • 14.
  • 15.
    CDC-When to Use •Receive notifications of Salesforce record changes, including create, update, delete, and undelete operations. • Capture all field changes for all records. • Perform data updates using transaction boundaries when more than one operation is part of the same transaction • Subscribe to mass changes in a scalable way. • Get access to retained events for up to 3 days
  • 16.
    Hands-On – UseCases • UC would like to send notifications to their external recruiters whenever a position is open and has the status high or critical.
  • 17.
    What’s New inSummer ’19/Winter ’20
  • 18.
    Platform Events &CDC – Summer 19 • Summer 19 • lightning-emp-api LWC • Platform Events • Publisher behavior (immediately or after commit) • Resume checkpoint for process events in triggers • Asynchronous process events publish error notifications (Beta) • CDC • Triggers • Custom CDC <group> channels • Standard CDC events
  • 19.
    Platform Events &CDC – Winter 20 • Platform Events • Receive Relevant Event Messages Using Event Filters with a CometD. E.g.: /event/Low_Ink__e?Model_Number__c='XZO-5'&&Ink_Percentage__c=0.2 • Monitor Platform Event Publishing Usage in REST API • HourlyPublishedPlatformEvents—High-volume platform event notifications published per hour • HourlyPublishedStandardVolumePlatformEvents—Standard-volume platform event notifications published per hour • Platform events provide a form of reliable messaging. Salesforce pushes the event to the subscribers. If the message doesn’t get picked up by the subscriber, the subscriber may choose to replay the messages using the replay ID of previously received events. • Configure Streaming API Settings with Metadata API • Use the new EventSettings Metadata API type to configure Streaming API settings, such as enabling Streaming API and dynamic generic event channel creation. Also, you can configure settings related to Event Monitoring and Platform Events
  • 20.
    Platform Events &CDC – Winter 20 • CDC • Migrate Change Data Capture Channels and Members with Metadata API and Tooling API • Enrich Change Event Messages with Fields That Are Always Included • Determine Which Fields Changed with the New changedFields Header Field • Receive notifications of record changes for the AuthorizationFormConsent, ContentPointTypeConsent, and Individual objects.
  • 21.
  • 22.
    1. What isthe Change data capture event name for direct database changes ? 2. What is the Change data capture event name for more than 100k changes ?
  • 23.
  • 24.
    • Appexchange Tool:Streaming Monitor: https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FYEEWUA5 • https://www.youtube.com/watch?v=iFBATeMo2Es • https://trailhead.salesforce.com/en/content/learn/projects/workshop-platform- events/platform-event-define • https://developer.salesforce.com/events/webinars/change-data-capture • https://developer.salesforce.com/docs/component- library/bundle/lightning:empApi/documentation • https://developer.salesforce.com/blogs/2018/07/which-streaming-event-do-i-use.html REFERENCES
  • 25.
  • 26.

Editor's Notes

  • #10 PUSH technology - Not saved in database.
  • #11 CDC: Happens outside of transaction i.e. 2nd option to do operation post 1st time on object; To enable more entities, contact Salesforce to purchase an add-on license; Delivered events contain only the fields that a subscribed user is allowed to view. Returned schema (Metadata) includes all object fields, even the fields that the user doesn’t have access to. Gap Events: Some operations are applied directly in the database, outside of a transaction in the Salesforce application servers. For example, archiving of activities or a data cleanup job in the database overflow event: is generated when a single transaction contains more than 100,000 changes. An overflow event contains only header fields. PushTopic: Structured data, Generic: Unstructured, P.E.: Structured data
  • #17 CDC: Configure a Create Records element to create an instance of the platform event
  • #19 Custom CDC <group> channels – account, contact and opportunities channel grouping Standard CDC events - Contract, Campaign