These days, it’s hard to find someone who has never heard of streaming. The first memory that comes to mind for most people is platforms like Netflix and YouTube, which provide streaming services for entertainment, with videos and movies.
Important feature
An important feature of streaming is that information reaches us as it’s made available or created.
In the case of videos with streaming, we do not need to download the entire file to start watching, instead, data arrive little by little, maintaining the sequence of images and audio to have the continuous experience, without pauses.
If the video is an online broadcast, the complete data does not yet exist, and the data will be made available as soon as it is generated or captured in real-time. In the data stream with APIs, it’s the same logic.
In the integration processes that involve establishing connections with different entities, such as systems, suppliers, customers, people, and things, we mainly have three communication styles:
- File-driven (such as those based on file transfer and EDI — Electronic Data Interchange).
- Request-driven (like APIs, where the application that consumes data needs to request information and get responses).
- Event-driven (like API streaming, where the application waits for information from the server).
These three options address the vast majority of all the connections. In general, they are applied according to maturity issues, limitations, conformities, and business models.
Options
There are also some options to enable the data stream via a Web API, such as WebSocket’s and SSE (Server-Sent Events).
The SSE is an HTTP-based standard and standardized on HTML5 by the W3C, which describes how application servers can initiate data transmission to the client, such as Apps, for example. It is supported by several browsers and by several languages, SDKs and development, and programming frameworks.
To demonstrate streaming, we can use the Axway AMPLIFY Streams solution, which has important functions, such as SSE support to provide event-driven APIs; facilitators to make this process as simple and quick as possible (without the need to write any lines of code) and the ability to transform a traditional API into an event-driven API, where the client receives data events and updates.
Benefits of API streaming
Using the streaming API has several benefits, such as a considerable reduction in data traffic, since only new data are proactively sent (there is no need for push/pull actions to obtain it).
With the reduction of traffic, the consumption of infrastructure resources is also reduced. Another advantage is that the customer proactively receives data, in real-time, without having to request it.
It is important to note that the benefits only exist when the streaming API is used in a scenario that takes advantage of the events.
For cases in which there is a large amount of information, which does not change frequently, or where all information is modified in each request, the best option may be file-driven based on files.
In scenarios where there is a transactional need for information that is not repeated, a request-driven model is the most appropriate. And, finally, in scenarios where information changes frequently, we can use event-driven.
The application of streaming for businesses is relevant to various situations where information is updated frequently, and the customer experience is significantly influenced by the productivity of information.
As in cases of financial data that vary frequently (statements, balances, quotes, rankings, and scores), time-varying logistics and supply chain data (inventory data and supply positions), in industry 4.0 with device and sensor monitoring, and healthcare data related to real-time patient health monitoring.
Finally, the customer experience can benefit from real-time information in any business situation.
Event-driven vs REST API interactions. Learn why Event-Driven APIs matter.
Follow us on social