The Salesforce user interface must be automatically updated as a result of changes to Salesforce data.
Solution:
- Salesforce Streaming API (Best Solution):
This solution is composed of the following components:
- A PushTopic with a query definition that allows you to:
- Specify what events trigger an update
- Select what data to include in the notification
- A JavaScript-based implementation of the Bayeux protocol (currently CometD) that can be used by the user interface
- A Visualforce page or Lightning component
- A JavaScript library included as a static resource
This solution has the following limitations:
- Delivery of notifications isn’t guaranteed.
- Order of notifications isn’t guaranteed.
- Notifications aren’t generated from record changes made by Bulk API.
This solution has the following benefits:
- Eliminates the need for writing custom polling mechanisms
- Eliminates the need for a user-initiated feedback loop
For all Design Patterns, please refer this.