SlideShare a Scribd company logo
1 of 46
Reactive Application Design
For High-Volume Multi-
dimensional Temporal Data
Series
@pidster
InfoQ.com: News & Community Site
• 750,000 unique visitors/month
• Published in 4 languages (English, Chinese, Japanese and Brazilian
Portuguese)
• Post content from our QCon conferences
• News 15-20 / week
• Articles 3-4 / week
• Presentations (videos) 12-15 / week
• Interviews 2-3 / week
• Books 1 / month
Watch the video with slide
synchronization on InfoQ.com!
http://www.infoq.com/presentations
/reactive-app-design-spring
Presented at QCon London
www.qconlondon.com
Purpose of QCon
- to empower software development by facilitating the spread of
knowledge and innovation
Strategy
- practitioner-driven conference designed for YOU: influencers of
change and innovation in your teams
- speakers and topics driving the evolution and innovation
- connecting and catalyzing the influencers and innovators
Highlights
- attended by more than 12,000 delegates since 2007
- held in 9 cities worldwide
Stuart Williams == ‘Pid’
• Lead Engineer, RTI
• SpringSource / VMware / Pivotal
• A little OSS: Apache, Eclipse
@pidster
Mumbling Isn’t a Sign of
Laziness — It’s a Clever
Data-Compression Trick
Source: http://nautil.us/blog/mumbling-isnt-a-sign-of-lazinessits-a-clever-
data_compression-trick
Practical
• We built a real-time* application (RTI)
– Using Spring (yes! I know!)
– Share some lessons
– Do some demos
– Reveal a secret go-faster switch!
* for some definition of real-time
Built with…
• Spring IO Platform
– Boot, Data, Integration, Reactor, AMQP,
SpEL, Shell (and a little Groovy)
• GemFire, RabbitMQ
• C24
Questions…
• Do you know your system load & input rates?
– No.
– Yes!
• Up to 1k/s?
• Up to 5k/s?
• Up to 10k/s?
• Up to 100k/s?
• Up to 1M/s?
• Above 1M/s?
Questions…
• Heard of Spring Integration?
– Tried it?
– Used it in production?
• Heard of Spring Reactor?
– Tried it?
– Used it in production?
DESIGN
Some discussion about…
Design Goals & Challenges
• High throughput
– versus
• Low latency
• Enable low-impact analysis on live streams
– We don’t know in advance what this will be…
– User accessible API for analytics
Many whiteboards later…
BIG PICTURE!
Show me the…
The Big Picture
Ingester Ingest Grid Distribution
Analytics
Stream
AMQP
Metrics
Firehose
HTTPHTTP
Databases
Analytics
Queries
Queries
- Unstructured
- Structured
Query, Adapt, React
feedback loop
Reactive
expressions
End User
Applications
Ingestion
& Filtering
Analytics &
Distribution
End-user /
Consumers
Input Data Rates
RTI
 100k/s baseline
 ~120k/s daily peak
 >1M/s annual peak
Twitter*
 6k/s average
 9k/s daily peak
 30k/s large events
**Source @catehstn
twitter.com/catehstn/status/494918021358813184
OK, so Twitter’s internal fan-out & timeline access
rates & storage problems are vastly different!
(see also Redis…)
Load Characteristics
 Low numbers of inbound connections
 High rates, micro-bursts
 Occasional peaks of nearly 2x, rare peaks of 10x
 Variable payload size (200B – 300KB)
 Internal fan-outs multiply event rates
More statistics…
 100k/s order of magnitude
– 8,640,000,000 (per day)
– An Integer based counter will ‘roll over’ in ~3 days
 400Mbps of raw data
– 10Gbps NICs required to support traffic peaks
– Logging! Verbose errors can fill a disk quickly
– Queues backing up == #fail
 Upcoming 10x existing rates!
REACTIVE APPLICATIONS?
What’s all this fuss about…
Reactive Applications
www.reactivemanifesto.org
Responsive
ResilientScalable
Event (or message) driven
Depends on
Depends on
Reactive Streams
• Collaboration between key industry players
18
Reactive Streams: Specification
19
• Semantics
– Single document listing all rules
– Open enough to allow for various patterns
• 4 API interfaces
• TCK to verify implementation behaviour
Reactive Streams
github.com/reactive-streams
org.reactivestreams.Processor
org.reactivestreams.Publisher
org.reactivestreams.Subscriber
org.reactivestreams.Subscription
REACTIVE STREAMS API
A quick look at the…
Spring Reactor
LMAX Disruptor – a RingBuffer
reactor.bus.EventBus
reactor.core.Dispatcher
reactor.rx.Stream
REACTOR API
A quick look at the…
Spring Integration
Enterprise Integration Patterns
See http://www.enterpriseintegrationpatterns.com/ by Hohpe & Woolf
Messages
Channels
Endpoints
(pipes & filters architecture)
SI Pipeline Example
SPRING INTEGRATION JAVA DSL
A quick look at the…
Spring Integration Performance
• 3.x
– Take out all the SpEL
• 4.x
– 4.0
• Improved
– 4.1 (Q4 2014)
• Put back all the SpEL
– 4.2 (late 2015)
• Rather good
BIG PICTURE AGAIN
Back to the…
The Big Picture
Ingester Ingest Grid Distribution
Analytics
Stream
AMQP
Metrics
Firehose
HTTPHTTP
Databases
Analytics
Queries
Queries
- Unstructured
- Structured
Query, Adapt, React
feedback loop
Reactive
expressions
End User
Applications
Ingestion
& Filtering
Analytics &
Distribution
End-user /
Consumers
Key Reactor usages
Reactor Usage
• UDP/TCP Servers (or clients)
• Outputs – batching
• Dispatchers & Streams
– Expression evaluation engine
Spring Integration + Reactor
• Batching
– Adaptive sizing
• Routing
– With … batching
SPRING INTEGRATION + REACTOR
An example or two…
TEMPORAL DATA SERIES?
But what about the…
Temporal Data
RingBuffer
New DataOld Data
Expressions
SECRET ‘GO-FASTER’ SWITCH?
And there was something about a…
Spring Expression Language
(SpEL)
• Powerful expression language
• Supports querying and manipulating an object
graph at runtime
• Similar to Unified EL
– Additional features, include method invocation
and string templating.
SpEL is slow!

Enter SpEL Compilation
• 3 modes
– Immediate
– Mixed
– Off
• -Dspring.expression.compiler.mode=mixed
SPEL DEMO
And now for a quick
SpEL is fast!

Fin
And relax
QUESTIONS?
And now for some…
@pidster @smaldini
Watch the video with slide synchronization on
InfoQ.com!
http://www.infoq.com/presentations/reactive-
app-design-spring

More Related Content

Viewers also liked

Why Domain-Driven Design and Reactive Programming?
Why Domain-Driven Design and Reactive Programming?Why Domain-Driven Design and Reactive Programming?
Why Domain-Driven Design and Reactive Programming?
VMware Tanzu
 

Viewers also liked (7)

Why Domain-Driven Design and Reactive Programming?
Why Domain-Driven Design and Reactive Programming?Why Domain-Driven Design and Reactive Programming?
Why Domain-Driven Design and Reactive Programming?
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examples
 
DevOps
DevOpsDevOps
DevOps
 
Intro to Reactive Programming
Intro to Reactive ProgrammingIntro to Reactive Programming
Intro to Reactive Programming
 
DevOps: A Culture Transformation, More than Technology
DevOps: A Culture Transformation, More than TechnologyDevOps: A Culture Transformation, More than Technology
DevOps: A Culture Transformation, More than Technology
 
Introducing DevOps
Introducing DevOpsIntroducing DevOps
Introducing DevOps
 
DevOps 101
DevOps 101DevOps 101
DevOps 101
 

More from C4Media

More from C4Media (20)

Streaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoStreaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live Video
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy Mobile
 
Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java Applications
 
Kafka Needs No Keeper
Kafka Needs No KeeperKafka Needs No Keeper
Kafka Needs No Keeper
 
High Performing Teams Act Like Owners
High Performing Teams Act Like OwnersHigh Performing Teams Act Like Owners
High Performing Teams Act Like Owners
 
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
 
Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate Guide
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CD
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine Learning
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at Speed
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep Systems
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.js
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly Compiler
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix Scale
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's Edge
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home Everywhere
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing For
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data Engineering
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

Reactive Application Design for High Volume Multi-dimensional Temporal Data Series