Data Delivery Methods
Last updated
Last updated
UDF delivers data through two models, the pull and push models.
The Push Model is ideal for applications that require continuous, real-time data updates, such as financial platforms, trading apps, or systems where frequent and reliable updates are crucial. It automatically pushes data at regular intervals, ensuring that the latest information is always available.
On the other hand, the Pull Model is best suited for applications where data is needed on-demand, such as gaming or DeFi protocols. In the Pull Model, data is retrieved only when a user initiates a transaction, offering greater control over when data is fetched and reducing unnecessary updates.
The Push Model comes with higher gas costs because it requires regular updates, even when the data has not changed. This can lead to escalating expenses as the frequency of updates increases.
In contrast, the Pull Model is more cost-effective as data is only delivered when explicitly requested, minimizing unnecessary transactions and gas fees. However, if there is a high volume of user-triggered data requests, the Pull Model's costs can still rise, especially if data retrieval becomes frequent.
The Push Model ensures that data updates are available in real-time, with minimal delay, making it ideal for applications that need constant and immediate access to the latest information. It is particularly useful for time-sensitive applications where immediate data updates are crucial, such as trading platforms or live dashboards.
The Pull Model, however, may introduce some latency since data is only fetched when needed, depending on transaction confirmation times and network conditions. While it is generally fast, it is better suited for applications where real-time updates are not as critical.
The Push Model is highly scalable for applications that need continuous, frequent updates across multiple platforms. However, the frequency of updates can result in high gas usage, which might pose scalability challenges in cost-sensitive environments.
In comparison, the Pull Model scales efficiently in scenarios where data requests are less frequent, as it reduces redundant updates and keeps gas costs low. It is well-suited for applications with low-to-medium transaction volumes, but could face scalability issues if there is a high number of users making frequent requests.
In certain applications, a hybrid approach combining both the Push and Pull models can offer the best of both worlds, providing flexibility and optimizing both cost and data freshness. A hybrid model is particularly useful when an application needs to balance continuous data updates with on-demand data retrieval, depending on the specific use case.
Using a hybrid approach allows developers to tailor data flow to the needs of the application, offering more precise control over both the cost of data updates and the freshness of information available to users. It ensures that critical, real-time data is always accessible while minimizing the cost and redundancy of data retrieval for less time-sensitive queries.
For example, in DeFi platforms, the Push Model could be used to continuously update critical data such as asset prices or interest rates, ensuring that liquidity pools and trading algorithms always have access to the most recent information. However, the Pull Model could be used for less frequent, but highly specific data requests, such as querying a particular user’s transaction history or fetching data for a one-off contract execution. This approach reduces the overall gas costs associated with the Push Model while maintaining real-time data for essential operations.