The document discusses using Akka streams to access objects from Amazon S3. It describes modeling the data access as a stream with a source, flow, and sink. The source retrieves data from a SQL database, the flow serializes it, and the sink uploads the serialized data to S3 in multipart chunks. It also shows how to create a custom resource management sink and uses it to implement an S3 multipart upload sink.
This document summarizes using Akka streams to stream large database result sets to Amazon S3. The key points are:
- Akka streams can handle streaming large amounts of data without overloading memory by processing data in chunks.
- A stream consists of a source (database query), flow (serialization), and sink (S3 upload).
- The stream serializes database rows into bytes and uploads them to S3 in parallel chunks using S3's multipart upload API to avoid timeouts.
- Anorm provides an Akka stream source to query a database, and a custom S3 sink uploads chunks to S3 concurrently. Retries and error handling would be needed for production.
RxJava is a library for composing asynchronous and event-based programs using observable sequences. It provides APIs for asynchronous programming with observable streams and the ability to chain operations and transformations on these streams using reactive extensions. The basic building blocks are Observables, which emit items, and Subscribers, which consume those items. Operators allow filtering, transforming, and combining Observable streams. RxJava helps address problems with threading and asynchronous operations in Android by providing tools to manage execution contexts and avoid callback hell.
A practical guide to using RxJava on Android. Tips for improving your app architecture with reactive programming. What are the advantages and disadvantages of using RxJava over standard architecture? And how to connect with other popular Android libraries?
Presented at Droidcon Greece 2016.
This document introduces reactive programming and RxJS. It defines reactive systems as being responsive, resilient, elastic, and message-driven. Reactive programming uses asynchronous data streams and is more declarative, reusable, and testable. RxJS uses Observables to represent push-based collections of multiple values over time. Observables can be subscribed to and provide notifications for next events, errors, and completion. More than 120 operators allow manipulating Observable streams similarly to arrays. The document advocates for using RxJS to represent asynchronous data from various sources to build modern web applications in a reactive way.
Lecture on Reactive programming on Android, mDevCamp 2016.
A practical guide to using RxJava on Android. Tips for improving your app architecture with reactive programming. What are the advantages and disadvantages of using RxJava over standard architecture? And how to connect with other popular Android libraries?
Streaming all the things with akka streams Johan Andrén
This document provides an overview and introduction to Akka Streams and Reactive Streams. Some key points:
- Reactive Streams is a standard for asynchronous stream processing with non-blocking back pressure to prevent issues like out of memory errors.
- Akka Streams is a toolkit for building powerful concurrent and distributed applications simply using a Reactive Streams-compliant API. It includes sources, sinks, flows and other stages for stream processing.
- Examples show how to create simple stream graphs that process data asynchronously using Akka Streams APIs in both Java and Scala in just a few lines of code. More complex examples demonstrate features like parallelization.
- The community Alpakka
The document discusses using Akka streams to access objects from Amazon S3. It describes modeling the data access as a stream with a source, flow, and sink. The source retrieves data from a SQL database, the flow serializes it, and the sink uploads the serialized data to S3 in multipart chunks. It also shows how to create a custom resource management sink and uses it to implement an S3 multipart upload sink.
This document summarizes using Akka streams to stream large database result sets to Amazon S3. The key points are:
- Akka streams can handle streaming large amounts of data without overloading memory by processing data in chunks.
- A stream consists of a source (database query), flow (serialization), and sink (S3 upload).
- The stream serializes database rows into bytes and uploads them to S3 in parallel chunks using S3's multipart upload API to avoid timeouts.
- Anorm provides an Akka stream source to query a database, and a custom S3 sink uploads chunks to S3 concurrently. Retries and error handling would be needed for production.
RxJava is a library for composing asynchronous and event-based programs using observable sequences. It provides APIs for asynchronous programming with observable streams and the ability to chain operations and transformations on these streams using reactive extensions. The basic building blocks are Observables, which emit items, and Subscribers, which consume those items. Operators allow filtering, transforming, and combining Observable streams. RxJava helps address problems with threading and asynchronous operations in Android by providing tools to manage execution contexts and avoid callback hell.
A practical guide to using RxJava on Android. Tips for improving your app architecture with reactive programming. What are the advantages and disadvantages of using RxJava over standard architecture? And how to connect with other popular Android libraries?
Presented at Droidcon Greece 2016.
This document introduces reactive programming and RxJS. It defines reactive systems as being responsive, resilient, elastic, and message-driven. Reactive programming uses asynchronous data streams and is more declarative, reusable, and testable. RxJS uses Observables to represent push-based collections of multiple values over time. Observables can be subscribed to and provide notifications for next events, errors, and completion. More than 120 operators allow manipulating Observable streams similarly to arrays. The document advocates for using RxJS to represent asynchronous data from various sources to build modern web applications in a reactive way.
Lecture on Reactive programming on Android, mDevCamp 2016.
A practical guide to using RxJava on Android. Tips for improving your app architecture with reactive programming. What are the advantages and disadvantages of using RxJava over standard architecture? And how to connect with other popular Android libraries?
Streaming all the things with akka streams Johan Andrén
This document provides an overview and introduction to Akka Streams and Reactive Streams. Some key points:
- Reactive Streams is a standard for asynchronous stream processing with non-blocking back pressure to prevent issues like out of memory errors.
- Akka Streams is a toolkit for building powerful concurrent and distributed applications simply using a Reactive Streams-compliant API. It includes sources, sinks, flows and other stages for stream processing.
- Examples show how to create simple stream graphs that process data asynchronously using Akka Streams APIs in both Java and Scala in just a few lines of code. More complex examples demonstrate features like parallelization.
- The community Alpakka
ReactiveCocoa provides a common interface for handling asynchronous events from different sources like UI controls, network requests, and notifications. It uses signals that emit events to represent asynchronous data over time. Operations like filtering, mapping, and combining signals allow defining reactive workflows. Swift's support for functional programming makes it a good fit for the declarative style of ReactiveCocoa.
Intro to RxJava/RxAndroid - GDG Munich AndroidEgor Andreevich
This document introduces RxJava and RxAndroid. It explains that RxJava allows for composing asynchronous and event-based programs using observable sequences. It covers how to create Observables, subscribe to them, use operators to transform data, and handle threading. It also discusses how RxJava is useful for Android development by making asynchronous code easier to write, test, and handle threading, with libraries like RxAndroid, RxBinding, and RxLifecycle to integrate with Android components and lifecycles.
RxJs - demystified provides an overview of reactive programming and RxJs. The key points covered are:
- Reactive programming focuses on propagating changes without explicitly specifying how propagation happens.
- Observables are at the heart of RxJs and emit values in a push-based manner. Operators allow transforming, filtering, and combining observables.
- Common operators include map, filter, reduce, buffer, and switchMap. Over 120 operators exist for tasks like error handling, multicasting, and conditional logic.
- Marble diagrams visually demonstrate how operators transform observable streams.
- Creating observables from events, promises, arrays and iterables allows wrapping different data sources in a uniform API
A dive into akka streams: from the basics to a real-world scenarioGioia Ballin
Reactive streaming is becoming the best approach to handle data flows across asynchronous boundaries. Here, we present the implementation of a real-world application based on Akka Streams. After reviewing the basics, we will discuss the development of a data processing pipeline that collects real-time sensor data and sends it to a Kinesis stream. There are various possible point of failures in this architecture. What should happen when Kinesis is unavailable? If the data flow is not handled in the correct way, some information may get lost. Akka Streams are the tools that enabled us to build a reliable processing logic for the pipeline that avoids data losses and maximizes the robustness of the entire system.
This document provides an overview of Akka streams and Reactive Streams. It discusses how Akka streams allows for building asynchronous stream processing applications with back pressure. It provides examples of using Akka streams to process a large number of integers, build a numbers service, and compare different approaches for parallel pancake cooking using stream processing.
RxJS is a library for reactive programming that allows composing asynchronous and event-based programs using observable sequences. It provides the Observable type for pushing multiple values to observers over time asynchronously. Operators allow transforming and combining observables. Key types include Observable, Observer, Subject, BehaviorSubject, and ReplaySubject. Subjects can multicast values to multiple observers. Overall, RxJS is useful for handling asynchronous events as collections in a declarative way.
The document discusses moving a Slack commands application from a single Express app hosting all commands to individual serverless functions (Lambda) per command. It provides examples of the code structure for a sample "user stats" command function, how it is executed by AWS Lambda, and how CloudFormation templates are used to define and deploy the Lambda function and its resources to AWS.
Reactive streams processing using Akka StreamsJohan Andrén
This document provides a summary of a presentation about Akka streams. It discusses Reactive Streams, which is a standard for asynchronous stream processing with non-blocking back pressure. It provides examples of building stream processing graphs with Akka Streams in just a few lines of code to transform and process data from sources to sinks. It also gives a more complex example of processing sensor measurements from a web socket connection and writing the data to a database.
Swift.berlin, this time kindly hosted by Wooga, invited Crispy's own Christian Weyer to speak about whether Apple's new programming language Swift is ready for primetime use in corporate, production environments. In order to answer that question, Christian ported an existing OS X application to Swift and created a new iOS application from scratch. Watch the video to see his results and the conclusions he drew from these experiences.
Video available at https://vimeo.com/113089291
This document provides an overview of reactive applications in Java using Project Reactor. It discusses the challenges of modern applications and how reactive programming addresses these challenges through asynchronous, non-blocking architectures. It introduces key concepts of reactive programming like Flux, Mono, operators, and backpressure. It also covers Project Reactor specifics like threading model, debugging, testing and learning resources. The goal is to explain why reactive programming is useful and provide an introduction to building reactive applications in Java with Project Reactor.
The document provides an overview of RxJava and its advantages over traditional Java streams and callbacks. It discusses key RxJava concepts like Observables, Observers, and Subscriptions. It demonstrates how to create Observables, subscribe to them, and compose operations like filter, map, and zip. It shows how to leverage schedulers to control threading. The document also provides examples of using RxJava with HTTP requests and the Twitter API to asynchronously retrieve user profiles and tweets. It highlights scenarios where RxJava is useful, like handling asynchronous operations, and discusses some pitfalls like its learning curve and need to understand backpressure.
GPars howto - when to use which concurrency abstractionVaclav Pech
This document discusses parallelism and concurrency patterns in Groovy, including asynchronous calculations, parallel collections, actors, agents, dataflow, and CSP. It covers task parallelism, independent and dependent tasks, state sharing with agents, dataflow with promises and channels, geometric decomposition of data, and pipelined streaming of data. The goal is to demonstrate that parallelism in Groovy is not difficult using these patterns and the GPars library.
The document summarizes an agenda for a GPars workshop on parallel computing concepts including threads, agents, fork/join, parallel collections, dataflow, and actors. The workshop covers thread management and asynchronous invocation using thread pools, shared mutable state using agents, solving hierarchical problems using fork/join, processing parallel collections, composing asynchronous functions using dataflow, and communicating between isolated processes using actors.
This document provides an introduction to ReactiveCocoa, a framework for building reactive and functional iOS and macOS applications. It discusses key ReactiveCocoa concepts like signals, subscriptions, and operators. It also provides an example of how SmartThings adopted ReactiveCocoa to make their iOS app more reactive and functional. Key benefits included cleaner asynchronous code, easier adoption of MVVM, and ability to chain operations together.
The document discusses various approaches for leveraging parallelism and concurrency including multithreading, fork/join, actors, dataflow, and software transactional memory. It notes that while multithreading is challenging, other approaches like actors, dataflow, and STM can allow for writing concurrency-agnostic code. It promotes the GPars library for its implementations of various parallel and concurrent programming abstractions in Java and Groovy.
Reactive stream processing using Akka streams Johan Andrén
This document discusses Akka streams and Reactive Streams. It provides an example of creating an Akka streams application that exposes an HTTP service serving an infinite stream of numbers. The example demonstrates how Akka streams provides asynchronous stream processing with back pressure to prevent out of memory errors.
Pick up the low-hanging concurrency fruitVaclav Pech
The document discusses various approaches for dealing with concurrency and parallelism in programming. It highlights that while threads and locks make concurrency difficult, there are better solutions like fork/join pools, dataflow programming, and actors. These approaches allow programmers to write code without worrying about threads and synchronization, making parallelism easier to implement. The key milestone approaches mentioned are asynchronous calculations, parallel collection processing using fork/join, dataflow programming using variables and streams, and using actors to isolate concurrent operations.
Streaming Data Flow with Apache Flink @ Paris Flink Meetup 2015Till Rohrmann
Apache Flink is an open source platform for distributed stream and batch data processing. It provides APIs called DataStream for unbounded streaming data and DataSet for bounded batch data. Flink runs streaming topologies that allow for windowing, aggregation and other stream processing functions. It supports exactly-once processing semantics through distributed snapshots and checkpoints. The system is optimized for low latency and high throughput streaming applications.
Sharding and Load Balancing in Scala - Twitter's FinagleGeoff Ballinger
My presentation at Mostly Functional (http://mostlyfunctional.com), part of this year's Turing Festival Fringe (http://turingfestival.com) in Edinburgh. The example source code is up on Github at https://github.com/geoffballinger/simple-sharder
This document discusses using RxJava to handle asynchronous and concurrent processes. It provides an example of using RxJava to stream tweets from Twitter APIs, retrieve user profiles concurrently, and find the most popular tweet by a user. Key strengths of RxJava highlighted are that it is functional, reactive, allows controlling execution threads, and is easy to compose and integrate workflows. Some pitfalls mentioned are that the API is large, it can be hard to debug, and back pressure must be managed.
Big Data Analytics with Scala at SCALA.IO 2013Samir Bessalah
This document provides an overview of big data analytics with Scala, including common frameworks and techniques. It discusses Lambda architecture, MapReduce, word counting examples, Scalding for batch and streaming jobs, Apache Storm, Trident, SummingBird for unified batch and streaming, and Apache Spark for fast cluster computing with resilient distributed datasets. It also covers clustering with Mahout, streaming word counting, and analytics platforms that combine batch and stream processing.
This document discusses refactoring Java code to Clojure using macros. It provides examples of refactoring Java code that uses method chaining to equivalent Clojure code using the threading macros (->> and -<>). It also discusses other Clojure features like type hints, the doto macro, and polyglot projects using Leiningen.
ReactiveCocoa provides a common interface for handling asynchronous events from different sources like UI controls, network requests, and notifications. It uses signals that emit events to represent asynchronous data over time. Operations like filtering, mapping, and combining signals allow defining reactive workflows. Swift's support for functional programming makes it a good fit for the declarative style of ReactiveCocoa.
Intro to RxJava/RxAndroid - GDG Munich AndroidEgor Andreevich
This document introduces RxJava and RxAndroid. It explains that RxJava allows for composing asynchronous and event-based programs using observable sequences. It covers how to create Observables, subscribe to them, use operators to transform data, and handle threading. It also discusses how RxJava is useful for Android development by making asynchronous code easier to write, test, and handle threading, with libraries like RxAndroid, RxBinding, and RxLifecycle to integrate with Android components and lifecycles.
RxJs - demystified provides an overview of reactive programming and RxJs. The key points covered are:
- Reactive programming focuses on propagating changes without explicitly specifying how propagation happens.
- Observables are at the heart of RxJs and emit values in a push-based manner. Operators allow transforming, filtering, and combining observables.
- Common operators include map, filter, reduce, buffer, and switchMap. Over 120 operators exist for tasks like error handling, multicasting, and conditional logic.
- Marble diagrams visually demonstrate how operators transform observable streams.
- Creating observables from events, promises, arrays and iterables allows wrapping different data sources in a uniform API
A dive into akka streams: from the basics to a real-world scenarioGioia Ballin
Reactive streaming is becoming the best approach to handle data flows across asynchronous boundaries. Here, we present the implementation of a real-world application based on Akka Streams. After reviewing the basics, we will discuss the development of a data processing pipeline that collects real-time sensor data and sends it to a Kinesis stream. There are various possible point of failures in this architecture. What should happen when Kinesis is unavailable? If the data flow is not handled in the correct way, some information may get lost. Akka Streams are the tools that enabled us to build a reliable processing logic for the pipeline that avoids data losses and maximizes the robustness of the entire system.
This document provides an overview of Akka streams and Reactive Streams. It discusses how Akka streams allows for building asynchronous stream processing applications with back pressure. It provides examples of using Akka streams to process a large number of integers, build a numbers service, and compare different approaches for parallel pancake cooking using stream processing.
RxJS is a library for reactive programming that allows composing asynchronous and event-based programs using observable sequences. It provides the Observable type for pushing multiple values to observers over time asynchronously. Operators allow transforming and combining observables. Key types include Observable, Observer, Subject, BehaviorSubject, and ReplaySubject. Subjects can multicast values to multiple observers. Overall, RxJS is useful for handling asynchronous events as collections in a declarative way.
The document discusses moving a Slack commands application from a single Express app hosting all commands to individual serverless functions (Lambda) per command. It provides examples of the code structure for a sample "user stats" command function, how it is executed by AWS Lambda, and how CloudFormation templates are used to define and deploy the Lambda function and its resources to AWS.
Reactive streams processing using Akka StreamsJohan Andrén
This document provides a summary of a presentation about Akka streams. It discusses Reactive Streams, which is a standard for asynchronous stream processing with non-blocking back pressure. It provides examples of building stream processing graphs with Akka Streams in just a few lines of code to transform and process data from sources to sinks. It also gives a more complex example of processing sensor measurements from a web socket connection and writing the data to a database.
Swift.berlin, this time kindly hosted by Wooga, invited Crispy's own Christian Weyer to speak about whether Apple's new programming language Swift is ready for primetime use in corporate, production environments. In order to answer that question, Christian ported an existing OS X application to Swift and created a new iOS application from scratch. Watch the video to see his results and the conclusions he drew from these experiences.
Video available at https://vimeo.com/113089291
This document provides an overview of reactive applications in Java using Project Reactor. It discusses the challenges of modern applications and how reactive programming addresses these challenges through asynchronous, non-blocking architectures. It introduces key concepts of reactive programming like Flux, Mono, operators, and backpressure. It also covers Project Reactor specifics like threading model, debugging, testing and learning resources. The goal is to explain why reactive programming is useful and provide an introduction to building reactive applications in Java with Project Reactor.
The document provides an overview of RxJava and its advantages over traditional Java streams and callbacks. It discusses key RxJava concepts like Observables, Observers, and Subscriptions. It demonstrates how to create Observables, subscribe to them, and compose operations like filter, map, and zip. It shows how to leverage schedulers to control threading. The document also provides examples of using RxJava with HTTP requests and the Twitter API to asynchronously retrieve user profiles and tweets. It highlights scenarios where RxJava is useful, like handling asynchronous operations, and discusses some pitfalls like its learning curve and need to understand backpressure.
GPars howto - when to use which concurrency abstractionVaclav Pech
This document discusses parallelism and concurrency patterns in Groovy, including asynchronous calculations, parallel collections, actors, agents, dataflow, and CSP. It covers task parallelism, independent and dependent tasks, state sharing with agents, dataflow with promises and channels, geometric decomposition of data, and pipelined streaming of data. The goal is to demonstrate that parallelism in Groovy is not difficult using these patterns and the GPars library.
The document summarizes an agenda for a GPars workshop on parallel computing concepts including threads, agents, fork/join, parallel collections, dataflow, and actors. The workshop covers thread management and asynchronous invocation using thread pools, shared mutable state using agents, solving hierarchical problems using fork/join, processing parallel collections, composing asynchronous functions using dataflow, and communicating between isolated processes using actors.
This document provides an introduction to ReactiveCocoa, a framework for building reactive and functional iOS and macOS applications. It discusses key ReactiveCocoa concepts like signals, subscriptions, and operators. It also provides an example of how SmartThings adopted ReactiveCocoa to make their iOS app more reactive and functional. Key benefits included cleaner asynchronous code, easier adoption of MVVM, and ability to chain operations together.
The document discusses various approaches for leveraging parallelism and concurrency including multithreading, fork/join, actors, dataflow, and software transactional memory. It notes that while multithreading is challenging, other approaches like actors, dataflow, and STM can allow for writing concurrency-agnostic code. It promotes the GPars library for its implementations of various parallel and concurrent programming abstractions in Java and Groovy.
Reactive stream processing using Akka streams Johan Andrén
This document discusses Akka streams and Reactive Streams. It provides an example of creating an Akka streams application that exposes an HTTP service serving an infinite stream of numbers. The example demonstrates how Akka streams provides asynchronous stream processing with back pressure to prevent out of memory errors.
Pick up the low-hanging concurrency fruitVaclav Pech
The document discusses various approaches for dealing with concurrency and parallelism in programming. It highlights that while threads and locks make concurrency difficult, there are better solutions like fork/join pools, dataflow programming, and actors. These approaches allow programmers to write code without worrying about threads and synchronization, making parallelism easier to implement. The key milestone approaches mentioned are asynchronous calculations, parallel collection processing using fork/join, dataflow programming using variables and streams, and using actors to isolate concurrent operations.
Streaming Data Flow with Apache Flink @ Paris Flink Meetup 2015Till Rohrmann
Apache Flink is an open source platform for distributed stream and batch data processing. It provides APIs called DataStream for unbounded streaming data and DataSet for bounded batch data. Flink runs streaming topologies that allow for windowing, aggregation and other stream processing functions. It supports exactly-once processing semantics through distributed snapshots and checkpoints. The system is optimized for low latency and high throughput streaming applications.
Sharding and Load Balancing in Scala - Twitter's FinagleGeoff Ballinger
My presentation at Mostly Functional (http://mostlyfunctional.com), part of this year's Turing Festival Fringe (http://turingfestival.com) in Edinburgh. The example source code is up on Github at https://github.com/geoffballinger/simple-sharder
This document discusses using RxJava to handle asynchronous and concurrent processes. It provides an example of using RxJava to stream tweets from Twitter APIs, retrieve user profiles concurrently, and find the most popular tweet by a user. Key strengths of RxJava highlighted are that it is functional, reactive, allows controlling execution threads, and is easy to compose and integrate workflows. Some pitfalls mentioned are that the API is large, it can be hard to debug, and back pressure must be managed.
Big Data Analytics with Scala at SCALA.IO 2013Samir Bessalah
This document provides an overview of big data analytics with Scala, including common frameworks and techniques. It discusses Lambda architecture, MapReduce, word counting examples, Scalding for batch and streaming jobs, Apache Storm, Trident, SummingBird for unified batch and streaming, and Apache Spark for fast cluster computing with resilient distributed datasets. It also covers clustering with Mahout, streaming word counting, and analytics platforms that combine batch and stream processing.
This document discusses refactoring Java code to Clojure using macros. It provides examples of refactoring Java code that uses method chaining to equivalent Clojure code using the threading macros (->> and -<>). It also discusses other Clojure features like type hints, the doto macro, and polyglot projects using Leiningen.
This document provides an introduction and overview of FS2, a functional streaming library for Scala. It defines what a stream is, explains the difference between pull-based and push-based streams, and demonstrates various features of the FS2 API including working with pure and effectful streams, composing streams, zipping streams, and using streams to interact with external systems through eval and bracket patterns. It also introduces the Pull abstraction for processing stream chunks and provides examples of implementing a windowed aggregation operator using Pull. Finally, it outlines some areas to explore like covariance, concurrency and interoperability with other libraries.
This document discusses Akka Stream and CQRS using Akka Persistence. It provides an overview of Akka Stream concepts including sources, flows, sinks and materializers. It also discusses building complex graphs with GraphDSL and handling backpressure. For CQRS and event sourcing, it explains how Akka Persistence allows storing immutable events and replaying them to reconstruct state, separating the command and query responsibilities to improve scalability compared to shared databases. Journal and snapshot storage in databases like Cassandra are also summarized.
KSQL is a stream processing SQL engine, which allows stream processing on top of Apache Kafka. KSQL is based on Kafka Stream and provides capabilities for consuming messages from Kafka, analysing these messages in near-realtime with a SQL like language and produce results again to a Kafka topic. By that, no single line of Java code has to be written and you can reuse your SQL knowhow. This lowers the bar for starting with stream processing significantly.
KSQL offers powerful capabilities of stream processing, such as joins, aggregations, time windows and support for event time. In this talk I will present how KSQL integrates with the Kafka ecosystem and demonstrate how easy it is to implement a solution using KSQL for most part. This will be done in a live demo on a fictitious IoT sample.
FS2 (previously called Scalaz-Stream) is a library that facilitates purely functional API to encode stream processing in a modular and composable manner.
Due to its functional abstraction around "streams" of data, FS2 enables isolating and delaying the side-effects until the streams are fully composed and assembled into its final execution context.
The main objectives of this talk are to get started with FS2, particularly with its functional approach to stream processing, and to dive into details of its semantics.
The Ring programming language version 1.5 book - Part 8 of 31Mahmoud Samir Fayed
This document summarizes key classes and methods from the Ring web library (weblib.ring).
The Application class contains methods for encoding, decoding, cookies, and more. The Page class contains methods for generating common HTML elements and structures. Model classes like UsersModel manage data access and object relational mapping. Controller classes handle requests and coordinate the view and model.
Our product uses third generation Big Data technologies and Spark Structured Streaming to enable comprehensive Digital Transformation. It provides a unified streaming API that allows for continuous processing, interactive queries, joins with static data, continuous aggregations, stateful operations, and low latency. The presentation introduces Spark Structured Streaming's basic concepts including loading from stream sources like Kafka, writing to sinks, triggers, SQL integration, and mixing streaming with batch processing. It also covers continuous aggregations with windows, stateful operations with checkpointing, reading from and writing to Kafka, and benchmarks compared to other streaming frameworks.
The Ring programming language version 1.7 book - Part 48 of 196Mahmoud Samir Fayed
This document provides code examples and documentation for Ring's web library (weblib.ring). It describes classes and methods for generating HTML pages, forms, tables and other elements. This includes the Page class for adding common elements like text, headings, paragraphs etc., the Application class for handling requests, cookies and encoding, and classes representing various HTML elements like forms, inputs, images etc. It also provides an overview of how to create pages dynamically using View and Controller classes along with Model classes for database access.
ReactiveCocoa is an Objective-C framework that uses Functional Reactive Programming principles. It provides APIs for composing and transforming streams of values over time. ReactiveCocoa defines streams as RACSignals (push-based) or RACSequences (pull-based) that produce events. It includes operators to manipulate streams, like map, filter, and combineLatest. This allows declarative programming by linking UI behavior to continuously updating data streams.
This document provides an overview of coding in style with Scala. It discusses embracing expressions over statements, operator notation, using language features to simplify code, favoring higher-order functions, manipulating data with collections, working with asynchronous code and futures, macro programming to transform ASTs, and new features coming in Scala 2.11 like potential modularization and performance improvements. The document encourages idiomatic Scala techniques like favoring expressions, embracing operators, letting the language do work, aiming higher with higher-order functions, and embracing new language features.
Emerging Languages: A Tour of the HorizonAlex Payne
A tour of a number of new programming languages, organized by the job they're best suited for. Presented at Philadelphia Emerging Technology for the Enterprise 2012.
This document discusses LEGO as a framework for building distributed systems in Scala. It begins with the origins and principles of LEGO, then explores how Scala has been used in applications with LEGO. It concludes with some reflections on promoting LEGO.
Knoldus organized a Meetup on 1 April 2015. In this Meetup, we introduced Spark with Scala. Apache Spark is a fast and general engine for large-scale data processing. Spark is used at a wide range of organizations to process large datasets.
Streaming Infrastructure at Wise with Levani KokhreidzeHostedbyConfluent
Wise is a global financial institution that serves millions of customers across the globe. Hundreds of stateful stream processing applications power Wise's instant money movement. In this talk, we will discuss the technical details behind Wise's stream processing platform, such as security, how we run Apache Kafka brokers on Kubernetes, Kafka Streams applications deployment model with high availability, and different self-service tools we have developed for the product engineers for building and running stream processing applications. In addition, we will go over how we use Apache Kafka as a foundation for the Data Mesh.
VJUG24 - Reactive Integrations with Akka StreamsJohan Andrén
This document provides an overview of Akka Streams, which is a toolkit for building highly concurrent, distributed, and resilient message-driven applications on the JVM. It discusses key aspects of Akka Streams including asynchronous back pressured stream processing using sources, sinks, and processes; non-linear stream topologies; Reactive Streams compatibility; the Java and Scala APIs; materialization; integrations with HTTP and Alpakka community connectors for technologies like Kafka, MQTT, and Cassandra; and opportunities to contribute to Akka Streams.
Deep dive into internal of Fluentd1.2: trace it in the level of source code. Giving a brief introduction to Fluent Bit and compare its performance with Fluentd.
The material for SysML meetup at CyberAgent AdtechStudio.
A brief introduction to the concept of machine learning for ML beginners and the example of Airflow-based system architecture.
In the first half, we give an introduction to modern serialization systems, Protocol Buffers, Apache Thrift and Apache Avro. Which one does meet your needs?
In the second half, we show an example of data ingestion system architecture using Apache Avro.
Finch is a library for building Finagle services in a functional way using combinators. It allows defining HTTP endpoints and composing them in a declarative manner. Some key advantages of Finch include easy routing, built-in support for JSON serialization using Circe, and ability to separately define validation and error handling logic. Endpoints in Finch correspond to asynchronous functions that process requests and return responses. Multiple endpoints can be combined using operators like :+: to build up Finagle services.
Discover the latest insights on Data Driven Maintenance with our comprehensive webinar presentation. Learn about traditional maintenance challenges, the right approach to utilizing data, and the benefits of adopting a Data Driven Maintenance strategy. Explore real-world examples, industry best practices, and innovative solutions like FMECA and the D3M model. This presentation, led by expert Jules Oudmans, is essential for asset owners looking to optimize their maintenance processes and leverage digital technologies for improved efficiency and performance. Download now to stay ahead in the evolving maintenance landscape.
Introduction- e - waste – definition - sources of e-waste– hazardous substances in e-waste - effects of e-waste on environment and human health- need for e-waste management– e-waste handling rules - waste minimization techniques for managing e-waste – recycling of e-waste - disposal treatment methods of e- waste – mechanism of extraction of precious metal from leaching solution-global Scenario of E-waste – E-waste in India- case studies.
Null Bangalore | Pentesters Approach to AWS IAMDivyanshu
#Abstract:
- Learn more about the real-world methods for auditing AWS IAM (Identity and Access Management) as a pentester. So let us proceed with a brief discussion of IAM as well as some typical misconfigurations and their potential exploits in order to reinforce the understanding of IAM security best practices.
- Gain actionable insights into AWS IAM policies and roles, using hands on approach.
#Prerequisites:
- Basic understanding of AWS services and architecture
- Familiarity with cloud security concepts
- Experience using the AWS Management Console or AWS CLI.
- For hands on lab create account on [killercoda.com](https://killercoda.com/cloudsecurity-scenario/)
# Scenario Covered:
- Basics of IAM in AWS
- Implementing IAM Policies with Least Privilege to Manage S3 Bucket
- Objective: Create an S3 bucket with least privilege IAM policy and validate access.
- Steps:
- Create S3 bucket.
- Attach least privilege policy to IAM user.
- Validate access.
- Exploiting IAM PassRole Misconfiguration
-Allows a user to pass a specific IAM role to an AWS service (ec2), typically used for service access delegation. Then exploit PassRole Misconfiguration granting unauthorized access to sensitive resources.
- Objective: Demonstrate how a PassRole misconfiguration can grant unauthorized access.
- Steps:
- Allow user to pass IAM role to EC2.
- Exploit misconfiguration for unauthorized access.
- Access sensitive resources.
- Exploiting IAM AssumeRole Misconfiguration with Overly Permissive Role
- An overly permissive IAM role configuration can lead to privilege escalation by creating a role with administrative privileges and allow a user to assume this role.
- Objective: Show how overly permissive IAM roles can lead to privilege escalation.
- Steps:
- Create role with administrative privileges.
- Allow user to assume the role.
- Perform administrative actions.
- Differentiation between PassRole vs AssumeRole
Try at [killercoda.com](https://killercoda.com/cloudsecurity-scenario/)
Rainfall intensity duration frequency curve statistical analysis and modeling...bijceesjournal
Using data from 41 years in Patna’ India’ the study’s goal is to analyze the trends of how often it rains on a weekly, seasonal, and annual basis (1981−2020). First, utilizing the intensity-duration-frequency (IDF) curve and the relationship by statistically analyzing rainfall’ the historical rainfall data set for Patna’ India’ during a 41 year period (1981−2020), was evaluated for its quality. Changes in the hydrologic cycle as a result of increased greenhouse gas emissions are expected to induce variations in the intensity, length, and frequency of precipitation events. One strategy to lessen vulnerability is to quantify probable changes and adapt to them. Techniques such as log-normal, normal, and Gumbel are used (EV-I). Distributions were created with durations of 1, 2, 3, 6, and 24 h and return times of 2, 5, 10, 25, and 100 years. There were also mathematical correlations discovered between rainfall and recurrence interval.
Findings: Based on findings, the Gumbel approach produced the highest intensity values, whereas the other approaches produced values that were close to each other. The data indicates that 461.9 mm of rain fell during the monsoon season’s 301st week. However, it was found that the 29th week had the greatest average rainfall, 92.6 mm. With 952.6 mm on average, the monsoon season saw the highest rainfall. Calculations revealed that the yearly rainfall averaged 1171.1 mm. Using Weibull’s method, the study was subsequently expanded to examine rainfall distribution at different recurrence intervals of 2, 5, 10, and 25 years. Rainfall and recurrence interval mathematical correlations were also developed. Further regression analysis revealed that short wave irrigation, wind direction, wind speed, pressure, relative humidity, and temperature all had a substantial influence on rainfall.
Originality and value: The results of the rainfall IDF curves can provide useful information to policymakers in making appropriate decisions in managing and minimizing floods in the study area.
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...IJECEIAES
Medical image analysis has witnessed significant advancements with deep learning techniques. In the domain of brain tumor segmentation, the ability to
precisely delineate tumor boundaries from magnetic resonance imaging (MRI)
scans holds profound implications for diagnosis. This study presents an ensemble convolutional neural network (CNN) with transfer learning, integrating
the state-of-the-art Deeplabv3+ architecture with the ResNet18 backbone. The
model is rigorously trained and evaluated, exhibiting remarkable performance
metrics, including an impressive global accuracy of 99.286%, a high-class accuracy of 82.191%, a mean intersection over union (IoU) of 79.900%, a weighted
IoU of 98.620%, and a Boundary F1 (BF) score of 83.303%. Notably, a detailed comparative analysis with existing methods showcases the superiority of
our proposed model. These findings underscore the model’s competence in precise brain tumor localization, underscoring its potential to revolutionize medical
image analysis and enhance healthcare outcomes. This research paves the way
for future exploration and optimization of advanced CNN models in medical
imaging, emphasizing addressing false positives and resource efficiency.
Applications of artificial Intelligence in Mechanical Engineering.pdfAtif Razi
Historically, mechanical engineering has relied heavily on human expertise and empirical methods to solve complex problems. With the introduction of computer-aided design (CAD) and finite element analysis (FEA), the field took its first steps towards digitization. These tools allowed engineers to simulate and analyze mechanical systems with greater accuracy and efficiency. However, the sheer volume of data generated by modern engineering systems and the increasing complexity of these systems have necessitated more advanced analytical tools, paving the way for AI.
AI offers the capability to process vast amounts of data, identify patterns, and make predictions with a level of speed and accuracy unattainable by traditional methods. This has profound implications for mechanical engineering, enabling more efficient design processes, predictive maintenance strategies, and optimized manufacturing operations. AI-driven tools can learn from historical data, adapt to new information, and continuously improve their performance, making them invaluable in tackling the multifaceted challenges of modern mechanical engineering.
Embedded machine learning-based road conditions and driving behavior monitoringIJECEIAES
Car accident rates have increased in recent years, resulting in losses in human lives, properties, and other financial costs. An embedded machine learning-based system is developed to address this critical issue. The system can monitor road conditions, detect driving patterns, and identify aggressive driving behaviors. The system is based on neural networks trained on a comprehensive dataset of driving events, driving styles, and road conditions. The system effectively detects potential risks and helps mitigate the frequency and impact of accidents. The primary goal is to ensure the safety of drivers and vehicles. Collecting data involved gathering information on three key road events: normal street and normal drive, speed bumps, circular yellow speed bumps, and three aggressive driving actions: sudden start, sudden stop, and sudden entry. The gathered data is processed and analyzed using a machine learning system designed for limited power and memory devices. The developed system resulted in 91.9% accuracy, 93.6% precision, and 92% recall. The achieved inference time on an Arduino Nano 33 BLE Sense with a 32-bit CPU running at 64 MHz is 34 ms and requires 2.6 kB peak RAM and 139.9 kB program flash memory, making it suitable for resource-constrained embedded systems.
Comparative analysis between traditional aquaponics and reconstructed aquapon...bijceesjournal
The aquaponic system of planting is a method that does not require soil usage. It is a method that only needs water, fish, lava rocks (a substitute for soil), and plants. Aquaponic systems are sustainable and environmentally friendly. Its use not only helps to plant in small spaces but also helps reduce artificial chemical use and minimizes excess water use, as aquaponics consumes 90% less water than soil-based gardening. The study applied a descriptive and experimental design to assess and compare conventional and reconstructed aquaponic methods for reproducing tomatoes. The researchers created an observation checklist to determine the significant factors of the study. The study aims to determine the significant difference between traditional aquaponics and reconstructed aquaponics systems propagating tomatoes in terms of height, weight, girth, and number of fruits. The reconstructed aquaponics system’s higher growth yield results in a much more nourished crop than the traditional aquaponics system. It is superior in its number of fruits, height, weight, and girth measurement. Moreover, the reconstructed aquaponics system is proven to eliminate all the hindrances present in the traditional aquaponics system, which are overcrowding of fish, algae growth, pest problems, contaminated water, and dead fish.
5. The toolkit to process data streams on Akka actors
Describe processing pipeline as a graph
Easy to define complex pipeline
What is Akka Streams?
Source
Flow
SinkBroadcast
Flow
Merge
Input
Generating stream elements
Fetching stream elements from outside
Processing
Processing stream elements sent from
upstreams one by one
Output
To a File
To outer resources
6. Sample code!
implicit val system = ActorSystem()
implicit val dispatcher = system.dispatcher
implicit val mat = ActorMaterializer()
val s3Keys = List(“key1”, “key2”)
val sinkForeach = Sink.foreach(println)
val blueprint: RunnableGraph[Future[Done]] = RunnableGraph.fromGraph(GraphDSL.create(sinkForeach) {
implicit builder: GraphDSL.Builder[Future[Done]] =>
sink: Sink[String, Future[Done]]#Shape =>
import GraphDSL.Implicits._
val src = Source(s3Keys)
val flowA = Flow[String].map(key => s“s3://bucketA/$key”)
val flowB = Flow[String].map(key => s"s3://bucketB/$key")
val broadcast = builder.add(Broadcast[String](2))
val merge = builder.add(Merge[String](2))
src ~> broadcast ~> flowA ~> merge ~> sink
broadcast ~> flowB ~> merge
ClosedShape
})
blueprint.run() onComplete { _ =>
Await.ready(system.terminate(), 10 seconds)
}
// stream elements
// a sink that prints received stream elements
// a source send elements defined above
// a flow maps received element to the URL of Bucket A
// a flow maps received element to the URL of Bucket B
// a Junction that broadcasts received elements to 2 outlets
// a Junction that merge received elements from 2 inlets
// THIS IS GREAT FUNCTIONALITY OF GraphDSL
// easy to describe graph
// Run the graph!!!
// terminate actor system when the graph is completed
7. Easy to use without knowing the detail of Akka Actor
GOOD!
8. Akka Streams implicitly do everything
implicit val system = ActorSystem()
implicit val dispatcher = system.dispatcher
implicit val mat = ActorMaterializer()
val s3Keys = List(“key1”, “key2”)
val sinkForeach = Sink.foreach(println)
val blueprint: RunnableGraph[Future[Done]] = RunnableGraph.fromGraph(GraphDSL.create(sinkForeach) {
implicit builder: GraphDSL.Builder[Future[Done]] =>
sink: Sink[String, Future[Done]]#Shape =>
import GraphDSL.Implicits._
val src = Source(s3Keys)
val flowA = Flow[String].map(key => s“s3://bucketA/$key”)
val flowB = Flow[String].map(key => s"s3://bucketB/$key")
val broadcast = builder.add(Broadcast[String](2))
val merge = builder.add(Merge[String](2))
src ~> broadcast ~> flowA ~> merge ~> sink
broadcast ~> flowB ~> merge
ClosedShape
})
blueprint.run() onComplete { _ =>
Await.ready(system.terminate(), 10 seconds)
}
// dispatch threads to actors
// create actors
Materializer creates Akka Actors based on
the blueprint when called RunnableGraph#run
and processing is going!!!
9. Conclusion
Built a graph with
Source, Flow, Sink etc
Declare materializer with implicit
RunnableGraph ActorMaterializer Actors
Almost Automatically
working with actors!!!
10. Tips
implicit val system = ActorSystem()
implicit val dispatcher = system.dispatcher
implicit val mat = ActorMaterializer()
val s3Keys = List(“key1”, “key2”)
val sinkForeach = Sink.foreach(println)
val blueprint: RunnableGraph[Future[Done]] = RunnableGraph.fromGraph(GraphDSL.create(sinkForeach) {
implicit builder: GraphDSL.Builder[Future[Done]] =>
sink: Sink[String, Future[Done]]#Shape =>
import GraphDSL.Implicits._
val src = Source(s3Keys)
val flowA = Flow[String].map(key => s“s3://bucketA/$key”)
val flowB = Flow[String].map(key => s"s3://bucketB/$key")
val broadcast = builder.add(Broadcast[String](2))
val merge = builder.add(Merge[String](2))
src ~> broadcast ~> flowA ~> merge ~> sink
broadcast ~> flowB ~> merge
ClosedShape
})
blueprint.run() onComplete { _ =>
Await.ready(system.terminate(), 10 seconds)
}
To return MaterializedValue using GraphDSL, the graph
component that create MaterializedValue to return has to
be passed to GrapDSL#create. So it must be defined
outside GraphDSL builer… orz
Process will not be completed till
terminate ActorSystem
Don’t forget to terminate it!!!
If not define materialized value, blueprint does not
Return completion future…
12. Asynchronous message passing
Efficient use of CPU
Back pressure
Remarkable of Akka Streams are…
Source Sink
① Request a next element
② send a element
Upstreams send elements only when
received requests from downstream.
Down streams’ buffer will not overflow
13. What is GraphStage?
Source Sink
① Request a next element
Every Graph Component is
GraphStage!!
Not found in Akka streams standard library?
But want backpressure???
Implement custom GraphStages!!!
② send a element
14. SourceStage that emits Fibonacci
class FibonacciSource(to: Int) extends GraphStage[SourceShape[Int]] {
val out: Outlet[Int] = Outlet("Fibonacci.out")
override val shape = SourceShape(out)
override def createLogic(inheritedAttributes: Attributes): GraphStageLogic =
new GraphStageLogic(shape) {
var fn_2 = 0
var fn_1 = 0
var n = 0
setHandler(out, new OutHandler {
override def onPull(): Unit = {
val fn =
if (n == 0) 0
else if (n == 1) 1
else fn_2 + fn_1
if (fn >= to) completeStage()
else push(out, fn)
fn_2 = fn_1
fn_1 = fn
n += 1
}
})
}
}
Define a shape of Graph
SourceShape that has a outlet that emit int elements
// new instance is created every time
RunnableGraph#run is called
// terminate this stage with completion
// called when every time received a request
from downstream (backpressure)
So mutable state must be initizalized
within the GraphStageLogic
// send an element to the downstream
16. Connect S3 with Kafka
Docker Container
Direct connect
Put 2.5TB/day !!! Must be scalable
17. Our architecture
Direct connect
① Notify
Created Events
② Receive object
keys to ingest
…③ Download ④ Produce
Distribute object keys to containers
(Work as Load Balancer)
18. At least once
= Sometimes duplicate
Once an event is read, it becomes invisible and
basically any consumers does not receive
the same event until passed visibility timeout
Load Balancing
Elements are not deleted until sending Ack
It is retriable, by not sending Ack when a failure occurs
Amazon SQS
19. Alpakka (Implementation of GraphStages)
SQS Connector
• Read events from SQS
• Ack
S3 Connector
• Downloading content of a S3 object
Reactive Kafka
Produce content to Kafka
Various connector libraries!!
https://github.com/akka/alpakka/tree/master/sqs
https://github.com/akka/alpakka/tree/master/s3
https://github.com/akka/reactive-kafka
20. S3 → Kafka
val src: Source[ByteString, NotUsed] =
S3Client().download(bucket, key)
val decompress: Flow[ByteString, ByteString, NotUsed] =
Compression.gunzip()
val lineFraming: Flow[ByteString, ByteString, NotUsed] =
Framing.delimiter(delimiter = ByteString("n"),
maximumFrameLength = 65536, allowTruncation = false)
val sink: Sink[ProducerMessage.Message[Array[Byte], Array[Byte], Any], Future[Done]] =
Producer.plainSink(producerSettings)
val blueprint: RunnableGraph[Future[String]] = src
.via(decompress)
.via(lineFraming)
.via(Flow[ByteString]
.map(_.toArray)
.map { record => ProducerMessage.Message[Array[Byte], Array[Byte], Null](
new ProducerRecord[Array[Byte], Array[Byte]](conf.topic, record), null
)})
.toMat(sink)(Keep.right)
.mapMaterializedValue { done =>
done.map(_ => objectLocation)
}
// alpakka S3Connector
// a built-in flow to decompress gzipped content
// a built-in flow to divide file content into lines
// ReactiveKafka Producer Sink
// to return a future of completed object
key when called blueprint.run()
// convert binary to ProducerRecord of Kafka
21. Overall
implicit val mat: Materializer = ActorMaterializer(
ActorMaterializerSettings(system).withSupervisionStrategy( ex => ex match {
case ex: Throwable =>
system.log.error(ex, "an error occurs - skip and resume")
Supervision.Resume
})
)
val src = SqsSource(queueUrl)
val sink = SqsAckSink(queueUrl)
val blueprint: RunnableGraph[Future[Done]] =
src
.via(Flow[Message].map(parse)
.mapAsyncUnordered(concurrency) { case (msg, events) =>
Future.sequence(
events.collect {
case event: S3Created =>
S3KafkaGraph(event.location).run() map { completedLocation =>
s3.deleteObject(completedLocation.bucket, completedLocation.key)
}
}
) map (_ => msg -> Ack())
}
.toMat(sink)(Keep.right)
// alpakka SqsSource
// alpakka SqsAckSink
// Parse a SQS message to
keys of S3 object to consume
Run S3 -> Kafka graph
Delete success fully produced file
// Ack to a successfully handled message
Workaround for duplication in SQS, with supervision Resume,
app keeps going with ignoring failed message
(Such messages become visible after
visibility timeout but deleted after retention period)
22. Efficiency
Handle 3TB/day data with 24cores!!
Direct connect
① Notify
Created Events
② Receive object
locations to ingest
…③ Download ④ Produce
25. A sample code of GraphDSL (First example)
FibonacciSource
FlowStage with Buffer (Not in this slide)
gists
https://gist.github.com/Saint1991/d2737721551bc908f48b08e15f0b12d4
https://gist.github.com/Saint1991/2aa5841eea5669e8b86a5eb2df8ecb15
https://gist.github.com/Saint1991/29d097f83942d52b598cda20372ad671