The latest buzzword in the web service community is “reactive.” We dig beneath the surface of this word and show how you can use Scala and Akka to build systems that are responsive, resilient, elastic, and message-driven.
The document discusses the Play Framework, a web framework for Java and Scala. It introduces Play and outlines why it is useful, how to install it, and how to structure a new Play application. It then discusses moving a Play application to Google Cloud Platform for scalability. Key points are that Play provides predictable scalability, is developer friendly, and has a large ecosystem. The document recommends using Play Framework with Google Cloud Platform to achieve scalability without having to manage servers directly.
The document discusses the need for reactive and functional programming approaches to build scalable applications that can take advantage of many-core processors and distributed systems. It introduces key concepts like immutability, functions, and declarative programming. Specific frameworks like Scala, Play and Akka are presented as tools that support this reactive, functional style for building web applications that can horizontally scale across multiple cores and nodes. The talk promotes adopting these approaches to build systems that can better handle concurrency, distribution and failure.
Over the past few years, web-applications have started to play an increasingly important role in our lives. We expect them to be always available and the data to be always fresh. This shift into the realm of real-time data processing is now transitioning to physical devices, and Gartner predicts that the Internet of Things will grow to an installed base of 26 billion units by 2020. Reactive web-applications are an answer to the new requirements of high-availability and resource efficiency brought by this rapid evolution. On the JVM, a set of new languages and tools has emerged that enable the development of entirely asynchronous request and data handling pipelines. At the same time, container-less application frameworks are gaining increasing popularity over traditional deployment mechanisms. This talk is going to give you an introduction into one of the most trending reactive web-application stack on the JVM, involving the Scala programming language, the concurrency toolkit Akka and the web-application framework Play. It will show you how functional programming techniques enable asynchronous programming, and how those technologies help to build robust and resilient web-applications.
This document discusses the development of a single-page web application for a student markbook using Akka actors and HTTP. Key points discussed include: - Using multiple Akka actors to retrieve student, schedule, subject and mark data from various data services. - A worker actor that processes the retrieved data and returns student week marks. - A REST API with routes to get lists of students and individual student week marks. - The application server is initialized by binding the API routes to an HTTP server.
"It’s open source. It’s highly opinionated. Build greenfield microservices and decompose your Java EE monolith like a boss." Lightbend (formerly Typesafe) has come up with their own framework, Lagom, for architecting microservices based systems. With Lagom, Lightbend wants to take up the competition with the Spring Cloud stack. Lagom is built upon Akka and Play and focuses on reactive and message-driven APIs, distributed persistence with Event Sourcing and CQRS and high developer productivity. On the 10th of March a first MVP version has been released with a Java API, the Scala API is being worked on. This workshop acts as an introduction to Lagom during which we will have a look at developing and deploying Lagom microservices. As a warm-up, you could check out the newest blogpost on the JWorks Tech Blog: https://ordina-jworks.github.io/microservices/2016/04/22/Lagom-First-Impressions-and-Initial-Comparison-to-Spring-Cloud.html. Github repo with presentation: https://github.com/yannickdeturck/lagom-shop Blogpost Lagom: First Impressions and Initial Comparison to Spring Cloud: https://ordina-jworks.github.io/microservices/2016/04/22/Lagom-First-Impressions-and-Initial-Comparison-to-Spring-Cloud.html Podcast Lightbend Podcast Ep. 09: Andreas Evers test drives Lagom in comparison with Spring Cloud: https://www.lightbend.com/blog/lightbend-podcast-ep-09-andreas-evers-test-drives-lagom-in-comparison-with-spring-cloud
This document discusses different approaches to dependency injection in Scala, especially for use with Play!. It evaluates Spring, Spring-Scala, CDI, Guice, SubCut and Cake based on criteria like idiomatic Scala usage, testing support, and fit with Play!. Spring-Scala is recommended for projects that need to integrate Java and Scala code. Guice and Cake are recommended for standalone Scala projects. Cake provides additional type safety while Guice and Cake are good options for Play! projects.
This document provides an overview and introduction to Akka HTTP, a Scala library built on Akka Streams for HTTP-based applications. Some key points: - Akka HTTP uses Akka Streams to model HTTP requests and responses as streaming data flows. - It allows building both HTTP clients and servers by composing stream processing stages together. - Common directives and operations like routing, marshalling, validation, and testing are supported through a high-level API. - Examples demonstrate basic usage like creating a route that returns XML, running a server, and writing tests against routes.
Web pages can get very complex and slow. In this talk, I share how we solve some of these problems at LinkedIn by leveraging composition and streaming in the Play Framework. This was my keynote for Ping Conference 2014 ( http://www.ping-conf.com/ ): the video is on ustream ( http://www.ustream.tv/recorded/42801129 ) and the sample code is on github ( https://github.com/brikis98/ping-play ).
This document provides an overview of Akka HTTP, a library for building HTTP-based services using Scala and Akka. It describes the common abstractions used in Akka HTTP like HTTP requests, responses, entities, and marshalling/unmarshalling. It also explains the low-level and high-level APIs, with the low-level API providing basic request handling functionality and the high-level API using directives and routing DSL for defining routes in a more flexible way.
Presentation from XI Tricity Scala User Group. Features Akka HTTP - its architecture & model, best practices and some remarks about usage.
Going down the microservices route makes a lot of things around creating and maintaining large systems easier but it comes at a cost too, particularly associated with challenges around security. While securing monolithic applications was a relatively well understood area, the same can't be said about microservice based architectures. This presentation covers how implementing microservices affects the security of distributed systems, outlines pros and cons of several standards and common practices and offers practical suggestions for securing microservice based systems using Play and Akka HTTP.
Akka Streams & HTTP provides reactive, asynchronous, and non-blocking streams for processing data and HTTP requests and responses. It builds upon Akka IO and the Reactive Streams initiative to allow stream-based topologies to be declared and run for tasks like processing big data, serving clients simultaneously with limited resources, and building distributed applications that integrate with external systems over HTTP. Key features include stream sources, sinks, and transformations along with a routing DSL for building HTTP servers and clients on top of Akka IO and HTTP Core.
Akka HTTP is a toolkit for building scalable REST services in Scala. It provides a high-level API built on top of Akka actors and Akka streams for writing asynchronous, non-blocking and resilient microservices. The document discusses Akka HTTP's architecture, routing DSL, directives, testing, additional features like file uploads and websockets. It also compares Akka HTTP to other Scala frameworks and outlines pros and cons of using Akka HTTP for building REST APIs.
Dan Persa, Senior Software Engineer at Zalando Dan Persa has been a software engineer at Zalando since 2013 and is a member of the Fashion Store team, which is responsible for Zalando’s core ecommerce business. He loves Java and Scala and more recently has been exploring Go and Node.js. He’s a big fan of Clean Code and Software Craftsmanship. In addition to coding, he enjoys mentoring new developers, organizing coder dojos and reading groups and giving tech talks. In his free time he likes to take photos and dance salsa. tech.zalando.com
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.
The document discusses Scala and functional programming concepts. It provides examples of building a chat application in 30 lines of code using Lift, defining messages as case classes, and implementing a chat server and comet component. It then summarizes that Scala is a pragmatically-oriented, statically typed language that runs on the JVM and provides a unique blend of object-oriented and functional programming. Traits allow for code reuse and multiple class inheritances. Functional programming concepts like immutable data structures, higher-order functions, and for-comprehensions are discussed.
The document discusses Scala and functional programming concepts. It provides examples of building a chat application in 30 lines of code using Lift, defining messages as case classes, and implementing a chat server and comet component. It then summarizes that Scala is a pragmatically-oriented, statically typed language that runs on the JVM and provides a unique blend of object-oriented and functional programming. Traits allow for static and dynamic mixin-based composition. Functional programming concepts like immutable data structures, higher-order functions, and for-comprehensions are discussed.
The document discusses Scala and functional programming concepts. It provides examples of building a chat application in 30 lines of code using Lift, defining case classes and actors for messages. It summarizes that Scala is a pragmatically oriented, statically typed language that runs on the JVM and has a unique blend of object-oriented and functional programming. Functional programming concepts like immutable data structures, functions as first-class values, and for-comprehensions are demonstrated with examples in Scala.
This document discusses Scala and its features. It provides an example of building a chat application in 30 lines of code using Lift framework. It also demonstrates pattern matching, functional data structures like lists and tuples, for comprehensions, and common Scala tools and frameworks. The document promotes Scala as a pragmatic and scalable language that blends object-oriented and functional programming. It encourages learning more about Scala.
The document discusses various message-based communication patterns in Akka distributed applications, including tell, ask, pipeTo, and composing futures. It provides code examples of actor implementations demonstrating these patterns and how to handle responses, failures, timeouts, and combining multiple futures. The tell pattern is fire-and-forget messaging. The ask pattern uses a future to represent a possible response. PipeTo pipes a future to the original sender. Examples show how to handle successful, failed, and delayed futures through composing and combining them.
This document discusses asynchronous and synchronous programming in Java. It covers several key aspects: 1. Java supports both multi-threading for synchronous programming as well as asynchronous programming using non-blocking I/O and libraries like RxJava. 2. Asynchronous programming can be difficult due to issues like complex error handling, lack of readability, and difficulty debugging. 3. Many open-source libraries have been created to help with asynchronous programming using approaches like futures, callbacks, and promises. 4. Reactive programming libraries like RxJava, Reactor, and Vert.x use approaches like asynchronous streams to simplify asynchronous code.
Akka provides tools for building concurrent, scalable and fault-tolerant systems using the actor model. The key tools provided by Akka include actors for concurrency, agents for shared state, dispatchers for work distribution, and supervision hierarchies for fault handling. Akka actors simplify concurrency through message passing and isolation, and provide tools for scaling and distributing actors across nodes for increased throughput and fault tolerance.
This document provides an overview of the Scala programming language, including what it is, its toolchain, basic syntax examples comparing it to Java, built-in support for XML, actors, and advantages and disadvantages. Scala is an object-functional language that runs on the JVM and is intended to be a "better Java". It has features like XML support, an actor model for concurrency, and combines object-oriented and functional programming paradigms, but its ecosystem and compiler can be slow and syntax for some functional features is verbose.
The document discusses reactive application patterns and principles. It describes how Akka actors can be used to build message-driven, resilient, elastic, and responsive applications. It provides an example of using Play, Akka Cluster Sharding to build a reactive user management system that is horizontally scalable and always available.
Presentation by Akara Sucharitakul about "Asynchronous Orchestration DSL on squbs" at Scala Bay Meetup
Purely functional Scala code needs something like Haskell's IO monad—a construct that allows functional programs to interact with external, effectful systems in a referentially transparent way. To date, most effect systems for Scala have fallen into one of two categories: pure, but slow or inexpressive; or fast and expressive, but impure and unprincipled. In this talk, John A. De Goes, the architect of Scalaz 8’s new effect system, introduces a novel solution that’s up to 100x faster than Future and Cats Effect, in a principled, modular design that ships with all the powerful primitives necessary for building complex, real-world, high-performance, concurrent functional programs. Thanks to built-in concurrency, high performance, lawful semantics, and rich expressivity, Scalaz 8's effect system may just be the effect system to attract the mainstream Scala developers who aren't familiar with functional programming.
The document provides an overview of concurrency constructs and models. It discusses threads and locks, and some of the problems with locks like manually locking/unlocking and lock ordering issues. It then covers theoretical models like actors, CSP, and dataflow. Implementation details and problems with different models are discussed. Finally, it highlights some open problems and areas for further work.
Scala is a multi-paradigm programming language that runs on the Java Virtual Machine. It is both object-oriented and functional, with support for immutable data and concise syntax. Scala has gained popularity due to its advantages like type safety, concurrency support, and interoperability with Java. However, some of Scala's advanced features can be difficult to read and use for beginners, and tooling support is not as robust as Java. Overall, Scala represents a promising approach that prioritizes simplicity over ease of use.
This document introduces higher order functions (HOFs) in Scala. It provides examples of how HOFs such as map and filter can transform collections in more idiomatic and functional ways compared to imperative approaches using loops. Key benefits of HOFs include producing immutable and thread-safe results without needing to manually manage intermediate data structures. The document also briefly outlines some other powerful HOFs like reduce, partition, min, max and parallel collections.
In this presentation, John A. De Goes looks at several concurrency and scalability problems similar to the ones all programmers have to face, and shows how purely functional solutions written using Scalaz 8 are shorter, faster, easier to test, and easier to understand than competing solutions written using Akka actors. Discover how functional programming can be your secret superpower when it comes to quickly building bullet-proof business applications!