SlideShare a Scribd company logo
1 of 69
Download to read offline
What is Reactive Programming? 
An Overview of the Reactive Programming Paradigm
A Pre-Reactive World.
“It’s time for web servers to handle ten thousand clients simultaneously.” 
–Dan Kegel: The C10k Problem, 1999
Expectations in the year 2000 
4 
• Limited connectivity
Expectations in the year 2000 
5 
• Limited connectivity 
• Snapshots of data on hard drives, 
centralized databases, etc
Expectations in the year 2000 
6 
• Limited connectivity 
• Snapshots of data on hard drives, 
centralized databases, etc 
• Response times in seconds
Expectations in the year 2000 
7 
• Limited connectivity 
• Snapshots of data on hard drives, 
centralized databases, etc 
• Response times in seconds 
• Downtime all the time
Hardware in the year 2000 
8 
• A single machine with a single core
Hardware in the year 2000 
9 
• A single machine with a single core 
• Limited networking — e.g, a mix of broadband, dialup internet, FidoNet
Hardware in the year 2000 
10 
• A single machine with a single core 
• Limited networking — e.g, a mix of broadband, dialup internet, FidoNet 
• Expensive memory, CPU, hard drives
Hardware in the year 2000 
11 
• A single machine with a single core 
• Limited networking — e.g, a mix of broadband, dialup internet, FidoNet 
• Expensive memory, CPU, hard drives 
• Small data
“In 1999, one of the busiest FTP sites, cdrom.com, handled 10,000 clients 
simultaneously through a Gigabit Ethernet pipe.” 
–Dan Kegel: The C10k Problem, 1999
Fast forward 14 years.
Expectations have changed. Hardware has changed.
Expectations in the year 2014 
15 
• Limited connectivity ⇨ always connected
Expectations in the year 2014 
16 
• Limited connectivity ⇨ always connected 
• Snapshots of small data ⇨ real-time streams, distributed big data
Expectations in the year 2014 
17 
• Limited connectivity ⇨ always connected 
• Snapshots of small data ⇨ real-time streams, distributed big data 
• Response times in seconds ⇨ response times in milli/microseconds
Expectations in the year 2014 
18 
• Limited connectivity ⇨ always connected 
• Snapshots of small data ⇨ real-time streams, distributed big data 
• Response times in seconds ⇨ response times in milli/microseconds 
• Downtime all the time ⇨ downtime measured in seconds
Hardware in the year 2014 
19 
• A single machine ⇨ clusters of machines
Hardware in the year 2014 
20 
• A single machine ⇨ clusters of machines 
• A single core ⇨ multiple cores
Hardware in the year 2014 
21 
• A single machine ⇨ clusters of machines 
• A single core ⇨ multiple cores 
• Slow networks ⇨ fast networks
Hardware in the year 2014 
22 
• A single machine ⇨ clusters of machines 
• A single core ⇨ multiple cores 
• Slow networks ⇨ fast networks 
• Small data snapshots ⇨ big data streams
“If one node can only serve 10,000 clients, the venture is cost-prohibitive 
from the start – just one million devices would require a fleet of 100 
servers.” 
–Scott Andreas, Urban Airship
In 2010, Urban Airship used Java NIO to successfully test 512,000+ 
concurrent connections on a single 2.5 GB EC2 instance.
Realities of modern software development 
25 
• Applications are distributed by default
Realities of modern software development 
26 
• Applications are distributed by default 
• Applications are composed from other applications
Realities of modern software development 
27 
• Applications are distributed by default 
• Applications are composed from other applications 
• Performance expectations — a slow application is a dead application
Realities of modern software development 
28 
• Applications are distributed by default 
• Applications are composed from other applications 
• Performance expectations — a slow application is a dead application 
• UIs must adapt to multiple screen sizes and types of input
Realities of modern software development 
29 
• Applications are distributed by default 
• Applications are composed from other applications 
• Performance expectations — a slow application is a dead application 
• UIs must adapt to multiple screen sizes and types of input 
• Developers can no longer avoid parallelism and concurrency
C10k ⇨ C500k
Not so fast…
“MigratoryData scales up to 12 million concurrent users from a single 
Dell PowerEdge R610 server while pushing up to 1.015 Gbps live data 
(each user receives a 512-byte message every minute).” 
–Mihai Rotaru, 2013, discussing MigratoryData WebSocket server
C10k ⇨ C12m
What is Reactive Programming?
“Instead of the latest framework of the day or the latest buzzword, 
reactive brings the talk back to core principles; the design, the 
architecture, the way we think about building software.” 
–Jonas Bonér
Core principles of reactive software 
36 
• React to events ⇨ Event-driven 
• React to load ⇨ Scalable 
• React to failure ⇨ Resilient 
• React to users ⇨ Responsive 
• Reactive ⇨ Event-driven, Scalable, Resilient, Responsive
Reactive 
37
re·spon·sive 
! 
“Reacting quickly and positively.” 
! 
synonyms: quick to react to, reactive to, receptive to, open to suggestions 
about, amenable to, flexible to, sensitive to, sympathetic to
Responsive — flexibility 
39 
Progressive UI enhancement 
• Never allow slow external dependencies to degrade the user experience 
Blue skies 
• Never assume blue skies, assume grey skies
Responsive — quick to react 
40 
Beware of blocking IO! 
• Asynchronous — non-blocking, blocking 
• Synchronous — non-blocking, blocking 
• Do you know what type your web framework implements? 
Perceived quality 
• Perception of responsiveness is key, feel counts! 
• Never, ever perform blocking IO on the UI thread!
Responsiveness 
! 
Being quick to react to all users of a system — under blue skies and grey 
skies — in order to ensure a consistent experience.
scal·able 
! 
“Capable of being easily expanded or upgraded on demand.” 
! 
synonyms: ascendable, climbable, extensible, expandable, expansible, 
adaptable, elastic, flexible
Scalable 
43 
Important terms 
• Performance — a measure of your response time 
• Load — impacts performance if not handled properly 
Dealing with load 
• Scale up — faster CPU, more memory, bigger hard drive 
• Scale out — distribute work across nodes and clusters
Scalability 
! 
The capability of your system to be easily upgraded on demand in order 
to ensure responsiveness under various load conditions.
re·sil·ient 
! 
“Able to withstand or recover quickly from difficult conditions.” 
! 
synonyms: strong, tough, hardy
Resilient 
46 
Bulkheads 
• Partitioning — partition thread groups for different functionality 
Backpressure 
• Throttling — wait for a consumer to demand more work 
Circuit Breakers 
• Stability — Failing external dependencies shouldn’t bring down an entire app
Resiliency 
! 
The proper application of fundamental design and architecture principles 
to ensure responsiveness under grey skies.
e·vent 
! 
“Something that happens or is regarded as happening; an occurrence, 
especially one of some importance.” 
! 
driv·en 
! 
“Propelled or motivated by something.”
Traditional concurrency models 
49 
Thread based concurrency with objects and shared state 
• Imperative, sequential execution 
• Most common programming paradigm 
• Threads for concurrency 
• Difficult to reason about, error-prone 
• Implementations — most OO based web frameworks, languages, and toolkits
Traditional concurrency models 
50 
Software transactional memory (STM) 
• Immutable values 
• Atomicity, consistency, isolation and durability 
• Cannot perform any operation that cannot be undone, including (most) I/O 
• Think command pattern/interface 
• Implementations — Haskell STM (native), libs for Scala, Java, OCaml, Clojure, etc
Share nothing concurrency 
51 
Event driven concurrency 
• Thread based event loops 
• Often single threaded 
• Implementations — Node.js, Twisted Python, EventMachine (Ruby)
Share nothing concurrency 
52 
Actor based concurrency 
• Mutable state, but completely isolated 
• State only mutated by the actor 
• Asynchronous message passing between actors using mailboxes 
• Thread based actors or event based actors 
• Implementations — Erlang, Akka
Event driven 
! 
An event driven architecture forces programmers to deal with scalability 
and resilience at a code level in order to facilitate responsiveness.
re·ac·tive 
! 
“Responsive to stimulus.” 
! 
synonyms: active, aware, conscious, receptive, sensitive, acknowledging, 
alive, answering
Reactive 
55
A quick code example.
A programmer had a problem. They thought to themselves, "I know, I'll 
solve it with threads". have Now problems two they. 
–@davidlohr
Non-deterministic — mutable state, threads, locks 
58 
var a = foo.getB() + bar.getC()! 
System.out.println(a) // “42”! 
a = foo.getB() + bar.getC()! 
System.out.println(a) // Who knows?
Non-deterministic — mutable state, threads, locks 
59 
var a = foo.getB() + bar.getC()! 
System.out.println(a) // “42”! 
a = foo.getB() + bar.getC()! 
System.out.println(a) // Who knows?! 
! 
• The value of a may or may not still be 42 
• Is another thread is mutating foo or bar? 
• Pull-based — getB() and getC() must be explicitly invoked 
• Later mutation to foo and bar doesn’t effect a 
• Based on time and space
Why is non-determinism the root of all evil? 
60 
Key terms 
• Parallelism — when at least two threads are executing simultaneously 
• Concurrency — when at least two threads are making progress 
Mutable state + threads + locks 
• Code that is error prone and difficult to reason about 
• Extremely difficult to implement parallelism and concurrency with MuSTL
Akka is a toolkit and runtime for building highly concurrent, distributed, 
and fault tolerant event-driven applications on the JVM.
A simple Akka code example 
62 
class GameActor extends Actor {! 
def receive = {! 
case handshakeRequest: HandshakeRequest => ! 
sender ! computeHandshakeResponse(handshakeRequest)! 
case turnMessage: TurnMessage => ! 
sender ! computeTurnResponse(turnMessage) ! 
}! 
}! 
! 
• Time, space, mutation ⇨ flow, events, messages
Akka Actors 
63 
• Process messages asynchronously 
• Pattern match against message types 
• Focus on flow and values — not objects, threads, and locks 
• Higher-level of abstraction — easier to write concurrent, distributed systems 
• Think observable/observer and pub/sub 
• Influenced by the Erlang actor model
Erlang has embraced the tenets of reactive programming since 1985.
Erlang characteristics and use cases 
65 
• Share nothing architecture — processes cannot share data 
• Pure message passing — copy all the data you need in the messages 
• Crash detection and recovery — things will crash, so let them crash then recover
Erlang characteristics and use cases 
66 
Popular Erlang Software 
• Wings 3D — 3D modelling 
• Ejabberd — instant messaging server 
• CouchDB — document database 
• RabbitMQ — enterprise-y messaging 
Erlang in Production 
• Ericsson — 3G mobile networks 
• Amazon — SimpleDB, EC2 
• Facebook — back-end chat server 
• T-Mobile — SMS and authentication
“Reactive looks back in history. It doesn't ignore the goldmine of 
knowledge that's been around for 30 to 40 years, but rather tries to bring 
it into new context.” 
–Jonas Bonér
Sources and credits 
68 
• Jonas Bonér — Reactive Supply to Changing Demand 
• Joe Armstrong — K things I know about building Resilient Reactive Systems 
• Benjamin Erb — Concurrent Programming for Scalable Web Architectures 
• Rich Hickey — The Value of Values 
• Plus various talks, papers, books, blog posts, and tweets by… 
• Dean Wampler, Erik Meijer, Martin Odersky, Martin Thompson, etc
©Typesafe 2014 – All Rights Reserved

More Related Content

What's hot

The Reactive Principles: Eight Tenets For Building Cloud Native Applications
The Reactive Principles: Eight Tenets For Building Cloud Native ApplicationsThe Reactive Principles: Eight Tenets For Building Cloud Native Applications
The Reactive Principles: Eight Tenets For Building Cloud Native ApplicationsLightbend
 
Cloudstate - Towards Stateful Serverless
Cloudstate - Towards Stateful ServerlessCloudstate - Towards Stateful Serverless
Cloudstate - Towards Stateful ServerlessLightbend
 
Building Streaming And Fast Data Applications With Spark, Mesos, Akka, Cassan...
Building Streaming And Fast Data Applications With Spark, Mesos, Akka, Cassan...Building Streaming And Fast Data Applications With Spark, Mesos, Akka, Cassan...
Building Streaming And Fast Data Applications With Spark, Mesos, Akka, Cassan...Lightbend
 
Lightbend Training for Scala, Akka, Play Framework and Apache Spark
Lightbend Training for Scala, Akka, Play Framework and Apache SparkLightbend Training for Scala, Akka, Play Framework and Apache Spark
Lightbend Training for Scala, Akka, Play Framework and Apache SparkLightbend
 
Lessons From HPE: From Batch To Streaming For 20 Billion Sensors With Lightbe...
Lessons From HPE: From Batch To Streaming For 20 Billion Sensors With Lightbe...Lessons From HPE: From Batch To Streaming For 20 Billion Sensors With Lightbe...
Lessons From HPE: From Batch To Streaming For 20 Billion Sensors With Lightbe...Lightbend
 
Digital Transformation with Kubernetes, Containers, and Microservices
Digital Transformation with Kubernetes, Containers, and MicroservicesDigital Transformation with Kubernetes, Containers, and Microservices
Digital Transformation with Kubernetes, Containers, and MicroservicesLightbend
 
Building Reactive Fast Data & the Data Lake with Akka, Kafka, Spark
Building Reactive Fast Data & the Data Lake with Akka, Kafka, SparkBuilding Reactive Fast Data & the Data Lake with Akka, Kafka, Spark
Building Reactive Fast Data & the Data Lake with Akka, Kafka, SparkTodd Fritz
 
Oracle Panel: Expert Insights into Faster Oracle SOA Suite Project Delivery
Oracle Panel: Expert Insights into Faster Oracle SOA Suite Project DeliveryOracle Panel: Expert Insights into Faster Oracle SOA Suite Project Delivery
Oracle Panel: Expert Insights into Faster Oracle SOA Suite Project DeliveryGuido Schmutz
 
Migrating from Java EE to cloud-native Reactive systems
Migrating from Java EE to cloud-native Reactive systemsMigrating from Java EE to cloud-native Reactive systems
Migrating from Java EE to cloud-native Reactive systemsMarkus Eisele
 
From Monolithic to Microservices in 45 Minutes
From Monolithic to Microservices in 45 MinutesFrom Monolithic to Microservices in 45 Minutes
From Monolithic to Microservices in 45 MinutesMongoDB
 
Introduction to Streaming Analytics
Introduction to Streaming AnalyticsIntroduction to Streaming Analytics
Introduction to Streaming AnalyticsGuido Schmutz
 
Modeling microservices using DDD
Modeling microservices using DDDModeling microservices using DDD
Modeling microservices using DDDMasashi Narumoto
 
High-Speed Reactive Microservices
High-Speed Reactive MicroservicesHigh-Speed Reactive Microservices
High-Speed Reactive MicroservicesRick Hightower
 
Lean Enterprise, Microservices and Big Data
Lean Enterprise, Microservices and Big DataLean Enterprise, Microservices and Big Data
Lean Enterprise, Microservices and Big DataStylight
 
Introduction to Apache Kafka and Confluent... and why they matter!
Introduction to Apache Kafka and Confluent... and why they matter!Introduction to Apache Kafka and Confluent... and why they matter!
Introduction to Apache Kafka and Confluent... and why they matter!Paolo Castagna
 
Building data-driven microservices
Building data-driven microservicesBuilding data-driven microservices
Building data-driven microservicesStreamlio
 
Going Reactive in the Land of No
Going Reactive in the Land of NoGoing Reactive in the Land of No
Going Reactive in the Land of NoLightbend
 
Microservices and Integration: what's next with Istio service mesh
Microservices and Integration: what's next with Istio service meshMicroservices and Integration: what's next with Istio service mesh
Microservices and Integration: what's next with Istio service meshChristian Posta
 

What's hot (20)

The Reactive Principles: Eight Tenets For Building Cloud Native Applications
The Reactive Principles: Eight Tenets For Building Cloud Native ApplicationsThe Reactive Principles: Eight Tenets For Building Cloud Native Applications
The Reactive Principles: Eight Tenets For Building Cloud Native Applications
 
Cloudstate - Towards Stateful Serverless
Cloudstate - Towards Stateful ServerlessCloudstate - Towards Stateful Serverless
Cloudstate - Towards Stateful Serverless
 
Building Streaming And Fast Data Applications With Spark, Mesos, Akka, Cassan...
Building Streaming And Fast Data Applications With Spark, Mesos, Akka, Cassan...Building Streaming And Fast Data Applications With Spark, Mesos, Akka, Cassan...
Building Streaming And Fast Data Applications With Spark, Mesos, Akka, Cassan...
 
Lightbend Training for Scala, Akka, Play Framework and Apache Spark
Lightbend Training for Scala, Akka, Play Framework and Apache SparkLightbend Training for Scala, Akka, Play Framework and Apache Spark
Lightbend Training for Scala, Akka, Play Framework and Apache Spark
 
Lessons From HPE: From Batch To Streaming For 20 Billion Sensors With Lightbe...
Lessons From HPE: From Batch To Streaming For 20 Billion Sensors With Lightbe...Lessons From HPE: From Batch To Streaming For 20 Billion Sensors With Lightbe...
Lessons From HPE: From Batch To Streaming For 20 Billion Sensors With Lightbe...
 
Digital Transformation with Kubernetes, Containers, and Microservices
Digital Transformation with Kubernetes, Containers, and MicroservicesDigital Transformation with Kubernetes, Containers, and Microservices
Digital Transformation with Kubernetes, Containers, and Microservices
 
Building Reactive Fast Data & the Data Lake with Akka, Kafka, Spark
Building Reactive Fast Data & the Data Lake with Akka, Kafka, SparkBuilding Reactive Fast Data & the Data Lake with Akka, Kafka, Spark
Building Reactive Fast Data & the Data Lake with Akka, Kafka, Spark
 
Oracle Panel: Expert Insights into Faster Oracle SOA Suite Project Delivery
Oracle Panel: Expert Insights into Faster Oracle SOA Suite Project DeliveryOracle Panel: Expert Insights into Faster Oracle SOA Suite Project Delivery
Oracle Panel: Expert Insights into Faster Oracle SOA Suite Project Delivery
 
Migrating from Java EE to cloud-native Reactive systems
Migrating from Java EE to cloud-native Reactive systemsMigrating from Java EE to cloud-native Reactive systems
Migrating from Java EE to cloud-native Reactive systems
 
From Monolithic to Microservices in 45 Minutes
From Monolithic to Microservices in 45 MinutesFrom Monolithic to Microservices in 45 Minutes
From Monolithic to Microservices in 45 Minutes
 
Introduction to Streaming Analytics
Introduction to Streaming AnalyticsIntroduction to Streaming Analytics
Introduction to Streaming Analytics
 
Designing microservices
Designing microservicesDesigning microservices
Designing microservices
 
SQL vs. NoSQL
SQL vs. NoSQLSQL vs. NoSQL
SQL vs. NoSQL
 
Modeling microservices using DDD
Modeling microservices using DDDModeling microservices using DDD
Modeling microservices using DDD
 
High-Speed Reactive Microservices
High-Speed Reactive MicroservicesHigh-Speed Reactive Microservices
High-Speed Reactive Microservices
 
Lean Enterprise, Microservices and Big Data
Lean Enterprise, Microservices and Big DataLean Enterprise, Microservices and Big Data
Lean Enterprise, Microservices and Big Data
 
Introduction to Apache Kafka and Confluent... and why they matter!
Introduction to Apache Kafka and Confluent... and why they matter!Introduction to Apache Kafka and Confluent... and why they matter!
Introduction to Apache Kafka and Confluent... and why they matter!
 
Building data-driven microservices
Building data-driven microservicesBuilding data-driven microservices
Building data-driven microservices
 
Going Reactive in the Land of No
Going Reactive in the Land of NoGoing Reactive in the Land of No
Going Reactive in the Land of No
 
Microservices and Integration: what's next with Istio service mesh
Microservices and Integration: what's next with Istio service meshMicroservices and Integration: what's next with Istio service mesh
Microservices and Integration: what's next with Istio service mesh
 

Viewers also liked

Functional Reactive Programming
Functional Reactive ProgrammingFunctional Reactive Programming
Functional Reactive ProgrammingOlav Haugen
 
The algebra of library design
The algebra of library designThe algebra of library design
The algebra of library designLeonardo Borges
 
Functional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event SystemsFunctional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event SystemsLeonardo Borges
 
02 - [ASP.NET Core] ASP.NET Core MVC
02 - [ASP.NET Core] ASP.NET Core MVC 02 - [ASP.NET Core] ASP.NET Core MVC
02 - [ASP.NET Core] ASP.NET Core MVC Cellenza
 
Microservices: Architecture for the Real-time Organization
Microservices: Architecture for the Real-time OrganizationMicroservices: Architecture for the Real-time Organization
Microservices: Architecture for the Real-time OrganizationKevin Webber
 
Reactive design: languages, and paradigms
Reactive design: languages, and paradigmsReactive design: languages, and paradigms
Reactive design: languages, and paradigmsDean Wampler
 
Reactive Streams: Handling Data-Flow the Reactive Way
Reactive Streams: Handling Data-Flow the Reactive WayReactive Streams: Handling Data-Flow the Reactive Way
Reactive Streams: Handling Data-Flow the Reactive WayRoland Kuhn
 
Cascadia.js: Don't Cross the Streams
Cascadia.js: Don't Cross the StreamsCascadia.js: Don't Cross the Streams
Cascadia.js: Don't Cross the Streamsmattpodwysocki
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examplesPeter Lawrey
 
[1B4]안드로이드 동시성_프로그래밍
[1B4]안드로이드 동시성_프로그래밍[1B4]안드로이드 동시성_프로그래밍
[1B4]안드로이드 동시성_프로그래밍NAVER D2
 
Functional Reactive Programming With RxSwift
Functional Reactive Programming With RxSwiftFunctional Reactive Programming With RxSwift
Functional Reactive Programming With RxSwift선협 이
 
Functional Reactive Programming with RxJS
Functional Reactive Programming with RxJSFunctional Reactive Programming with RxJS
Functional Reactive Programming with RxJSstefanmayer13
 
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015NAVER / MusicPlatform
 
Real world functional reactive programming
Real world functional reactive programmingReal world functional reactive programming
Real world functional reactive programmingEric Polerecky
 
NDC14 - Rx와 Functional Reactive Programming으로 고성능 서버 만들기
NDC14 - Rx와 Functional Reactive Programming으로 고성능 서버 만들기NDC14 - Rx와 Functional Reactive Programming으로 고성능 서버 만들기
NDC14 - Rx와 Functional Reactive Programming으로 고성능 서버 만들기Jong Wook Kim
 
Angular, ASP.NET Core, and Visual Studio Code - Oh My!
Angular, ASP.NET Core, and Visual Studio Code - Oh My!Angular, ASP.NET Core, and Visual Studio Code - Oh My!
Angular, ASP.NET Core, and Visual Studio Code - Oh My!Aaron Marisi
 
RxJS and Reactive Programming - Modern Web UI - May 2015
RxJS and Reactive Programming - Modern Web UI - May 2015RxJS and Reactive Programming - Modern Web UI - May 2015
RxJS and Reactive Programming - Modern Web UI - May 2015Ben Lesh
 

Viewers also liked (20)

Functional Reactive Programming
Functional Reactive ProgrammingFunctional Reactive Programming
Functional Reactive Programming
 
The algebra of library design
The algebra of library designThe algebra of library design
The algebra of library design
 
Functional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event SystemsFunctional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event Systems
 
ASP.NET MVC Core
ASP.NET MVC CoreASP.NET MVC Core
ASP.NET MVC Core
 
02 - [ASP.NET Core] ASP.NET Core MVC
02 - [ASP.NET Core] ASP.NET Core MVC 02 - [ASP.NET Core] ASP.NET Core MVC
02 - [ASP.NET Core] ASP.NET Core MVC
 
Microservices: Architecture for the Real-time Organization
Microservices: Architecture for the Real-time OrganizationMicroservices: Architecture for the Real-time Organization
Microservices: Architecture for the Real-time Organization
 
Reactive Web Applications
Reactive Web ApplicationsReactive Web Applications
Reactive Web Applications
 
Reactive design: languages, and paradigms
Reactive design: languages, and paradigmsReactive design: languages, and paradigms
Reactive design: languages, and paradigms
 
Reactive Streams: Handling Data-Flow the Reactive Way
Reactive Streams: Handling Data-Flow the Reactive WayReactive Streams: Handling Data-Flow the Reactive Way
Reactive Streams: Handling Data-Flow the Reactive Way
 
Cascadia.js: Don't Cross the Streams
Cascadia.js: Don't Cross the StreamsCascadia.js: Don't Cross the Streams
Cascadia.js: Don't Cross the Streams
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examples
 
[1B4]안드로이드 동시성_프로그래밍
[1B4]안드로이드 동시성_프로그래밍[1B4]안드로이드 동시성_프로그래밍
[1B4]안드로이드 동시성_프로그래밍
 
Functional Reactive Programming With RxSwift
Functional Reactive Programming With RxSwiftFunctional Reactive Programming With RxSwift
Functional Reactive Programming With RxSwift
 
Functional Reactive Programming with RxJS
Functional Reactive Programming with RxJSFunctional Reactive Programming with RxJS
Functional Reactive Programming with RxJS
 
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
 
Real world functional reactive programming
Real world functional reactive programmingReal world functional reactive programming
Real world functional reactive programming
 
NDC14 - Rx와 Functional Reactive Programming으로 고성능 서버 만들기
NDC14 - Rx와 Functional Reactive Programming으로 고성능 서버 만들기NDC14 - Rx와 Functional Reactive Programming으로 고성능 서버 만들기
NDC14 - Rx와 Functional Reactive Programming으로 고성능 서버 만들기
 
Angular, ASP.NET Core, and Visual Studio Code - Oh My!
Angular, ASP.NET Core, and Visual Studio Code - Oh My!Angular, ASP.NET Core, and Visual Studio Code - Oh My!
Angular, ASP.NET Core, and Visual Studio Code - Oh My!
 
RxJS and Reactive Programming - Modern Web UI - May 2015
RxJS and Reactive Programming - Modern Web UI - May 2015RxJS and Reactive Programming - Modern Web UI - May 2015
RxJS and Reactive Programming - Modern Web UI - May 2015
 
DevOps
DevOpsDevOps
DevOps
 

Similar to What is Reactive programming?

Tiger oracle
Tiger oracleTiger oracle
Tiger oracled0nn9n
 
MarkLittle_EnterpriseMiddlewareForThe21stCentury
MarkLittle_EnterpriseMiddlewareForThe21stCenturyMarkLittle_EnterpriseMiddlewareForThe21stCentury
MarkLittle_EnterpriseMiddlewareForThe21stCenturyKostas Mavridis
 
Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...
Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...
Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...Larry Smarr
 
Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...
Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...
Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...Larry Smarr
 
Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...
Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...
Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...Larry Smarr
 
Moving to software-based production workflows and containerisation of media a...
Moving to software-based production workflows and containerisation of media a...Moving to software-based production workflows and containerisation of media a...
Moving to software-based production workflows and containerisation of media a...Kieran Kunhya
 
Webinar: Hyperconvergence is Broken, Learn How to Fix it!
Webinar: Hyperconvergence is Broken, Learn How to Fix it!Webinar: Hyperconvergence is Broken, Learn How to Fix it!
Webinar: Hyperconvergence is Broken, Learn How to Fix it!Storage Switzerland
 
The Economies of Scaling Software
The Economies of Scaling SoftwareThe Economies of Scaling Software
The Economies of Scaling SoftwareAbdelmonaim Remani
 
SDN Demystified, by Dean Pemberton [APNIC 38]
SDN Demystified, by Dean Pemberton [APNIC 38]SDN Demystified, by Dean Pemberton [APNIC 38]
SDN Demystified, by Dean Pemberton [APNIC 38]APNIC
 
Dori Exterman, Considerations for choosing the parallel computing strategy th...
Dori Exterman, Considerations for choosing the parallel computing strategy th...Dori Exterman, Considerations for choosing the parallel computing strategy th...
Dori Exterman, Considerations for choosing the parallel computing strategy th...Sergey Platonov
 
CS101- Introduction to Computing- Lecture 45
CS101- Introduction to Computing- Lecture 45CS101- Introduction to Computing- Lecture 45
CS101- Introduction to Computing- Lecture 45Bilal Ahmed
 
The Effectiveness, Efficiency and Legitimacy of Outsourcing Your Data
The Effectiveness, Efficiency and Legitimacy of Outsourcing Your Data The Effectiveness, Efficiency and Legitimacy of Outsourcing Your Data
The Effectiveness, Efficiency and Legitimacy of Outsourcing Your Data DataCentred
 
Choosing the right parallel compute architecture
Choosing the right parallel compute architecture Choosing the right parallel compute architecture
Choosing the right parallel compute architecture corehard_by
 
The economies of scaling software - Abdel Remani
The economies of scaling software - Abdel RemaniThe economies of scaling software - Abdel Remani
The economies of scaling software - Abdel Remanijaxconf
 
Microservices, Kubernetes, and Application Modernization Done Right
Microservices, Kubernetes, and Application Modernization Done RightMicroservices, Kubernetes, and Application Modernization Done Right
Microservices, Kubernetes, and Application Modernization Done RightLightbend
 
Microservices - when, why and how incontrodevops.it
Microservices  - when, why and how incontrodevops.itMicroservices  - when, why and how incontrodevops.it
Microservices - when, why and how incontrodevops.itGiuseppe Lavagetto
 
Architectural Tactics for Large Scale Systems
Architectural Tactics for Large Scale SystemsArchitectural Tactics for Large Scale Systems
Architectural Tactics for Large Scale SystemsLen Bass
 
Design for Scale / Surge 2010
Design for Scale / Surge 2010Design for Scale / Surge 2010
Design for Scale / Surge 2010Christopher Brown
 
OSAC16: Unikernel-powered Transient Microservices: Changing the Face of Softw...
OSAC16: Unikernel-powered Transient Microservices: Changing the Face of Softw...OSAC16: Unikernel-powered Transient Microservices: Changing the Face of Softw...
OSAC16: Unikernel-powered Transient Microservices: Changing the Face of Softw...Russell Pavlicek
 

Similar to What is Reactive programming? (20)

Tiger oracle
Tiger oracleTiger oracle
Tiger oracle
 
MarkLittle_EnterpriseMiddlewareForThe21stCentury
MarkLittle_EnterpriseMiddlewareForThe21stCenturyMarkLittle_EnterpriseMiddlewareForThe21stCentury
MarkLittle_EnterpriseMiddlewareForThe21stCentury
 
Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...
Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...
Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...
 
Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...
Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...
Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...
 
Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...
Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...
Panel: Open Infrastructure for an Open Society: OSG, Commercial Clouds, and B...
 
Moving to software-based production workflows and containerisation of media a...
Moving to software-based production workflows and containerisation of media a...Moving to software-based production workflows and containerisation of media a...
Moving to software-based production workflows and containerisation of media a...
 
Webinar: Hyperconvergence is Broken, Learn How to Fix it!
Webinar: Hyperconvergence is Broken, Learn How to Fix it!Webinar: Hyperconvergence is Broken, Learn How to Fix it!
Webinar: Hyperconvergence is Broken, Learn How to Fix it!
 
The Economies of Scaling Software
The Economies of Scaling SoftwareThe Economies of Scaling Software
The Economies of Scaling Software
 
SDN Demystified, by Dean Pemberton [APNIC 38]
SDN Demystified, by Dean Pemberton [APNIC 38]SDN Demystified, by Dean Pemberton [APNIC 38]
SDN Demystified, by Dean Pemberton [APNIC 38]
 
Dori Exterman, Considerations for choosing the parallel computing strategy th...
Dori Exterman, Considerations for choosing the parallel computing strategy th...Dori Exterman, Considerations for choosing the parallel computing strategy th...
Dori Exterman, Considerations for choosing the parallel computing strategy th...
 
CS101- Introduction to Computing- Lecture 45
CS101- Introduction to Computing- Lecture 45CS101- Introduction to Computing- Lecture 45
CS101- Introduction to Computing- Lecture 45
 
NoSQL and ACID
NoSQL and ACIDNoSQL and ACID
NoSQL and ACID
 
The Effectiveness, Efficiency and Legitimacy of Outsourcing Your Data
The Effectiveness, Efficiency and Legitimacy of Outsourcing Your Data The Effectiveness, Efficiency and Legitimacy of Outsourcing Your Data
The Effectiveness, Efficiency and Legitimacy of Outsourcing Your Data
 
Choosing the right parallel compute architecture
Choosing the right parallel compute architecture Choosing the right parallel compute architecture
Choosing the right parallel compute architecture
 
The economies of scaling software - Abdel Remani
The economies of scaling software - Abdel RemaniThe economies of scaling software - Abdel Remani
The economies of scaling software - Abdel Remani
 
Microservices, Kubernetes, and Application Modernization Done Right
Microservices, Kubernetes, and Application Modernization Done RightMicroservices, Kubernetes, and Application Modernization Done Right
Microservices, Kubernetes, and Application Modernization Done Right
 
Microservices - when, why and how incontrodevops.it
Microservices  - when, why and how incontrodevops.itMicroservices  - when, why and how incontrodevops.it
Microservices - when, why and how incontrodevops.it
 
Architectural Tactics for Large Scale Systems
Architectural Tactics for Large Scale SystemsArchitectural Tactics for Large Scale Systems
Architectural Tactics for Large Scale Systems
 
Design for Scale / Surge 2010
Design for Scale / Surge 2010Design for Scale / Surge 2010
Design for Scale / Surge 2010
 
OSAC16: Unikernel-powered Transient Microservices: Changing the Face of Softw...
OSAC16: Unikernel-powered Transient Microservices: Changing the Face of Softw...OSAC16: Unikernel-powered Transient Microservices: Changing the Face of Softw...
OSAC16: Unikernel-powered Transient Microservices: Changing the Face of Softw...
 

Recently uploaded

About .NET 8 and a first glimpse into .NET9
About .NET 8 and a first glimpse into .NET9About .NET 8 and a first glimpse into .NET9
About .NET 8 and a first glimpse into .NET9Jürgen Gutsch
 
Top Software Development Trends in 2024
Top Software Development Trends in  2024Top Software Development Trends in  2024
Top Software Development Trends in 2024Mind IT Systems
 
Kubernetes go-live checklist for your microservices.pptx
Kubernetes go-live checklist for your microservices.pptxKubernetes go-live checklist for your microservices.pptx
Kubernetes go-live checklist for your microservices.pptxPrakarsh -
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeNeo4j
 
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine HarmonyLeveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmonyelliciumsolutionspun
 
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...OnePlan Solutions
 
AI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyAI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyRaymond Okyere-Forson
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadIvo Andreev
 
ERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxAutus Cyber Tech
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampVICTOR MAESTRE RAMIREZ
 
Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesSoftwareMill
 
How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?AmeliaSmith90
 
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLAlluxio, Inc.
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Jaydeep Chhasatia
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntelliSource Technologies
 
Webinar - IA generativa e grafi Neo4j: RAG time!
Webinar - IA generativa e grafi Neo4j: RAG time!Webinar - IA generativa e grafi Neo4j: RAG time!
Webinar - IA generativa e grafi Neo4j: RAG time!Neo4j
 
JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIIvo Andreev
 
20240330_고급진 코드를 위한 exception 다루기
20240330_고급진 코드를 위한 exception 다루기20240330_고급진 코드를 위한 exception 다루기
20240330_고급진 코드를 위한 exception 다루기Chiwon Song
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilVICTOR MAESTRE RAMIREZ
 

Recently uploaded (20)

About .NET 8 and a first glimpse into .NET9
About .NET 8 and a first glimpse into .NET9About .NET 8 and a first glimpse into .NET9
About .NET 8 and a first glimpse into .NET9
 
Top Software Development Trends in 2024
Top Software Development Trends in  2024Top Software Development Trends in  2024
Top Software Development Trends in 2024
 
Kubernetes go-live checklist for your microservices.pptx
Kubernetes go-live checklist for your microservices.pptxKubernetes go-live checklist for your microservices.pptx
Kubernetes go-live checklist for your microservices.pptx
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG time
 
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine HarmonyLeveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
 
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
 
AI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyAI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human Beauty
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and Bad
 
ERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptx
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - Datacamp
 
Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retries
 
How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?
 
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptx
 
Webinar - IA generativa e grafi Neo4j: RAG time!
Webinar - IA generativa e grafi Neo4j: RAG time!Webinar - IA generativa e grafi Neo4j: RAG time!
Webinar - IA generativa e grafi Neo4j: RAG time!
 
Program with GUTs
Program with GUTsProgram with GUTs
Program with GUTs
 
JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AI
 
20240330_고급진 코드를 위한 exception 다루기
20240330_고급진 코드를 위한 exception 다루기20240330_고급진 코드를 위한 exception 다루기
20240330_고급진 코드를 위한 exception 다루기
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-Council
 

What is Reactive programming?

  • 1. What is Reactive Programming? An Overview of the Reactive Programming Paradigm
  • 3. “It’s time for web servers to handle ten thousand clients simultaneously.” –Dan Kegel: The C10k Problem, 1999
  • 4. Expectations in the year 2000 4 • Limited connectivity
  • 5. Expectations in the year 2000 5 • Limited connectivity • Snapshots of data on hard drives, centralized databases, etc
  • 6. Expectations in the year 2000 6 • Limited connectivity • Snapshots of data on hard drives, centralized databases, etc • Response times in seconds
  • 7. Expectations in the year 2000 7 • Limited connectivity • Snapshots of data on hard drives, centralized databases, etc • Response times in seconds • Downtime all the time
  • 8. Hardware in the year 2000 8 • A single machine with a single core
  • 9. Hardware in the year 2000 9 • A single machine with a single core • Limited networking — e.g, a mix of broadband, dialup internet, FidoNet
  • 10. Hardware in the year 2000 10 • A single machine with a single core • Limited networking — e.g, a mix of broadband, dialup internet, FidoNet • Expensive memory, CPU, hard drives
  • 11. Hardware in the year 2000 11 • A single machine with a single core • Limited networking — e.g, a mix of broadband, dialup internet, FidoNet • Expensive memory, CPU, hard drives • Small data
  • 12. “In 1999, one of the busiest FTP sites, cdrom.com, handled 10,000 clients simultaneously through a Gigabit Ethernet pipe.” –Dan Kegel: The C10k Problem, 1999
  • 13. Fast forward 14 years.
  • 14. Expectations have changed. Hardware has changed.
  • 15. Expectations in the year 2014 15 • Limited connectivity ⇨ always connected
  • 16. Expectations in the year 2014 16 • Limited connectivity ⇨ always connected • Snapshots of small data ⇨ real-time streams, distributed big data
  • 17. Expectations in the year 2014 17 • Limited connectivity ⇨ always connected • Snapshots of small data ⇨ real-time streams, distributed big data • Response times in seconds ⇨ response times in milli/microseconds
  • 18. Expectations in the year 2014 18 • Limited connectivity ⇨ always connected • Snapshots of small data ⇨ real-time streams, distributed big data • Response times in seconds ⇨ response times in milli/microseconds • Downtime all the time ⇨ downtime measured in seconds
  • 19. Hardware in the year 2014 19 • A single machine ⇨ clusters of machines
  • 20. Hardware in the year 2014 20 • A single machine ⇨ clusters of machines • A single core ⇨ multiple cores
  • 21. Hardware in the year 2014 21 • A single machine ⇨ clusters of machines • A single core ⇨ multiple cores • Slow networks ⇨ fast networks
  • 22. Hardware in the year 2014 22 • A single machine ⇨ clusters of machines • A single core ⇨ multiple cores • Slow networks ⇨ fast networks • Small data snapshots ⇨ big data streams
  • 23. “If one node can only serve 10,000 clients, the venture is cost-prohibitive from the start – just one million devices would require a fleet of 100 servers.” –Scott Andreas, Urban Airship
  • 24. In 2010, Urban Airship used Java NIO to successfully test 512,000+ concurrent connections on a single 2.5 GB EC2 instance.
  • 25. Realities of modern software development 25 • Applications are distributed by default
  • 26. Realities of modern software development 26 • Applications are distributed by default • Applications are composed from other applications
  • 27. Realities of modern software development 27 • Applications are distributed by default • Applications are composed from other applications • Performance expectations — a slow application is a dead application
  • 28. Realities of modern software development 28 • Applications are distributed by default • Applications are composed from other applications • Performance expectations — a slow application is a dead application • UIs must adapt to multiple screen sizes and types of input
  • 29. Realities of modern software development 29 • Applications are distributed by default • Applications are composed from other applications • Performance expectations — a slow application is a dead application • UIs must adapt to multiple screen sizes and types of input • Developers can no longer avoid parallelism and concurrency
  • 32. “MigratoryData scales up to 12 million concurrent users from a single Dell PowerEdge R610 server while pushing up to 1.015 Gbps live data (each user receives a 512-byte message every minute).” –Mihai Rotaru, 2013, discussing MigratoryData WebSocket server
  • 34. What is Reactive Programming?
  • 35. “Instead of the latest framework of the day or the latest buzzword, reactive brings the talk back to core principles; the design, the architecture, the way we think about building software.” –Jonas Bonér
  • 36. Core principles of reactive software 36 • React to events ⇨ Event-driven • React to load ⇨ Scalable • React to failure ⇨ Resilient • React to users ⇨ Responsive • Reactive ⇨ Event-driven, Scalable, Resilient, Responsive
  • 38. re·spon·sive ! “Reacting quickly and positively.” ! synonyms: quick to react to, reactive to, receptive to, open to suggestions about, amenable to, flexible to, sensitive to, sympathetic to
  • 39. Responsive — flexibility 39 Progressive UI enhancement • Never allow slow external dependencies to degrade the user experience Blue skies • Never assume blue skies, assume grey skies
  • 40. Responsive — quick to react 40 Beware of blocking IO! • Asynchronous — non-blocking, blocking • Synchronous — non-blocking, blocking • Do you know what type your web framework implements? Perceived quality • Perception of responsiveness is key, feel counts! • Never, ever perform blocking IO on the UI thread!
  • 41. Responsiveness ! Being quick to react to all users of a system — under blue skies and grey skies — in order to ensure a consistent experience.
  • 42. scal·able ! “Capable of being easily expanded or upgraded on demand.” ! synonyms: ascendable, climbable, extensible, expandable, expansible, adaptable, elastic, flexible
  • 43. Scalable 43 Important terms • Performance — a measure of your response time • Load — impacts performance if not handled properly Dealing with load • Scale up — faster CPU, more memory, bigger hard drive • Scale out — distribute work across nodes and clusters
  • 44. Scalability ! The capability of your system to be easily upgraded on demand in order to ensure responsiveness under various load conditions.
  • 45. re·sil·ient ! “Able to withstand or recover quickly from difficult conditions.” ! synonyms: strong, tough, hardy
  • 46. Resilient 46 Bulkheads • Partitioning — partition thread groups for different functionality Backpressure • Throttling — wait for a consumer to demand more work Circuit Breakers • Stability — Failing external dependencies shouldn’t bring down an entire app
  • 47. Resiliency ! The proper application of fundamental design and architecture principles to ensure responsiveness under grey skies.
  • 48. e·vent ! “Something that happens or is regarded as happening; an occurrence, especially one of some importance.” ! driv·en ! “Propelled or motivated by something.”
  • 49. Traditional concurrency models 49 Thread based concurrency with objects and shared state • Imperative, sequential execution • Most common programming paradigm • Threads for concurrency • Difficult to reason about, error-prone • Implementations — most OO based web frameworks, languages, and toolkits
  • 50. Traditional concurrency models 50 Software transactional memory (STM) • Immutable values • Atomicity, consistency, isolation and durability • Cannot perform any operation that cannot be undone, including (most) I/O • Think command pattern/interface • Implementations — Haskell STM (native), libs for Scala, Java, OCaml, Clojure, etc
  • 51. Share nothing concurrency 51 Event driven concurrency • Thread based event loops • Often single threaded • Implementations — Node.js, Twisted Python, EventMachine (Ruby)
  • 52. Share nothing concurrency 52 Actor based concurrency • Mutable state, but completely isolated • State only mutated by the actor • Asynchronous message passing between actors using mailboxes • Thread based actors or event based actors • Implementations — Erlang, Akka
  • 53. Event driven ! An event driven architecture forces programmers to deal with scalability and resilience at a code level in order to facilitate responsiveness.
  • 54. re·ac·tive ! “Responsive to stimulus.” ! synonyms: active, aware, conscious, receptive, sensitive, acknowledging, alive, answering
  • 56. A quick code example.
  • 57. A programmer had a problem. They thought to themselves, "I know, I'll solve it with threads". have Now problems two they. –@davidlohr
  • 58. Non-deterministic — mutable state, threads, locks 58 var a = foo.getB() + bar.getC()! System.out.println(a) // “42”! a = foo.getB() + bar.getC()! System.out.println(a) // Who knows?
  • 59. Non-deterministic — mutable state, threads, locks 59 var a = foo.getB() + bar.getC()! System.out.println(a) // “42”! a = foo.getB() + bar.getC()! System.out.println(a) // Who knows?! ! • The value of a may or may not still be 42 • Is another thread is mutating foo or bar? • Pull-based — getB() and getC() must be explicitly invoked • Later mutation to foo and bar doesn’t effect a • Based on time and space
  • 60. Why is non-determinism the root of all evil? 60 Key terms • Parallelism — when at least two threads are executing simultaneously • Concurrency — when at least two threads are making progress Mutable state + threads + locks • Code that is error prone and difficult to reason about • Extremely difficult to implement parallelism and concurrency with MuSTL
  • 61. Akka is a toolkit and runtime for building highly concurrent, distributed, and fault tolerant event-driven applications on the JVM.
  • 62. A simple Akka code example 62 class GameActor extends Actor {! def receive = {! case handshakeRequest: HandshakeRequest => ! sender ! computeHandshakeResponse(handshakeRequest)! case turnMessage: TurnMessage => ! sender ! computeTurnResponse(turnMessage) ! }! }! ! • Time, space, mutation ⇨ flow, events, messages
  • 63. Akka Actors 63 • Process messages asynchronously • Pattern match against message types • Focus on flow and values — not objects, threads, and locks • Higher-level of abstraction — easier to write concurrent, distributed systems • Think observable/observer and pub/sub • Influenced by the Erlang actor model
  • 64. Erlang has embraced the tenets of reactive programming since 1985.
  • 65. Erlang characteristics and use cases 65 • Share nothing architecture — processes cannot share data • Pure message passing — copy all the data you need in the messages • Crash detection and recovery — things will crash, so let them crash then recover
  • 66. Erlang characteristics and use cases 66 Popular Erlang Software • Wings 3D — 3D modelling • Ejabberd — instant messaging server • CouchDB — document database • RabbitMQ — enterprise-y messaging Erlang in Production • Ericsson — 3G mobile networks • Amazon — SimpleDB, EC2 • Facebook — back-end chat server • T-Mobile — SMS and authentication
  • 67. “Reactive looks back in history. It doesn't ignore the goldmine of knowledge that's been around for 30 to 40 years, but rather tries to bring it into new context.” –Jonas Bonér
  • 68. Sources and credits 68 • Jonas Bonér — Reactive Supply to Changing Demand • Joe Armstrong — K things I know about building Resilient Reactive Systems • Benjamin Erb — Concurrent Programming for Scalable Web Architectures • Rich Hickey — The Value of Values • Plus various talks, papers, books, blog posts, and tweets by… • Dean Wampler, Erik Meijer, Martin Odersky, Martin Thompson, etc
  • 69. ©Typesafe 2014 – All Rights Reserved