SlideShare a Scribd company logo
Asynchronous Design: 1M events per 
second – with Spring 
By Stuart Williams 
© 2014 SpringOne 2GX. All rights reserved. Do not distribute without permission.
Bio 
2 
Stuart Williams 
• Software Engineer at Pivotal 
– RTI project lead 
@pidster
What is this all about? 
• We built a product using Pivotal products 
• Learned some lessons 
• We found a few limitations & some room for 
improvement… 
• … but we addressed them & now things go faster. 
A lot faster. 
3
Dogfood 
• Built with Spring IO Platform 
• Boot, Data, Integration, Reactor, AMQP, SpEL, Shell (and a little Groovy) 
• GemFire 
• RabbitMQ 
4 
Spring 
Framework 
Spring 
Data 
Spring 
Integration 
Spring 
Reactor 
Spring 
AMQP 
Spring 
Hateoas 
Groovy 
Spring 
Boot
Questions for you 
• Heard of Spring Integration? 
• Tried it? 
• In production? 
• Heard of Reactor? 
• Tried it? 
• In production? 
5
RTI 
6
What is RTI? 
• RTI == ‘Real Time Intelligence’ 
• Stream processing application 
• Location based services 
• Analytics (e.g. network health) 
• Telecom network data 
• ‘Control plane’ is meta data 
• ‘User plane’ is actual data (30x more) 
• Rich data model 
7
Input Data Rates 
RTI* 
• 100k/s average 
• 120k/s daily peak 
• 1M/s annual peak 
8 
*Control-plane only, user-plane is 20x
Asynchronous design with Spring and RTI: 1M events per second
Input Data Rates 
RTI* 
• 100k/s baseline 
• >120k/s daily peak 
• >1M/s annual peak 
10 
*Control-plane only, user-plane is 20x 
Twitter** 
• 6k/s average 
• 9k/s daily peak 
• 30k/s large events 
**Source @catehstn 
twitter.com/catehstn/status/494918021358813184
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 multiple event rates 
11
More statistics… 
• 100k/s order of magnitude 
• 8,640,000,000 (per day) 
• An Integer based counter will ‘roll over’ in ~2 days 
• 400Mbps of raw data (‘control plane’) 
• 10Gbps NICs required to support traffic peaks 
• Logging! Any verbose errors can blow a disk away 
• Queues backing up == #fail 
12
Architecture 
13
Architecture 
14 
Analytics 
WAN 
Queue 
Ingester Ingest Grid Distribution 
Metrics 
Firehose 
AMQP 
HTTP HTTP
Architectural Challenges 
• Ingest 
• Responsibility 
• Micro-bursts 
• Infrastructure considerations 
• Compute 
• Memory 
• Disk 
• Network 
15
Architecture 
16 
Analytics 
WAN 
Queue 
Ingester Ingest Grid Distribution 
Metrics 
Firehose 
AMQP 
HTTP HTTP
Ingester Architecture 
17 
Ingester 
• Spring Integration 
• TCP Server 
• Transformer 
• Filters 
• Reactor Stream 
• GemFire client 
• Single process 
• Multiple protocols – different rates & sizes
Architecture 
18 
Analytics 
WAN 
Queue 
Ingester Ingest Grid Distribution 
Metrics 
Firehose 
AMQP 
HTTP HTTP
Analytics Architecture 
19 
Analytics • Reactor 
• SpEL evaluation 
• Hundreds of expression 
calculations per event 
• Collate across nodes 
• Output to File or AMQP
Architecture 
20 
Analytics 
WAN 
Queue 
Ingester Ingest Grid Distribution 
Metrics 
Firehose 
AMQP 
HTTP HTTP
Architecture 
21 
Distribution 
• Spring Integration 
• Enrichers 
• Filters 
• Reactor Stream 
• Output to File / AMQP / JDBC 
• Membership checks 
• LBS, opt-in’s
First Ingester solution 
22
Solution #1 – ‘Naïve’ proof of concept 
• Build codecs 
• More on this in John Davies’ “Big Data In Memory” talk later today… 
• Spring Integration (SI) pipeline 
• TCP Inbound Adapter 
• Transformer 
• Filters 
• Outbound adapter 
23
Solution #1 – ‘Naïve’ proof of concept 
24
Solution #1 results 
• Message UUID generation was slow! 
• SpEL-based method resolution was slow! 
• Standard Channels added overhead! 
• Single event output was slow! 
25
Ingester Mark 2 
26
Solution #2 – Use interfaces 
27
Solution #2 – Use interfaces 
• Use the IdGenerator interface 
• Use specific endpoint interfaces 
• … we’ll come back to SpEL … 
• Use a Chain 
• Use an Aggregator to build a batch 
28
Solution #2 results 
• IdGenerator helped a lot 
• Specific interfaces not recognised! 
• Using <int:chain helped 
• Aggregator helped, but is too slow 
• <int:tcp-inbound-adapter is too slow 
29
Many whiteboards later… 
30
Many whiteboards later… 
31
Working version 
32
Solution N 
33 
Message-only Filters 
Batcher 
Reference Data Filters 
GB 
IUPS 
IUCS 
A 
Radius/Diamete 
r 
4G
Working version 
• Netty / Reactor TCP 
• IdGenerator 
• Specific endpoint interfaces 
• Chain 
• Reactor Stream based batching 
• + many improvements & enhancements 
34
Roundup 
35
Spring Improvements 
• Performance 
• Spring Integration 
• SpEL 
• Reactor 
• Spring XD benefits from these upgrades 
36
Spring Integration 
37
Spring Integration 
• UUID generator 
• MessageBuilderFactory & MutableMessage 
• Dispatcher optimisation 
• SpEL parser caching 
• Counters are ‘long’ 
• Interfaces used directly – if you’re specific SI 
respects that 
38
Spring Expression Language 
• Compilation of expressions 
• Configuration options 
• SI just re-evaluates expressions 
• Trade-offs & limitations 
• Much, much faster 
39
SpEL demo 
40
Reactor 
• Drop-in replacements 
• Thread pools, dispatchers 
• TCP/UDP Server & Client 
• Much faster – lower resource utilisation 
• Stream API 
• Batching and other functionality 
• More about Reactor 
• Thu, 8.30am “Building Reactive Applications…” 
41
Batching endpoint code 
42
Summary 
• Spring Integration is much faster 
• Good performance means better resource 
utilisation 
• For cloud applications cost savings can be dramatic 
• Batching payloads makes a big difference 
• Many applications wait on network IO 
• Trade-off risk of data loss for performance 
• Reactor FTW 
43
Questions 
44
45 
Learn More. Stay Connected 
Tweet #rti #s2gx if you’d like to go faster 
@pidster 
“Big Data in Memory” 
John Davis – Trinity 1-2 4.30pm 
@springcentral | spring.io/video

More Related Content

PPTX
Serverless and AI: Orit Nissan-Messing, Iguazio, Serverless NYC 2018
PDF
Ml sprint16 thesis_intro
PPTX
Kubernetes as Orchestrator for A10 Lightning Controller
PDF
Передача состояния с iPhone на Apple Watch
PDF
How Credit Karma Makes Real-Time Decisions For 60 Million Users With Akka Str...
PDF
Cloud monitoring
PDF
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
PDF
How to Enable Industrial Decarbonization with Node-RED and InfluxDB
Serverless and AI: Orit Nissan-Messing, Iguazio, Serverless NYC 2018
Ml sprint16 thesis_intro
Kubernetes as Orchestrator for A10 Lightning Controller
Передача состояния с iPhone на Apple Watch
How Credit Karma Makes Real-Time Decisions For 60 Million Users With Akka Str...
Cloud monitoring
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
How to Enable Industrial Decarbonization with Node-RED and InfluxDB

What's hot (20)

PDF
Architecture for Scale [AppFirst]
PDF
Building a Modern, Scalable Cyber Intelligence Platform with Apache Kafka | J...
PDF
Bringing DevOps to Routing with evolved XR: an overview
PDF
Monitoring kubernetes across data center and cloud
PDF
Scalable and Reliable Logging at Pinterest
PPTX
Nagios Conference 2014 - Dorance Martinez Cortes - Customizing Nagios
PPTX
Distributed architecture in a cloud native microservices ecosystem
PDF
Flink at netflix paypal speaker series
PDF
Datadog- Monitoring In Motion
PPTX
What's new in log insight 3.3 presentation
PDF
Events and metrics the Lifeblood of Webops
PPTX
From Zero to Serverless
PDF
Netflix Cloud Platform and Open Source
PPTX
Intellias CQRS Framework
PDF
The Road Most Traveled: A Kafka Story | Heikki Nousiainen, Aiven
PDF
Network Infrastructure as Code with Chef and Cisco
PPTX
Icinga Camp Bangalore - Enterprise exceptions
PDF
Serverless Logging Architecture
PDF
Guaranteed Event Delivery with Kafka and NodeJS | Amitesh Madhur, Nutanix
PDF
Lessons from the field: Catalog of Kafka Deployments | Joseph Niemiec, Cloudera
Architecture for Scale [AppFirst]
Building a Modern, Scalable Cyber Intelligence Platform with Apache Kafka | J...
Bringing DevOps to Routing with evolved XR: an overview
Monitoring kubernetes across data center and cloud
Scalable and Reliable Logging at Pinterest
Nagios Conference 2014 - Dorance Martinez Cortes - Customizing Nagios
Distributed architecture in a cloud native microservices ecosystem
Flink at netflix paypal speaker series
Datadog- Monitoring In Motion
What's new in log insight 3.3 presentation
Events and metrics the Lifeblood of Webops
From Zero to Serverless
Netflix Cloud Platform and Open Source
Intellias CQRS Framework
The Road Most Traveled: A Kafka Story | Heikki Nousiainen, Aiven
Network Infrastructure as Code with Chef and Cisco
Icinga Camp Bangalore - Enterprise exceptions
Serverless Logging Architecture
Guaranteed Event Delivery with Kafka and NodeJS | Amitesh Madhur, Nutanix
Lessons from the field: Catalog of Kafka Deployments | Joseph Niemiec, Cloudera
Ad

Viewers also liked (20)

PPTX
Virtualizing Latency Sensitive Workloads and vFabric GemFire
PDF
Development of concurrent services using In-Memory Data Grids
PPTX
Geode Meetup Apachecon
PDF
IMCSummit 2015 - 1 IT Business - The Evolution of Pivotal Gemfire
PPT
Gemfire
PDF
Introduction tomcat7 servlet3
PPTX
Ob1k presentation at Java.IL
PDF
Enterprise(d) Tomcat & httpd
PPTX
Websockets on the JVM: Atmosphere to the rescue!
PPTX
GemFire In Memory Data Grid
PPT
Multithreading, Blocking IO and Async IO
PPTX
Fastest Servlets in the West
PPTX
An Introduction to Apache Geode (incubating)
PPT
Async IO and Multithreading explained
PPT
Knowledge Sharing : Java Servlet
PDF
Reactor 3.0, a reactive foundation for java 8 and Spring
PPT
Auxiliary : Tomcat
PPTX
Async servlets
PDF
Scaling Twitter
PDF
Introduction to Apache Tomcat 7 Presentation
Virtualizing Latency Sensitive Workloads and vFabric GemFire
Development of concurrent services using In-Memory Data Grids
Geode Meetup Apachecon
IMCSummit 2015 - 1 IT Business - The Evolution of Pivotal Gemfire
Gemfire
Introduction tomcat7 servlet3
Ob1k presentation at Java.IL
Enterprise(d) Tomcat & httpd
Websockets on the JVM: Atmosphere to the rescue!
GemFire In Memory Data Grid
Multithreading, Blocking IO and Async IO
Fastest Servlets in the West
An Introduction to Apache Geode (incubating)
Async IO and Multithreading explained
Knowledge Sharing : Java Servlet
Reactor 3.0, a reactive foundation for java 8 and Spring
Auxiliary : Tomcat
Async servlets
Scaling Twitter
Introduction to Apache Tomcat 7 Presentation
Ad

Similar to Asynchronous design with Spring and RTI: 1M events per second (20)

PPTX
Apache frameworks for Big and Fast Data
ODP
Javantura v3 - Real-time BigData ingestion and querying of aggregated data – ...
PDF
Reactive Microservices with Spring 5: WebFlux
PDF
Dataservices: Processing (Big) Data the Microservice Way
PPTX
Architectures, Frameworks and Infrastructure
PPTX
Sweet Streams (Are made of this)
PPTX
Lessons From HPE: From Batch To Streaming For 20 Billion Sensors With Lightbe...
PPTX
Siddhi: A Second Look at Complex Event Processing Implementations
PDF
Springone2gx 2014 Reactive Streams and Reactor
PPTX
Realtime Detection of DDOS attacks using Apache Spark and MLLib
PDF
Stream Processing with CompletableFuture and Flow in Java 9
PPTX
Потоковая обработка больших данных
PDF
Spring I/O Barcelona '19 Recap
PDF
Java & JavaScipt Reactive Robotics and IoT 2016 @ jProfessionals
PDF
Microservices with Spring 5 Webflux - jProfessionals
PDF
Ruslan Belkin And Sean Dawson on LinkedIn's Network Updates Uncovered
PDF
ADV Slides: Trends in Streaming Analytics and Message-oriented Middleware
PDF
Evolution of the Netflix API
PDF
Developing real-time data pipelines with Spring and Kafka
PDF
Modern real-time streaming architectures
Apache frameworks for Big and Fast Data
Javantura v3 - Real-time BigData ingestion and querying of aggregated data – ...
Reactive Microservices with Spring 5: WebFlux
Dataservices: Processing (Big) Data the Microservice Way
Architectures, Frameworks and Infrastructure
Sweet Streams (Are made of this)
Lessons From HPE: From Batch To Streaming For 20 Billion Sensors With Lightbe...
Siddhi: A Second Look at Complex Event Processing Implementations
Springone2gx 2014 Reactive Streams and Reactor
Realtime Detection of DDOS attacks using Apache Spark and MLLib
Stream Processing with CompletableFuture and Flow in Java 9
Потоковая обработка больших данных
Spring I/O Barcelona '19 Recap
Java & JavaScipt Reactive Robotics and IoT 2016 @ jProfessionals
Microservices with Spring 5 Webflux - jProfessionals
Ruslan Belkin And Sean Dawson on LinkedIn's Network Updates Uncovered
ADV Slides: Trends in Streaming Analytics and Message-oriented Middleware
Evolution of the Netflix API
Developing real-time data pipelines with Spring and Kafka
Modern real-time streaming architectures

Recently uploaded (20)

PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
System and Network Administration Chapter 2
PDF
Nekopoi APK 2025 free lastest update
PPTX
L1 - Introduction to python Backend.pptx
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
System and Network Administraation Chapter 3
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Online Work Permit System for Fast Permit Processing
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
history of c programming in notes for students .pptx
PDF
How Creative Agencies Leverage Project Management Software.pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
System and Network Administration Chapter 2
Nekopoi APK 2025 free lastest update
L1 - Introduction to python Backend.pptx
CHAPTER 2 - PM Management and IT Context
System and Network Administraation Chapter 3
Softaken Excel to vCard Converter Software.pdf
Understanding Forklifts - TECH EHS Solution
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Design an Analysis of Algorithms I-SECS-1021-03
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Online Work Permit System for Fast Permit Processing
2025 Textile ERP Trends: SAP, Odoo & Oracle
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Internet Downloader Manager (IDM) Crack 6.42 Build 41
history of c programming in notes for students .pptx
How Creative Agencies Leverage Project Management Software.pdf

Asynchronous design with Spring and RTI: 1M events per second

  • 1. Asynchronous Design: 1M events per second – with Spring By Stuart Williams © 2014 SpringOne 2GX. All rights reserved. Do not distribute without permission.
  • 2. Bio 2 Stuart Williams • Software Engineer at Pivotal – RTI project lead @pidster
  • 3. What is this all about? • We built a product using Pivotal products • Learned some lessons • We found a few limitations & some room for improvement… • … but we addressed them & now things go faster. A lot faster. 3
  • 4. Dogfood • Built with Spring IO Platform • Boot, Data, Integration, Reactor, AMQP, SpEL, Shell (and a little Groovy) • GemFire • RabbitMQ 4 Spring Framework Spring Data Spring Integration Spring Reactor Spring AMQP Spring Hateoas Groovy Spring Boot
  • 5. Questions for you • Heard of Spring Integration? • Tried it? • In production? • Heard of Reactor? • Tried it? • In production? 5
  • 7. What is RTI? • RTI == ‘Real Time Intelligence’ • Stream processing application • Location based services • Analytics (e.g. network health) • Telecom network data • ‘Control plane’ is meta data • ‘User plane’ is actual data (30x more) • Rich data model 7
  • 8. Input Data Rates RTI* • 100k/s average • 120k/s daily peak • 1M/s annual peak 8 *Control-plane only, user-plane is 20x
  • 10. Input Data Rates RTI* • 100k/s baseline • >120k/s daily peak • >1M/s annual peak 10 *Control-plane only, user-plane is 20x Twitter** • 6k/s average • 9k/s daily peak • 30k/s large events **Source @catehstn twitter.com/catehstn/status/494918021358813184
  • 11. 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 multiple event rates 11
  • 12. More statistics… • 100k/s order of magnitude • 8,640,000,000 (per day) • An Integer based counter will ‘roll over’ in ~2 days • 400Mbps of raw data (‘control plane’) • 10Gbps NICs required to support traffic peaks • Logging! Any verbose errors can blow a disk away • Queues backing up == #fail 12
  • 14. Architecture 14 Analytics WAN Queue Ingester Ingest Grid Distribution Metrics Firehose AMQP HTTP HTTP
  • 15. Architectural Challenges • Ingest • Responsibility • Micro-bursts • Infrastructure considerations • Compute • Memory • Disk • Network 15
  • 16. Architecture 16 Analytics WAN Queue Ingester Ingest Grid Distribution Metrics Firehose AMQP HTTP HTTP
  • 17. Ingester Architecture 17 Ingester • Spring Integration • TCP Server • Transformer • Filters • Reactor Stream • GemFire client • Single process • Multiple protocols – different rates & sizes
  • 18. Architecture 18 Analytics WAN Queue Ingester Ingest Grid Distribution Metrics Firehose AMQP HTTP HTTP
  • 19. Analytics Architecture 19 Analytics • Reactor • SpEL evaluation • Hundreds of expression calculations per event • Collate across nodes • Output to File or AMQP
  • 20. Architecture 20 Analytics WAN Queue Ingester Ingest Grid Distribution Metrics Firehose AMQP HTTP HTTP
  • 21. Architecture 21 Distribution • Spring Integration • Enrichers • Filters • Reactor Stream • Output to File / AMQP / JDBC • Membership checks • LBS, opt-in’s
  • 23. Solution #1 – ‘Naïve’ proof of concept • Build codecs • More on this in John Davies’ “Big Data In Memory” talk later today… • Spring Integration (SI) pipeline • TCP Inbound Adapter • Transformer • Filters • Outbound adapter 23
  • 24. Solution #1 – ‘Naïve’ proof of concept 24
  • 25. Solution #1 results • Message UUID generation was slow! • SpEL-based method resolution was slow! • Standard Channels added overhead! • Single event output was slow! 25
  • 27. Solution #2 – Use interfaces 27
  • 28. Solution #2 – Use interfaces • Use the IdGenerator interface • Use specific endpoint interfaces • … we’ll come back to SpEL … • Use a Chain • Use an Aggregator to build a batch 28
  • 29. Solution #2 results • IdGenerator helped a lot • Specific interfaces not recognised! • Using <int:chain helped • Aggregator helped, but is too slow • <int:tcp-inbound-adapter is too slow 29
  • 33. Solution N 33 Message-only Filters Batcher Reference Data Filters GB IUPS IUCS A Radius/Diamete r 4G
  • 34. Working version • Netty / Reactor TCP • IdGenerator • Specific endpoint interfaces • Chain • Reactor Stream based batching • + many improvements & enhancements 34
  • 36. Spring Improvements • Performance • Spring Integration • SpEL • Reactor • Spring XD benefits from these upgrades 36
  • 38. Spring Integration • UUID generator • MessageBuilderFactory & MutableMessage • Dispatcher optimisation • SpEL parser caching • Counters are ‘long’ • Interfaces used directly – if you’re specific SI respects that 38
  • 39. Spring Expression Language • Compilation of expressions • Configuration options • SI just re-evaluates expressions • Trade-offs & limitations • Much, much faster 39
  • 41. Reactor • Drop-in replacements • Thread pools, dispatchers • TCP/UDP Server & Client • Much faster – lower resource utilisation • Stream API • Batching and other functionality • More about Reactor • Thu, 8.30am “Building Reactive Applications…” 41
  • 43. Summary • Spring Integration is much faster • Good performance means better resource utilisation • For cloud applications cost savings can be dramatic • Batching payloads makes a big difference • Many applications wait on network IO • Trade-off risk of data loss for performance • Reactor FTW 43
  • 45. 45 Learn More. Stay Connected Tweet #rti #s2gx if you’d like to go faster @pidster “Big Data in Memory” John Davis – Trinity 1-2 4.30pm @springcentral | spring.io/video