SlideShare una empresa de Scribd logo
1 de 39
www.luxoft.com
Reactive Applications in Java with Akka
by Orkhan Gasimov
www.luxoft.com
About author
Orkhan Gasimov
Software Developer
 Over 13 years in software development field
 Participated in full-cycle application development, leading development
groups with hands-on experience in a variety of programming languages
and technologies including solution design and architecture
 Applied practical usage of Java, C#, C/C++, Perl, PHP, JavaScript and
other programming languages. Designed desktop, mobile and web
applications from consumer products to N-tier systems
www.luxoft.com
Evolution of the Programming Model
www.luxoft.com
Scaling up Scaling out
• More price with each step
• Greater risk of hardware failure
causing bigger outages
• Limited upgradeability in the
future
• One unit for everything
• Much cheaper than scaling
vertically
• Easier to run fault-tolerance
• Easy to upgrade
• Parallel units enable parallel
execution
Scaling
www.luxoft.com
Reactive Applications in Java with Akka
 Reactive Manifesto
 Actor Model
 Load Balancing & Scaling
 Other Features & Available Modules
www.luxoft.com
www.luxoft.com
Reactive Manifesto
 Application requirements have changed dramatically in recent years
 A few years ago a large application had
- tens of servers
- seconds of response time
- hours of offline maintenance
- gigabytes of data
 Today
- applications are deployed on everything from mobile devices to cloud-based clusters
- users expect millisecond response times and 100% uptime
- data is measured in Petabytes
www.luxoft.com
Reactive Manifesto
 Today's demands are simply not met by yesterday’s software architectures
 A coherent approach to systems architecture is needed
 All necessary aspects are already recognized individually
 We want systems that are
- Responsive
- Resilient
- Elastic
- Message Driven
 We call these Reactive Systems
www.luxoft.com
Reactive Manifesto
 Responsive: The system responds in a timely manner if at all possible. Responsiveness
means that problems may be detected quickly and dealt with effectively.
 Resilient: The system stays responsive in the face of failure. Any system that is not
resilient will be unresponsive after a failure.
 Elastic: The system stays responsive under varying workload. Reactive Systems can
react to changes in the input rate by increasing or decreasing the resources allocated to
service these inputs.
 Message Driven: Reactive Systems rely on asynchronous message-passing to establish a
boundary between components that ensures loose coupling, isolation and location
transparency. This boundary also provides the means to delegate failures as messages.
www.luxoft.com
Reactive Manifesto
 Large systems are composed of smaller ones and therefore depend on the Reactive
properties of their constituents. This means that Reactive Systems apply design principles
so these properties apply at all levels of scale, making them composable.
www.luxoft.com
www.luxoft.com
www.luxoft.com
Akka vs JavaEE
 No application server is required
 Vanilla JVM and core Java is enough
 JVMs can be stacked up to a Cluster
 Akka offers Actor Model instead of Object Oriented Model
- Actors are workers
- Objects are objects
 Actors are parallelized by default
www.luxoft.com
Concepts
 Let’s review some base concepts before the deep dive
www.luxoft.com
Concurrency vs Parallelism
www.luxoft.com
Concurrency vs Parallelism
www.luxoft.com
Asynchronous vs Synchronous
www.luxoft.com
Blocking vs Non-blocking
www.luxoft.com
Deadlock
www.luxoft.com
Starvation
www.luxoft.com
Live-lock
www.luxoft.com
Race Condition
www.luxoft.com
Progress Condition
 We want so called Progress Condition. These are actual non-
blocking guarantees.
 We want applications to behave
- Parallel
- Asynchronous
- Non-blocking
- Without deadlocks, starvation and live-locks
- Without race conditions
www.luxoft.com
Akka
 What is Akka?
 What does Akka bring?
www.luxoft.com
Actor Model
 An actor is a computational entity that, in response to a message it receives, can
concurrently:
- send a finite number of messages to other actors;
- create a finite number of new actors;
- designate the behavior to be used for the next message it receives.
 There is no assumed sequence to the above actions. They could be parallel!
 The Actor Model philosophy says ”everything is an actor”.
 This is similar to the ”everything is an object” philosophy, but object-oriented
software is typically executed sequentially, while the Actor Model is inherently
concurrent.
www.luxoft.com
www.luxoft.com
Actor Model
 Actors are objects which encapsulate state and behavior
 They communicate exclusively by exchanging messages which are placed
into the recipient’s mailbox
 View them as persons
 While modeling a solution with actors
- envision a group of people and assign sub-tasks to them,
- arrange their functions into an organizational structure
- and think about how to escalate failure
www.luxoft.com
Actor System
 Actors come in systems and never alone
 Actors form hierarchies
 Actor can start child actors and supervise them
 Splitting tasks brings in smaller and more manageable tasks
www.luxoft.com
Actor Systems as a single Cluster
www.luxoft.com
Error Kernel Pattern
www.luxoft.com
Let It Crash
www.luxoft.com
API is very easy
 Create the ActorSystem
 Actor is a class extending UntypedActor and overriding onReceive
method
 Use ActorSystem::actorOf method to create actors
- Each actor can create child actor using getContext().actorOf method
 To send a message to Actor ActorRef::tell method is used
- you should have ActorRef (actor reference) which you will get on actor
creation or you can lookup/search for it by path
www.luxoft.com
Load Balancing & Scaling
 Dispatchers
 Mailboxes
 Routers
www.luxoft.com
Dispatchers
www.luxoft.com
Dispatchers
www.luxoft.com
Mailboxes
 Akka comes shipped with a number of mailbox implementations
- Unbounded (default)
- Bounded
- [U/B] Non-Blocking
- [U/B] Priority
- [U/B] Stable Priority (FIFO)
- [U/B] Control Aware
- Unbounded Single Consumer Only
www.luxoft.com
Routers
www.luxoft.com
Other Features & Available Modules
 Futures – functional promises that are used to retrieve the result of some concurrent operation
 Agents – provide asynchronous change of individual locations
 Remote – enable remote actor messaging between actor systems over the network
 Cluster – turn actor systems into a single cluster over the network
 I/O – module carries API for the implementation of network protocols and building higher
abstractions
 Camel – actors can now exchange messages with other systems over large number of protocols
& APIs such as HTTP, SOAP, TCP, FTP, SMTP or JMS, to mention a few
 Streams – stream processing API
 HTTP – a full server- and client-side HTTP stack on top of akka-actor and akka-stream. It's not a
web-framework but rather a more general toolkit for providing and consuming HTTP-based
services.
www.luxoft.com
R e a c t i v e
Thank You!

Más contenido relacionado

Similar a Орхан Гасимов: "Reactive Applications in Java with Akka"

Build Cloud Applications with Akka and Heroku
Build Cloud Applications with Akka and HerokuBuild Cloud Applications with Akka and Heroku
Build Cloud Applications with Akka and HerokuSalesforce Developers
 
Scaling software with akka
Scaling software with akkaScaling software with akka
Scaling software with akkascalaconfjp
 
Reactive programming with scala and akka
Reactive programming with scala and akkaReactive programming with scala and akka
Reactive programming with scala and akkaKnoldus Inc.
 
Guide to Spring Reactive Programming using WebFlux
Guide to Spring Reactive Programming using WebFluxGuide to Spring Reactive Programming using WebFlux
Guide to Spring Reactive Programming using WebFluxInexture Solutions
 
Reactive java programming for the impatient
Reactive java programming for the impatientReactive java programming for the impatient
Reactive java programming for the impatientGrant Steinfeld
 
The macro of microservices
The macro of microservicesThe macro of microservices
The macro of microservicesSoftware Guru
 
Sigmoid akka stream
Sigmoid akka streamSigmoid akka stream
Sigmoid akka streamSigmoid
 
Reactive Architecture
Reactive ArchitectureReactive Architecture
Reactive ArchitectureKnoldus Inc.
 
Magento Developer Talk. Microservice Architecture and Actor Model
Magento Developer Talk. Microservice Architecture and Actor ModelMagento Developer Talk. Microservice Architecture and Actor Model
Magento Developer Talk. Microservice Architecture and Actor ModelIgor Miniailo
 
Building Reactive applications with Akka
Building Reactive applications with AkkaBuilding Reactive applications with Akka
Building Reactive applications with AkkaKnoldus Inc.
 
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...MSDEVMTL
 
Sperasoft Talks: RxJava Functional Reactive Programming on Android
Sperasoft Talks: RxJava Functional Reactive Programming on AndroidSperasoft Talks: RxJava Functional Reactive Programming on Android
Sperasoft Talks: RxJava Functional Reactive Programming on AndroidSperasoft
 
Akka.Net - Implementing distributed systems with Akka.net and .Net Core
Akka.Net - Implementing distributed systems with Akka.net and .Net CoreAkka.Net - Implementing distributed systems with Akka.net and .Net Core
Akka.Net - Implementing distributed systems with Akka.net and .Net CoreAlexandre Brandão Lustosa
 
Reactive: Programming -> Systems -> Architecture
Reactive: Programming -> Systems -> ArchitectureReactive: Programming -> Systems -> Architecture
Reactive: Programming -> Systems -> ArchitectureAleksey Izmailov
 
CQRS Evolved - CQRS + Akka.NET
CQRS Evolved - CQRS + Akka.NETCQRS Evolved - CQRS + Akka.NET
CQRS Evolved - CQRS + Akka.NETDavid Hoerster
 
Moving towards Reactive Programming
Moving towards Reactive ProgrammingMoving towards Reactive Programming
Moving towards Reactive ProgrammingDeepak Shevani
 
Akka.Net and .Net Core - The Developer Conference 2018 Florianopolis
Akka.Net and .Net Core - The Developer Conference 2018 FlorianopolisAkka.Net and .Net Core - The Developer Conference 2018 Florianopolis
Akka.Net and .Net Core - The Developer Conference 2018 FlorianopolisAlexandre Brandão Lustosa
 
Oop2011 actor presentation_stal
Oop2011 actor presentation_stalOop2011 actor presentation_stal
Oop2011 actor presentation_stalMichael Stal
 

Similar a Орхан Гасимов: "Reactive Applications in Java with Akka" (20)

Build Cloud Applications with Akka and Heroku
Build Cloud Applications with Akka and HerokuBuild Cloud Applications with Akka and Heroku
Build Cloud Applications with Akka and Heroku
 
Scaling software with akka
Scaling software with akkaScaling software with akka
Scaling software with akka
 
Reactive programming with scala and akka
Reactive programming with scala and akkaReactive programming with scala and akka
Reactive programming with scala and akka
 
Guide to Spring Reactive Programming using WebFlux
Guide to Spring Reactive Programming using WebFluxGuide to Spring Reactive Programming using WebFlux
Guide to Spring Reactive Programming using WebFlux
 
Reactive java programming for the impatient
Reactive java programming for the impatientReactive java programming for the impatient
Reactive java programming for the impatient
 
The macro of microservices
The macro of microservicesThe macro of microservices
The macro of microservices
 
Sigmoid akka stream
Sigmoid akka streamSigmoid akka stream
Sigmoid akka stream
 
Akka.Net & .Net Core - .Net Inside 4° MeetUp
Akka.Net & .Net Core - .Net Inside 4° MeetUpAkka.Net & .Net Core - .Net Inside 4° MeetUp
Akka.Net & .Net Core - .Net Inside 4° MeetUp
 
Akka (1)
Akka (1)Akka (1)
Akka (1)
 
Reactive Architecture
Reactive ArchitectureReactive Architecture
Reactive Architecture
 
Magento Developer Talk. Microservice Architecture and Actor Model
Magento Developer Talk. Microservice Architecture and Actor ModelMagento Developer Talk. Microservice Architecture and Actor Model
Magento Developer Talk. Microservice Architecture and Actor Model
 
Building Reactive applications with Akka
Building Reactive applications with AkkaBuilding Reactive applications with Akka
Building Reactive applications with Akka
 
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...
 
Sperasoft Talks: RxJava Functional Reactive Programming on Android
Sperasoft Talks: RxJava Functional Reactive Programming on AndroidSperasoft Talks: RxJava Functional Reactive Programming on Android
Sperasoft Talks: RxJava Functional Reactive Programming on Android
 
Akka.Net - Implementing distributed systems with Akka.net and .Net Core
Akka.Net - Implementing distributed systems with Akka.net and .Net CoreAkka.Net - Implementing distributed systems with Akka.net and .Net Core
Akka.Net - Implementing distributed systems with Akka.net and .Net Core
 
Reactive: Programming -> Systems -> Architecture
Reactive: Programming -> Systems -> ArchitectureReactive: Programming -> Systems -> Architecture
Reactive: Programming -> Systems -> Architecture
 
CQRS Evolved - CQRS + Akka.NET
CQRS Evolved - CQRS + Akka.NETCQRS Evolved - CQRS + Akka.NET
CQRS Evolved - CQRS + Akka.NET
 
Moving towards Reactive Programming
Moving towards Reactive ProgrammingMoving towards Reactive Programming
Moving towards Reactive Programming
 
Akka.Net and .Net Core - The Developer Conference 2018 Florianopolis
Akka.Net and .Net Core - The Developer Conference 2018 FlorianopolisAkka.Net and .Net Core - The Developer Conference 2018 Florianopolis
Akka.Net and .Net Core - The Developer Conference 2018 Florianopolis
 
Oop2011 actor presentation_stal
Oop2011 actor presentation_stalOop2011 actor presentation_stal
Oop2011 actor presentation_stal
 

Más de Anna Shymchenko

Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...
Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...
Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...Anna Shymchenko
 
Евгений Руднев: "Programmers Approach to Error Handling"
Евгений Руднев: "Programmers Approach to Error Handling"Евгений Руднев: "Programmers Approach to Error Handling"
Евгений Руднев: "Programmers Approach to Error Handling"Anna Shymchenko
 
Александр Куцан: "Static Code Analysis in C++"
Александр Куцан: "Static Code Analysis in C++" Александр Куцан: "Static Code Analysis in C++"
Александр Куцан: "Static Code Analysis in C++" Anna Shymchenko
 
Алесей Решта: “Robotics Sport & Luxoft Open Robotics Club”
Алесей Решта: “Robotics Sport & Luxoft Open Robotics Club” Алесей Решта: “Robotics Sport & Luxoft Open Robotics Club”
Алесей Решта: “Robotics Sport & Luxoft Open Robotics Club” Anna Shymchenko
 
Евгений Хыст: "Server-Side Geo-Clustering Based on Geohash"
Евгений Хыст: "Server-Side Geo-Clustering Based on Geohash"Евгений Хыст: "Server-Side Geo-Clustering Based on Geohash"
Евгений Хыст: "Server-Side Geo-Clustering Based on Geohash"Anna Shymchenko
 
Роман Яворский "Introduction to DevOps"
Роман Яворский "Introduction to DevOps"Роман Яворский "Introduction to DevOps"
Роман Яворский "Introduction to DevOps"Anna Shymchenko
 
Максим Сабарня “NoSQL: Not only SQL in developer’s life”
Максим Сабарня “NoSQL: Not only SQL in developer’s life” Максим Сабарня “NoSQL: Not only SQL in developer’s life”
Максим Сабарня “NoSQL: Not only SQL in developer’s life” Anna Shymchenko
 
Андрей Лисниченко "SQL Injection"
Андрей Лисниченко "SQL Injection"Андрей Лисниченко "SQL Injection"
Андрей Лисниченко "SQL Injection"Anna Shymchenko
 
Светлана Мухина "Metrics on agile projects"
Светлана Мухина "Metrics on agile projects"Светлана Мухина "Metrics on agile projects"
Светлана Мухина "Metrics on agile projects"Anna Shymchenko
 
Андрей Слободяник "Test driven development using mockito"
Андрей Слободяник "Test driven development using mockito"Андрей Слободяник "Test driven development using mockito"
Андрей Слободяник "Test driven development using mockito"Anna Shymchenko
 
Евгений Хыст "Application performance database related problems"
Евгений Хыст "Application performance database related problems"Евгений Хыст "Application performance database related problems"
Евгений Хыст "Application performance database related problems"Anna Shymchenko
 
Даурен Муса “IBM WebSphere - expensive but effective”
Даурен Муса “IBM WebSphere - expensive but effective” Даурен Муса “IBM WebSphere - expensive but effective”
Даурен Муса “IBM WebSphere - expensive but effective” Anna Shymchenko
 
Александр Пашинский "Reinventing Design Patterns with Java 8"
Александр Пашинский "Reinventing Design Patterns with Java 8"Александр Пашинский "Reinventing Design Patterns with Java 8"
Александр Пашинский "Reinventing Design Patterns with Java 8"Anna Shymchenko
 
Евгений Капинос "Advanced JPA (Java Persistent API)"
Евгений Капинос "Advanced JPA (Java Persistent API)"Евгений Капинос "Advanced JPA (Java Persistent API)"
Евгений Капинос "Advanced JPA (Java Persistent API)"Anna Shymchenko
 
Event-driven architecture with Java technology stack
Event-driven architecture with Java technology stackEvent-driven architecture with Java technology stack
Event-driven architecture with Java technology stackAnna Shymchenko
 
Do we need SOLID principles during software development?
Do we need SOLID principles during software development?Do we need SOLID principles during software development?
Do we need SOLID principles during software development?Anna Shymchenko
 
Guava - Elements of Functional Programming
Guava - Elements of Functional Programming Guava - Elements of Functional Programming
Guava - Elements of Functional Programming Anna Shymchenko
 
Максим Сабарня и Иван Дрижирук “Vert.x – tool-kit for building reactive app...
 	Максим Сабарня и Иван Дрижирук “Vert.x – tool-kit for building reactive app... 	Максим Сабарня и Иван Дрижирук “Vert.x – tool-kit for building reactive app...
Максим Сабарня и Иван Дрижирук “Vert.x – tool-kit for building reactive app...Anna Shymchenko
 
Сергей Гончарук "Working with uncertainty"
 	Сергей Гончарук "Working with uncertainty"  	Сергей Гончарук "Working with uncertainty"
Сергей Гончарук "Working with uncertainty" Anna Shymchenko
 
Александр Денисюк "How not to lose the dynamic of project in process time"
 	Александр Денисюк "How not to lose the dynamic of project in process time"  	Александр Денисюк "How not to lose the dynamic of project in process time"
Александр Денисюк "How not to lose the dynamic of project in process time" Anna Shymchenko
 

Más de Anna Shymchenko (20)

Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...
Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...
Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...
 
Евгений Руднев: "Programmers Approach to Error Handling"
Евгений Руднев: "Programmers Approach to Error Handling"Евгений Руднев: "Programmers Approach to Error Handling"
Евгений Руднев: "Programmers Approach to Error Handling"
 
Александр Куцан: "Static Code Analysis in C++"
Александр Куцан: "Static Code Analysis in C++" Александр Куцан: "Static Code Analysis in C++"
Александр Куцан: "Static Code Analysis in C++"
 
Алесей Решта: “Robotics Sport & Luxoft Open Robotics Club”
Алесей Решта: “Robotics Sport & Luxoft Open Robotics Club” Алесей Решта: “Robotics Sport & Luxoft Open Robotics Club”
Алесей Решта: “Robotics Sport & Luxoft Open Robotics Club”
 
Евгений Хыст: "Server-Side Geo-Clustering Based on Geohash"
Евгений Хыст: "Server-Side Geo-Clustering Based on Geohash"Евгений Хыст: "Server-Side Geo-Clustering Based on Geohash"
Евгений Хыст: "Server-Side Geo-Clustering Based on Geohash"
 
Роман Яворский "Introduction to DevOps"
Роман Яворский "Introduction to DevOps"Роман Яворский "Introduction to DevOps"
Роман Яворский "Introduction to DevOps"
 
Максим Сабарня “NoSQL: Not only SQL in developer’s life”
Максим Сабарня “NoSQL: Not only SQL in developer’s life” Максим Сабарня “NoSQL: Not only SQL in developer’s life”
Максим Сабарня “NoSQL: Not only SQL in developer’s life”
 
Андрей Лисниченко "SQL Injection"
Андрей Лисниченко "SQL Injection"Андрей Лисниченко "SQL Injection"
Андрей Лисниченко "SQL Injection"
 
Светлана Мухина "Metrics on agile projects"
Светлана Мухина "Metrics on agile projects"Светлана Мухина "Metrics on agile projects"
Светлана Мухина "Metrics on agile projects"
 
Андрей Слободяник "Test driven development using mockito"
Андрей Слободяник "Test driven development using mockito"Андрей Слободяник "Test driven development using mockito"
Андрей Слободяник "Test driven development using mockito"
 
Евгений Хыст "Application performance database related problems"
Евгений Хыст "Application performance database related problems"Евгений Хыст "Application performance database related problems"
Евгений Хыст "Application performance database related problems"
 
Даурен Муса “IBM WebSphere - expensive but effective”
Даурен Муса “IBM WebSphere - expensive but effective” Даурен Муса “IBM WebSphere - expensive but effective”
Даурен Муса “IBM WebSphere - expensive but effective”
 
Александр Пашинский "Reinventing Design Patterns with Java 8"
Александр Пашинский "Reinventing Design Patterns with Java 8"Александр Пашинский "Reinventing Design Patterns with Java 8"
Александр Пашинский "Reinventing Design Patterns with Java 8"
 
Евгений Капинос "Advanced JPA (Java Persistent API)"
Евгений Капинос "Advanced JPA (Java Persistent API)"Евгений Капинос "Advanced JPA (Java Persistent API)"
Евгений Капинос "Advanced JPA (Java Persistent API)"
 
Event-driven architecture with Java technology stack
Event-driven architecture with Java technology stackEvent-driven architecture with Java technology stack
Event-driven architecture with Java technology stack
 
Do we need SOLID principles during software development?
Do we need SOLID principles during software development?Do we need SOLID principles during software development?
Do we need SOLID principles during software development?
 
Guava - Elements of Functional Programming
Guava - Elements of Functional Programming Guava - Elements of Functional Programming
Guava - Elements of Functional Programming
 
Максим Сабарня и Иван Дрижирук “Vert.x – tool-kit for building reactive app...
 	Максим Сабарня и Иван Дрижирук “Vert.x – tool-kit for building reactive app... 	Максим Сабарня и Иван Дрижирук “Vert.x – tool-kit for building reactive app...
Максим Сабарня и Иван Дрижирук “Vert.x – tool-kit for building reactive app...
 
Сергей Гончарук "Working with uncertainty"
 	Сергей Гончарук "Working with uncertainty"  	Сергей Гончарук "Working with uncertainty"
Сергей Гончарук "Working with uncertainty"
 
Александр Денисюк "How not to lose the dynamic of project in process time"
 	Александр Денисюк "How not to lose the dynamic of project in process time"  	Александр Денисюк "How not to lose the dynamic of project in process time"
Александр Денисюк "How not to lose the dynamic of project in process time"
 

Último

MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfYashikaSharma391629
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 

Último (20)

MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 

Орхан Гасимов: "Reactive Applications in Java with Akka"

  • 1. www.luxoft.com Reactive Applications in Java with Akka by Orkhan Gasimov
  • 2. www.luxoft.com About author Orkhan Gasimov Software Developer  Over 13 years in software development field  Participated in full-cycle application development, leading development groups with hands-on experience in a variety of programming languages and technologies including solution design and architecture  Applied practical usage of Java, C#, C/C++, Perl, PHP, JavaScript and other programming languages. Designed desktop, mobile and web applications from consumer products to N-tier systems
  • 4. www.luxoft.com Scaling up Scaling out • More price with each step • Greater risk of hardware failure causing bigger outages • Limited upgradeability in the future • One unit for everything • Much cheaper than scaling vertically • Easier to run fault-tolerance • Easy to upgrade • Parallel units enable parallel execution Scaling
  • 5. www.luxoft.com Reactive Applications in Java with Akka  Reactive Manifesto  Actor Model  Load Balancing & Scaling  Other Features & Available Modules
  • 7. www.luxoft.com Reactive Manifesto  Application requirements have changed dramatically in recent years  A few years ago a large application had - tens of servers - seconds of response time - hours of offline maintenance - gigabytes of data  Today - applications are deployed on everything from mobile devices to cloud-based clusters - users expect millisecond response times and 100% uptime - data is measured in Petabytes
  • 8. www.luxoft.com Reactive Manifesto  Today's demands are simply not met by yesterday’s software architectures  A coherent approach to systems architecture is needed  All necessary aspects are already recognized individually  We want systems that are - Responsive - Resilient - Elastic - Message Driven  We call these Reactive Systems
  • 9. www.luxoft.com Reactive Manifesto  Responsive: The system responds in a timely manner if at all possible. Responsiveness means that problems may be detected quickly and dealt with effectively.  Resilient: The system stays responsive in the face of failure. Any system that is not resilient will be unresponsive after a failure.  Elastic: The system stays responsive under varying workload. Reactive Systems can react to changes in the input rate by increasing or decreasing the resources allocated to service these inputs.  Message Driven: Reactive Systems rely on asynchronous message-passing to establish a boundary between components that ensures loose coupling, isolation and location transparency. This boundary also provides the means to delegate failures as messages.
  • 10. www.luxoft.com Reactive Manifesto  Large systems are composed of smaller ones and therefore depend on the Reactive properties of their constituents. This means that Reactive Systems apply design principles so these properties apply at all levels of scale, making them composable.
  • 13. www.luxoft.com Akka vs JavaEE  No application server is required  Vanilla JVM and core Java is enough  JVMs can be stacked up to a Cluster  Akka offers Actor Model instead of Object Oriented Model - Actors are workers - Objects are objects  Actors are parallelized by default
  • 14. www.luxoft.com Concepts  Let’s review some base concepts before the deep dive
  • 23. www.luxoft.com Progress Condition  We want so called Progress Condition. These are actual non- blocking guarantees.  We want applications to behave - Parallel - Asynchronous - Non-blocking - Without deadlocks, starvation and live-locks - Without race conditions
  • 24. www.luxoft.com Akka  What is Akka?  What does Akka bring?
  • 25. www.luxoft.com Actor Model  An actor is a computational entity that, in response to a message it receives, can concurrently: - send a finite number of messages to other actors; - create a finite number of new actors; - designate the behavior to be used for the next message it receives.  There is no assumed sequence to the above actions. They could be parallel!  The Actor Model philosophy says ”everything is an actor”.  This is similar to the ”everything is an object” philosophy, but object-oriented software is typically executed sequentially, while the Actor Model is inherently concurrent.
  • 27. www.luxoft.com Actor Model  Actors are objects which encapsulate state and behavior  They communicate exclusively by exchanging messages which are placed into the recipient’s mailbox  View them as persons  While modeling a solution with actors - envision a group of people and assign sub-tasks to them, - arrange their functions into an organizational structure - and think about how to escalate failure
  • 28. www.luxoft.com Actor System  Actors come in systems and never alone  Actors form hierarchies  Actor can start child actors and supervise them  Splitting tasks brings in smaller and more manageable tasks
  • 32. www.luxoft.com API is very easy  Create the ActorSystem  Actor is a class extending UntypedActor and overriding onReceive method  Use ActorSystem::actorOf method to create actors - Each actor can create child actor using getContext().actorOf method  To send a message to Actor ActorRef::tell method is used - you should have ActorRef (actor reference) which you will get on actor creation or you can lookup/search for it by path
  • 33. www.luxoft.com Load Balancing & Scaling  Dispatchers  Mailboxes  Routers
  • 36. www.luxoft.com Mailboxes  Akka comes shipped with a number of mailbox implementations - Unbounded (default) - Bounded - [U/B] Non-Blocking - [U/B] Priority - [U/B] Stable Priority (FIFO) - [U/B] Control Aware - Unbounded Single Consumer Only
  • 38. www.luxoft.com Other Features & Available Modules  Futures – functional promises that are used to retrieve the result of some concurrent operation  Agents – provide asynchronous change of individual locations  Remote – enable remote actor messaging between actor systems over the network  Cluster – turn actor systems into a single cluster over the network  I/O – module carries API for the implementation of network protocols and building higher abstractions  Camel – actors can now exchange messages with other systems over large number of protocols & APIs such as HTTP, SOAP, TCP, FTP, SMTP or JMS, to mention a few  Streams – stream processing API  HTTP – a full server- and client-side HTTP stack on top of akka-actor and akka-stream. It's not a web-framework but rather a more general toolkit for providing and consuming HTTP-based services.
  • 39. www.luxoft.com R e a c t i v e Thank You!