SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
BW5	
Concurrent	Session	
11/8/17	1:30	PM	
	
	
	
	
	
Leverage	Streaming	Data	in	a	
Microservices	Ecosystem	
	
Presented	by:	
	
Mark	Richards		
Independent	Consultant	
	
Brought	to	you	by:		
		
	
	
	
	
350	Corporate	Way,	Suite	400,	Orange	Park,	FL	32073		
888---268---8770	··	904---278---0524	-	info@techwell.com	-	https://www.techwell.com/
Mark	Richards		
Independent	Consultant	
	
In	the	software	industry	since	1983,	Mark	Richards	is	an	experienced,	hands-on	
software	architect	involved	in	the	architecture,	design,	and	implementation	of	
microservices	architectures,	service-oriented	architectures,	and	distributed	
systems.	He	has	significant	experience	and	expertise	in	application,	integration,	
and	enterprise	architecture.	Mark	is	the	author	of	O'Reilly	books	on	
microservices;	the	Software	Architecture	Fundamentals	video	series;	Enterprise	
Messaging	video	series;	Java	Message	Service,	2nd	Edition;	and	a	contributing	
author	to	97	Things	Every	Software	Architect	Should	Know.	Mark	is	a	frequent	
speaker	on	enterprise-related	technical	topics	at	conferences	and	user	groups	
worldwide.	www.wmrichards.com
NFJS Software Symposium Series 2016
Author of Software Architecture Fundamentals Video Series (O’Reilly)

Author of Microservices Pitfalls and AntiPatterns (O’Reilly)

Author of Microservices vs. Service-Oriented Architecture (O’Reilly)

Author of Enterprise Messaging Video Series (O’Reilly)

Author of Java Message Service 2nd Edition (O’Reilly)
Independent	Consultant	
Hands-on	So*ware	Architect	
Published	Author	/	Conference	Speaker	
www.wmrichards.com
Mark	Richards
Leveraging Streaming Data in a
Microservices Ecosystem
agenda
kafka producers and consumers
streaming architecture patterns
real-world examples of streaming data
kafka vs. standard messaging
kafka overview
https://github.com/wmr513/streaming
source code
Streaming Architecture
Patterns
streaming architecture patterns
service
service
service
analytics
capture
service
service
service
analytics
capture
streaming architecture patterns
very high data volume and
throughput rate
streaming architecture patterns
data loss is acceptable
streaming architecture patterns
data duplication is acceptable
streaming architecture patterns
not all data needs to be
persisted
streaming architecture patterns
streaming architecture patterns
service
capture and store
filter and store
analyze and store
Kafka Overview
kafka overview
publish and subscribe hybrid messaging model
messages are always persisted in a partitioned file by topics
message throughput can be upwards to 1,000,000+/sec
record size (bytes)
throughput(records/second)
200K
400K
600K
800K
1K10 100K10K100
kafka overview
topic structure
partition 0
producer
consumer 1 consumer 2
msg
4
msg
1
msg
2
msg
3
msg
5
msg
6
msg
7
offset 0offset 1offset 2offset 3 offset 3offset 4offset 5
…
kafka overview
topic structure
partition 0
msg
8
msg
1
msg
2
msg
4
msg
9
msg
11
partition 1
msg
3
msg
7
msg
10
partition 2
msg
13
msg
5
msg
6
msg
12
msg
14
msg
15
msg
16
msg
17
msg
18
msg
19
producer
Kafka Producers and
Consumers
kafka producers and consumers
service
(producer)
client
metrics
(consumer)
offsets (0.11)
service
(producer)
kafka producers and consumers
client
metrics
(consumer)
offsets (0.11)
kafka producers and consumers
Properties props = new Properties();
props.put("bootstrap.servers", "localhost:9092");
props.put("key.serializer", "…kafka…StringSerializer");
props.put("value.serializer", "…kafka…StringSerializer");
KafkaProducer<String, String> producer =
new KafkaProducer<String, String>(props);
String topic = "customer_comment_service_metrics";
String key = "duration";
String value = "320";
ProducerRecord<String, String> msg =
new ProducerRecord<>(topic, key, value);
producer.send(msg);
producer.flush();
producer.close(); messages are sent in a batch
within a separate thread
service (producer)
kafka producers and consumers
client
service
(producer)
metrics
(consumer)
offsets (0.11)
kafka producers and consumers
Properties props = new Properties();
props.put("bootstrap.servers", "localhost:9092");
props.put("group.id", "CG1");
props.put("key.deserializer", "…kafka…StringDeserializer");
props.put("value.deserializer", "…kafka…StringDeserializer");
KafkaConsumer<String, String> consumer =
new KafkaConsumer<String, String>(props);
consumer.subscribe(Arrays.asList(
"customer_comment_service_metrics"));
metrics (consumer)
kafka producers and consumers
try {
while (true) {
ConsumerRecords<String, String> msgs = consumer.poll(100);
for (ConsumerRecord<String, String> msg : msgs) {
System.out.println("topic: " + msg.topic());
System.out.println("key: " + msg.key());
System.out.println("value: " + msg.value());
System.out.println("partition: " + msg.partition());
System.out.println("offset: " + msg.offset());
}
} finally {
consumer.close();
}
metrics (consumer)
we are using auto commit of
our offset sync point (5 sec)
kafka producers and consumers
try {
while (true) {
ConsumerRecords<String, String> msgs = consumer.poll(100);
for (ConsumerRecord<String, String> msg : msgs) {
System.out.println("topic: " + msg.topic());
System.out.println("key: " + msg.key());
System.out.println("value: " + msg.value());
System.out.println("partition: " + msg.partition());
System.out.println("offset: " + msg.offset());
}
try {
consumer.commitSync();
} catch (CommitFailedException e) {
log.error("rats - I have no idea what to do now!");
}
} finally {
consumer.close();
}
metrics (consumer)
kafka producers and consumers
Real-World Examples of
Streaming Data
microservices metrics analytics
trade
generator
trade
validation
microservices metrics analytics
trade
generator
trade
validation
metrics
analyzer
trade_validation_service_metrics
trade_gen_service_metrics
microservices metrics analytics
trade
validation trade_validation_service_metrics
trade_gen_service_metrics
trade
generator
metrics
analyzer
threshold
analyzer
microservices metrics analytics
trade
validation trade_validation_service_metrics
trade_gen_service_metrics
trade
generator
metrics
analyzer
threshold
analyzer
trade_gen_service_error
error
analyzer
microservices metrics analytics
trade
validation trade_validation_service_metrics
trade_gen_service_metrics
trade
generator
metrics
analyzer
threshold
analyzer
trade_gen_service_error
error
analyzer
trade_gen_service_symbol
symbol
analyzer
microservices metrics analytics
trade
validation trade_validation_service_metrics
trade_gen_service_metrics
trade
generator
metrics
analyzer
threshold
analyzer
trade_gen_service_error
error
analyzer
trade_gen_service_symbol
symbol
analyzer
Kafka vs. Messaging
primary data type
throughput
payload
data loss
data duplication
msg confirmation
operational data transactional data
up to 1 million/sec up to 4K/sec (10K/sec)
single name/value pair aggregate data
possible* rare
possible* rare
consumer managed broker managed
apache kafka vs. standard messaging
* StreamsAPI significantly reduces data loss and duplication
load balancing
message order
msg properties
messaging models
msg persistence
supported supported
consumer control preserved (fifo)*
supported** supported
pub/sub pub/sub, p2p, hybrid
always optional
guaranteed delivery not supported** supported
apache kafka vs. standard messaging
** StreamsAPI provides some support for these
* use of message priority can change message order
Summary
NFJS Software Symposium Series 2016
Author of Software Architecture Fundamentals Video Series (O’Reilly)

Author of Microservices Pitfalls and AntiPatterns (O’Reilly)

Author of Microservices vs. Service-Oriented Architecture (O’Reilly)

Author of Enterprise Messaging Video Series (O’Reilly)

Author of Java Message Service 2nd Edition (O’Reilly)
Independent	Consultant	
Hands-on	So*ware	Architect	
Published	Author	/	Conference	Speaker	
www.wmrichards.com
Mark	Richards
Leveraging Streaming Data in a
Microservices Ecosystem

Weitere ähnliche Inhalte

Ähnlich wie Leverage Streaming Data in a Microservices Ecosystem

KarRox Oman IT Launch -2010
KarRox Oman IT Launch -2010KarRox Oman IT Launch -2010
KarRox Oman IT Launch -2010
sandipdatta95
 

Ähnlich wie Leverage Streaming Data in a Microservices Ecosystem (20)

Composition and Execution of Secure Workflows in WSRF-Grids, IEEE CCGrid 2008...
Composition and Execution of Secure Workflows in WSRF-Grids, IEEE CCGrid 2008...Composition and Execution of Secure Workflows in WSRF-Grids, IEEE CCGrid 2008...
Composition and Execution of Secure Workflows in WSRF-Grids, IEEE CCGrid 2008...
 
The hidden engineering behind machine learning products at Helixa
The hidden engineering behind machine learning products at HelixaThe hidden engineering behind machine learning products at Helixa
The hidden engineering behind machine learning products at Helixa
 
Mysql python
Mysql pythonMysql python
Mysql python
 
Mysql python
Mysql pythonMysql python
Mysql python
 
WCF and WF in Framework 3.5
WCF and WF in Framework 3.5WCF and WF in Framework 3.5
WCF and WF in Framework 3.5
 
IBM Insight 2015 - 1824 - Using Bluemix and dashDB for Twitter Analysis
IBM Insight 2015 - 1824 - Using Bluemix and dashDB for Twitter AnalysisIBM Insight 2015 - 1824 - Using Bluemix and dashDB for Twitter Analysis
IBM Insight 2015 - 1824 - Using Bluemix and dashDB for Twitter Analysis
 
Preparing for distributed system failures using akka #ScalaMatsuri
Preparing for distributed system failures using akka #ScalaMatsuriPreparing for distributed system failures using akka #ScalaMatsuri
Preparing for distributed system failures using akka #ScalaMatsuri
 
TAXTRON Profile_PDF
TAXTRON Profile_PDFTAXTRON Profile_PDF
TAXTRON Profile_PDF
 
Windows 2008 R2 &amp; Windows7
Windows 2008 R2 &amp; Windows7Windows 2008 R2 &amp; Windows7
Windows 2008 R2 &amp; Windows7
 
KarRox Oman IT Launch -2010
KarRox Oman IT Launch -2010KarRox Oman IT Launch -2010
KarRox Oman IT Launch -2010
 
Building Event-Driven (Micro) Services with Apache Kafka
Building Event-Driven (Micro) Services with Apache KafkaBuilding Event-Driven (Micro) Services with Apache Kafka
Building Event-Driven (Micro) Services with Apache Kafka
 
Building and Managing your Virtual Datacenter using PowerShell DSC - Florin L...
Building and Managing your Virtual Datacenter using PowerShell DSC - Florin L...Building and Managing your Virtual Datacenter using PowerShell DSC - Florin L...
Building and Managing your Virtual Datacenter using PowerShell DSC - Florin L...
 
Performance is a Feature!
Performance is a Feature!Performance is a Feature!
Performance is a Feature!
 
6° Sessione - Ambiti applicativi nella ricerca di tecnologie statistiche avan...
6° Sessione - Ambiti applicativi nella ricerca di tecnologie statistiche avan...6° Sessione - Ambiti applicativi nella ricerca di tecnologie statistiche avan...
6° Sessione - Ambiti applicativi nella ricerca di tecnologie statistiche avan...
 
Develop Python Applications with MySQL Connector/Python
Develop Python Applications with MySQL Connector/PythonDevelop Python Applications with MySQL Connector/Python
Develop Python Applications with MySQL Connector/Python
 
Performance is a Feature! at DDD 11
Performance is a Feature! at DDD 11Performance is a Feature! at DDD 11
Performance is a Feature! at DDD 11
 
Azure from scratch part 4
Azure from scratch part 4Azure from scratch part 4
Azure from scratch part 4
 
OneTeam Media Server
OneTeam Media ServerOneTeam Media Server
OneTeam Media Server
 
Security Architecture Consulting - Hiren Shah
Security Architecture Consulting - Hiren ShahSecurity Architecture Consulting - Hiren Shah
Security Architecture Consulting - Hiren Shah
 
IT PRO | Connections 2020 : Introduction to Logic Apps and automation solutio...
IT PRO | Connections 2020 : Introduction to Logic Apps and automation solutio...IT PRO | Connections 2020 : Introduction to Logic Apps and automation solutio...
IT PRO | Connections 2020 : Introduction to Logic Apps and automation solutio...
 

Mehr von TechWell

Mehr von TechWell (20)

Failing and Recovering
Failing and RecoveringFailing and Recovering
Failing and Recovering
 
Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization
 
Test Design for Fully Automated Build Architecture
Test Design for Fully Automated Build ArchitectureTest Design for Fully Automated Build Architecture
Test Design for Fully Automated Build Architecture
 
System-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good StartSystem-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good Start
 
Build Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test StrategyBuild Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test Strategy
 
Testing Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for SuccessTesting Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for Success
 
Implement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlowImplement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlow
 
Develop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your SanityDevelop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your Sanity
 
Ma 15
Ma 15Ma 15
Ma 15
 
Eliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps StrategyEliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps Strategy
 
Transform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOpsTransform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOps
 
The Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—LeadershipThe Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—Leadership
 
Resolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile TeamsResolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile Teams
 
Pin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile GamePin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile Game
 
Agile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile TeamsAgile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile Teams
 
A Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps ImplementationA Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps Implementation
 
Databases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery ProcessDatabases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery Process
 
Mobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to AutomateMobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to Automate
 
Cultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for SuccessCultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for Success
 
Turn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile TransformationTurn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile Transformation
 

Kürzlich hochgeladen

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
anilsa9823
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Kürzlich hochgeladen (20)

A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 

Leverage Streaming Data in a Microservices Ecosystem