In both cases (Lightstreamer and Pushlets) true push is used (not simulated push with hidden polling).
The first group of differences is in the scope of the server. Lightstremer Server has been conceived as a push engine aimed to stream real-time data in the most efficient, optimized and reliable way (whether the client is an html browser or a full-fledged thick application), taking into account important aspects such as security, authorization, manageability, integration. So on the server-side the following exclusive features apply:
1 – LS Server is implemented as a stand-alone process. It’s not a servlet or another kind of component running inside a web server or an app server. This approach was taken in order to have direct control over the operating system's TCP/IP stack. Instead of delegating the aggregation of data in packets to the operating system using the Nagle algorithm, Lightstreamer Server itself decides on each occasion the optimum composition of each TCP packet, with the objective/trade-off of reducing the delay time before data is sent off and at the same time minimizing the number of dispatched packets.
2 – LS Server features Bandwidth Control. For each user, Lightstreamer can allocate a maximum bandwidth that is dedicated to the streaming channel. For example, if it is required that a certain user cannot exceed a bandwidth of 10 kbps, Lightstreamer will filter the data in such a way as to ensure that the streaming connection with that user always remains below 10 kbps. The system is also able to allocate a maximum update frequency for each user/item combination. For example, it is possible to configure the profile of a certain user so that they do not receive more than 2 updates per second for a certain subscribed item (piece of data). Filtering the data makes sense not only to limit the bandwidth occupied by the streaming connection, but also to improve the quality of data usage on the part of the end user. The “human interface” can absorb data by a combination of the human eye and brain, which are incapable of perceiving data changes of more than a few updates per second. Sending 30 updates a second would be a waste of bandwidth and computing resources, as they could never be taken in by a human user. However, Lightstreamer can also feed automated (as opposed to human) processes. In this case, it is possible to bypass the filtering mechanisms.
Lightstreamer manages the filterable data feeds by means of a subscription mode called MERGE. However, there are data feeds that should not be filtered. Lightstreamer manages the non-filterable data feeds by means of a subscription mode called DISTINCT. Lightstreamer also offers another three methods of subscribing push data: RAW, COMMAND (that makes it possible to handle the so-called meta-push) and COMMAND-MATCH.
The advantages of bandwidth control are obvious, both for the server and for the client. For the server, bandwidth control makes it possible to size the Internet connection required simply and accurately. For the client, bandwidth control makes it possible to avoid saturating the bandwidth of the user's modem. Traditional push connections through narrow band equipment (e.g. analog modems or GSM/GPRS mobile networks) risk rapidly saturating the available bandwidth and blocking the user's access to other services. With Lightstreamer, 4 Kbps can be allocated to the push channel on a old GSM mobile phone, leaving about another 5 Kbps free to access other Internet services. In other words, bandwidth control allows partitioning of the client's bandwidth among various applications.
3 – LS Server features Adaptive Streaming. The ability to allocate a maximum bandwidth to each user may not be sufficient to ensure that the push connection is managed in the best way possible, cause of Internet congestions. The system has to be able to take into account exactly how much bandwidth is actually available at any moment in time. Lightstreamer automatically spots situations of congestion on the Internet, heuristically slowing down or suspending the dispatch of data until the connection is again fully serviceable. This means that if at any time the actual available bandwidth is less than the allocated and required bandwidth, Lightstreamer uses its own filtering mechanisms to modulate the transmission of data with a more suitable bandwidth. The advantage of this is that when the channel becomes available again, the user does not receive a burst of obsolete updates, but immediately starts to see the new data (in other words, data aging is avoided).
Adaptive streaming is particularly useful for connections that are notoriously unstable and variable, such as those on mobile networks. Let's assume that the user starts a push session on their GPRS smartphone (using one of the many mobile clients made for Lightstreamer). If at a certain point the GPRS signal deteriorates and the effective bandwidth narrows Lightstreamer Server detects what is happening and adapts the streaming in a dynamic way to the new network conditions, even going so far as to suspend the transmission of data in the event that no bandwidth is available at all.
4 – LS Server features very high performance. Instead of using one thread for each concurrent user, it is based on a staged event-driven architecture, that together with Java NIO libraries adoption, is able to handle very high low. The benchmarks have shown that many thousands of concurrent streaming connections can be sustained by each CPU of the server. Furthermore LS Server can scale very well, both by adding more CPUs in each box and by adding low-cost single-CPU boxes to the cluster. When the data feed produces very high-frequency updates, a multi-stage filtering algorithm is available in Lightstreamer Kernel.
5 – LS Server features a complete system for handling security, authentication, authorization. When a client (be it an HTML client or of any other nature) connects to LS Server, it sends its credentials, that are validated by LS Server against any back-end system through its Metadata Adapter. Then, each subscription request (with single-item granularity) must be authorized by the Metadata Adapter before it is honored by LS Server. The streaming channel can be based both on HTTP and HTTPS.
6 – LS Server is fully compliant with JMX (Java Management Extensions) specification. The server can be monitored and administered through any JMX-compliant console. Furthermore, a built-in Web console is provided that shows many indicators about LS Server in real-time (using LS itself to push the updates).
7 – LS Server can be integrated with any kind of data source and authentication system through an expandable and flexible system based on Adapters. Open Java API’s are provided to develop Data Adapters and Metadata Adapters. Each Lightstreamer Server instance can handle multiple Adapters.
About client-side technology, more differences with Pushlets arise:
1 – The HTML clients are only one family, though appealing, of the possible clients of Lightstreamer Server. A Java Client Library is provided to write thick Java clients. A DDE Gateway is also available to push the updates to Excel spreadsheets and other Windows applications. But in the next paragraphs we will focus on the Web client, to allow a comparison with Pushlets.
3 – Any existing Web front-end can be transformed into a Lightstreamer-compliant one by following some simple guidelines, whatever is the technology employed to produce the pages (JSP, PHP, ASP, etc.). The static part of the pages, the layout, the images and other resources keep on being hosted on the original Web server.
4 – Lightstreamer Web Client handles fail-over. If the Lightstreamer Server instance to which it is connected breaks down, it automatically reconnects to another instance and recovers the session, without the user doing anything.
5 – Lightstreamer Web Client never saturates the memory of the browser (a perpetual buffering of events would be lethal).
6 – Lightstreamer Web Client is able to update simultaneously the content of various frames and pop-up windows with only one single multiplexed HTTP connection. This way the browser’s connection pool never gets saturated,
7 – Lightstreamer Web Client permits the dynamic subscription and unsubscription of pushed items through control connections that don’t impact on the permanent stream connection.
For further details a White Paper is available at http://www.lightstreamer.com/download.htm