Understanding Strategies for Synchronizing Data
While a deep dive into integration strategies is beyond this course's scope, understanding the key differences between event-driven and scheduled approaches is crucial. Choosing the right approach significantly impacts the efficiency, reliability, and responsiveness of interconnected systems.
Event-Driven Approach
An event-driven approach facilitates immediate communication between systems whenever a relevant event occurs. For example, when a new distributor is verified in Liferay, an event-driven integration might automatically send the distributor's data to an external CRM to create a corresponding account. Similarly, when a user submits a support ticket in Liferay, this could trigger an API call to create a corresponding ticket in a third-party system. This approach is ideal for time-sensitive processes where minimizing latency and ensuring real-time synchronization are paramount.
Scheduled Approach
Conversely, a scheduled approach involves periodic data synchronization at fixed intervals. This method works well for scenarios where real-time updates are unnecessary or impractical due to performance or resource constraints. Batch processing or scheduled jobs typically handle bulk data transfers, ensuring consistency while minimizing API calls. For example, a scheduled job syncs customer account balances from a financial system to a reporting dashboard at the end of each business day. This enables accurate reporting without straining resources during peak hours.
Key Considerations
When choosing between an event-driven and a scheduled approach, consider these factors to ensure your integration strategy aligns with your needs and priorities:
-
Time Sensitivity: Use event-driven integrations for time-sensitive processes, such as order confirmations, real-time inventory updates, or workflows based on user actions.
-
Data Volume and Latency: Use a scheduled approach when dealing with large datasets, scenarios where latency is acceptable, or when the source system lacks real-time triggers.
-
Resource Consumption: Be aware that event-driven approaches may consume more resources due to continuous monitoring and real-time processing. This can increase system overhead, especially if events are frequent or if multiple integrations are active simultaneously.
-
Increased Latency: Generally, scheduled approaches are less resource-intensive but can introduce latency, as updates are delayed until the next synchronization cycle.
Using an Event-Driven Approach with Objects
In enterprise applications, synchronizing data between Liferay objects and external systems is common. Leveraging object actions, you can implement an event-driven approach for real-time synchronization with external systems. Object actions can run automatically in response to object entry events. For example, when a user creates a ticket entry, Liferay can trigger an action that sends the data to an external system's API endpoint. This enables real-time data exchange and ensures consistency between Liferay and the external system.
Using a Scheduled Approach with Objects
An alternative to event-driven synchronization is scheduling activities to perform inbound and outbound communication using batch client extensions. These extensions work with Liferay's batch engine framework to exchange data entities with Liferay. This type of asynchronous communication has many uses, including
-
Synchronizing data between Liferay instances.
-
Injecting data from or into a CRM, ERP, or any other third-party system.
-
Initializing site content.
Client extensions run outside of Liferay and integrate with objects, enabling you to use your preferred programming language or technology. You can export any type of data supported by Liferay's batch engine framework, including object and workflow definitions. Once the *.batch-engine-data.json
file is added to a batch client extension, deploy the generated archive to your Liferay environment. See Importing/Exporting Data for more information.
Conclusion
By understanding the strengths and limitations of each synchronization approach, you can choose the most effective approach for your business needs while balancing system efficiency, responsiveness, and resource usage. Using Liferay’s object actions and batch engine, you can synchronize data seamlessly and automate processes based on your specific business requirements. Next, you’ll review what you’ve learned before taking this course’s badge exam!
Capabilities
Product
Education
Contact Us