## 4 Introducing Samza  
Big Data streaming platforms that were included in the original RAM\({}^{3}\)S incarnation were Spark Streaming, Storm, and Flink [2]. To further expand features included in RAM\({}^{3}\)S, we considered to add Apache Samza to the supported streaming processing platforms. Apache Samza ([[https://samza.apache.org/](https://samza.apache.org/)]([https://samza.apache.org/](https://samza.apache.org/)), accessed on 3 December 2021) [14] is a distributed framework for stream processing originally developed by LinkedIn in 2013, which in 2014 became an Apache top-level project.  
The advantage introduced by Samza is the possibility of using a single callback-based API to describe the application logic independently of the data source, which can be both batch and streaming. Furthermore, the framework allows to process and to transform data obtained from various sources: Samza offers a built-in integration with Apache Kafka, AWS Kinesis, Apache Hadoop, Azure EventHubs, and ElasticSearch. Another point in favor of Samza is that it can be used as a normal library integrated into a Java/Scala project eliminating the need to use a separate cluster for stream processing: It becomes a real library embedded in the application. This mode of use is called stand-alone mode and allows one to have control over the entire life cycle of the application. The stand-alone mode also gives the possibility to increase the capacity of the application by creating multiple instances; all such instances will coordinate with each other to be able to equally balance the work: If an instance should fail for any reason, the task assigned to it would be reassigned to another instance. Coordination between the instances is carried out through Zookeeper but, since the coordination logic is pluggable, it can also be dealt with other frameworks.  
The other deployment mode supported by Samza is execution on Apache YARN: In this modality, a Samza application is sent to YARN to be then executed on its cluster. Thanks to this integration with YARN, isolation, multi-tenancy, resource management, and application deployment are provided; the number of containers needed, the number of cores, and the memory to be reserved for each container can also be specified. In addition, Samza works with YARN to provide the necessary resources for the application at hand and run it in a cluster of machines and to automatically restart failing application instances. When multiple applications share the same YARN cluster, they must be isolated from each other: Samza works with YARN to set CPU usage and memory occupation limits. As a result, any application that uses more than it is allowed is automatically terminated, conferring multi-tenancy on the system. Each deployment model brings its benefits in order to give flexibility in choosing which one to adopt.  
Finally, it is important to underline the at-least-once semantics adopted by Samza which ensures that every message coming from an input stream is processed at least once; this model ensures that no losses occur in the event of failures, making Samza a fault-tolerant choice for applications. Moreover, Samza is the only system that provides support for both deployment systems: Some systems, such as Kafka, only support the library model, while others, such as Flink or Spark streaming, only provide the framework model for stream processing.