SlideShare ist ein Scribd-Unternehmen logo
1 von 14
How to spread information between services? (I)
Traditionally, a direct call from the producer to the consumer/s inside the
producer service logic is performed. This approach has several drawbacks:
• Caller lack of knowledge of the external services.
• Complex logic when trying to ensure data consistency.
• Caller needs to know if the consumer/s can process information as quick as it is
produced (max. throughput)
• Etc.
How to spread information between services? (II)
The usage of a message broker software is one of the better approaches to share
information between services. It has several benefits:
• Forget about nested web services, rollbacks and just focus in your own business.
• Producer services does not need to know about the consumer service throughput.
• Having a strong and reliable communication system between different systems in the
company which will allow us to have new business opportunities.
• Publish/Subscribe pattern.
• Etc.
Message broker solutions
• Apache ActiveMQ
• RabbitMQ
• Microsoft Azure Service Bus
• Apache Kafka
• Etc
What is Kafka?
• Kafka is a distributed streaming platform developed by Apache
Software Foundation and written in Scala and Java.
• Scalability is possible both logical and physical.
• It can be used as:
• Messaging System
• Event notification
• Website Activity Tracking
• Log Aggregation
• Storage System
• Stream Processing
Kafka Infrastructure
• Cluster of one or more nodes (brokers)
• Each topic partition has a specific node as leader.
• Apache ZooKeeper to keep in sync the brokers.
• Streams of records are stored in categories  Topics
• We can see a topic as a key/value dictionary. Offset and a timestamp are
stored in the record as metadata.
Writing to/Reading from Kafka
• Producers
• Consumers
• Consumer group (parallel processing)
• Connectors
• Source (producers)
• Sink (consumers)
• Stream processors
Writing to/Reading from Kafka (II)
• Each record has an unique position inside the partition (offset)
• Kafka stores the partition offset for a consumer group.
Real scenario using Kafka
What do we use it for?
P&P
WS
P&P Apps
WebShop
BS
PLM
What do we use it for? (II)
• Under the previous scenario we were asked to:
• Ensure “transactionality” on the different “update” web services.
• When something goes wrong, be sure that all systems are in a consistent
state.
What do we use it for? (III)
What do we use it for? (IV)
Producer
Webshop consumer group
C1 C2 C3
PLM consumer group
C1 C2
Useful Links
• Apache Kafka documentation page:
• https://kafka.apache.org/documentation/
• Confluent Blog:
• https://www.confluent.io/blog/

Weitere ähnliche Inhalte

Was ist angesagt?

Evolution of integration and microservices patterns with service mesh
Evolution of integration and microservices patterns with service meshEvolution of integration and microservices patterns with service mesh
Evolution of integration and microservices patterns with service mesh
Christian Posta
 

Was ist angesagt? (20)

Windows Azure Service Bus
Windows Azure Service BusWindows Azure Service Bus
Windows Azure Service Bus
 
Evolution of integration and microservices patterns with service mesh
Evolution of integration and microservices patterns with service meshEvolution of integration and microservices patterns with service mesh
Evolution of integration and microservices patterns with service mesh
 
Microservices
MicroservicesMicroservices
Microservices
 
NATS: A Cloud Native Messaging System
NATS: A Cloud Native Messaging SystemNATS: A Cloud Native Messaging System
NATS: A Cloud Native Messaging System
 
Event Driven Architectures with Apache Kafka
Event Driven Architectures with Apache KafkaEvent Driven Architectures with Apache Kafka
Event Driven Architectures with Apache Kafka
 
Micro-services architecture
Micro-services architectureMicro-services architecture
Micro-services architecture
 
Tokyo Azure Meetup #4 - Build 2016 Overview
Tokyo Azure Meetup #4 -  Build 2016 OverviewTokyo Azure Meetup #4 -  Build 2016 Overview
Tokyo Azure Meetup #4 - Build 2016 Overview
 
How to Discover, Visualize, Catalog, Share and Reuse your Kafka Streams (Jona...
How to Discover, Visualize, Catalog, Share and Reuse your Kafka Streams (Jona...How to Discover, Visualize, Catalog, Share and Reuse your Kafka Streams (Jona...
How to Discover, Visualize, Catalog, Share and Reuse your Kafka Streams (Jona...
 
Building adaptive user experiences using Contextual Multi-Armed Bandits with...
Building adaptive user experiences using Contextual Multi-Armed Bandits  with...Building adaptive user experiences using Contextual Multi-Armed Bandits  with...
Building adaptive user experiences using Contextual Multi-Armed Bandits with...
 
Multicluster Kubernetes and Service Mesh Patterns
Multicluster Kubernetes and Service Mesh PatternsMulticluster Kubernetes and Service Mesh Patterns
Multicluster Kubernetes and Service Mesh Patterns
 
Istio: solving challenges of hybrid cloud
Istio: solving challenges of hybrid cloudIstio: solving challenges of hybrid cloud
Istio: solving challenges of hybrid cloud
 
PHX DevOps Days: Service Mesh Landscape
PHX DevOps Days: Service Mesh LandscapePHX DevOps Days: Service Mesh Landscape
PHX DevOps Days: Service Mesh Landscape
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services Architecture
 
Microservices in Go with Go kit
Microservices in Go with Go kitMicroservices in Go with Go kit
Microservices in Go with Go kit
 
Containerizing your apps
Containerizing your appsContainerizing your apps
Containerizing your apps
 
Kafka at the Edge: an IoT scenario with OpenShift Streams for Apache Kafka | ...
Kafka at the Edge: an IoT scenario with OpenShift Streams for Apache Kafka | ...Kafka at the Edge: an IoT scenario with OpenShift Streams for Apache Kafka | ...
Kafka at the Edge: an IoT scenario with OpenShift Streams for Apache Kafka | ...
 
Websphere - overview and introduction
Websphere - overview and introduction Websphere - overview and introduction
Websphere - overview and introduction
 
Come for the traffic management, stay for the security
Come for the traffic management, stay for the securityCome for the traffic management, stay for the security
Come for the traffic management, stay for the security
 
Nats meetup sf 20150826
Nats meetup sf   20150826Nats meetup sf   20150826
Nats meetup sf 20150826
 
Microservices with Spring
Microservices with SpringMicroservices with Spring
Microservices with Spring
 

Ähnlich wie Removing dependencies between services: Messaging and Apache Kafka

Lighthouse20100120
Lighthouse20100120Lighthouse20100120
Lighthouse20100120
sureddy
 

Ähnlich wie Removing dependencies between services: Messaging and Apache Kafka (20)

kafka for db as postgres
kafka for db as postgreskafka for db as postgres
kafka for db as postgres
 
Building real time data-driven products
Building real time data-driven productsBuilding real time data-driven products
Building real time data-driven products
 
Apache Kafka Introduction
Apache Kafka IntroductionApache Kafka Introduction
Apache Kafka Introduction
 
Apache kafka- Onkar Kadam
Apache kafka- Onkar KadamApache kafka- Onkar Kadam
Apache kafka- Onkar Kadam
 
QCon 2015 - Microservices Track Notes
QCon 2015 - Microservices Track Notes QCon 2015 - Microservices Track Notes
QCon 2015 - Microservices Track Notes
 
Building streaming data applications using Kafka*[Connect + Core + Streams] b...
Building streaming data applications using Kafka*[Connect + Core + Streams] b...Building streaming data applications using Kafka*[Connect + Core + Streams] b...
Building streaming data applications using Kafka*[Connect + Core + Streams] b...
 
Unleashing Real-time Power with Kafka.pptx
Unleashing Real-time Power with Kafka.pptxUnleashing Real-time Power with Kafka.pptx
Unleashing Real-time Power with Kafka.pptx
 
Lighthouse 20100120
Lighthouse 20100120Lighthouse 20100120
Lighthouse 20100120
 
Lighthouse20100120
Lighthouse20100120Lighthouse20100120
Lighthouse20100120
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
ADV Slides: Trends in Streaming Analytics and Message-oriented Middleware
ADV Slides: Trends in Streaming Analytics and Message-oriented MiddlewareADV Slides: Trends in Streaming Analytics and Message-oriented Middleware
ADV Slides: Trends in Streaming Analytics and Message-oriented Middleware
 
Building Streaming Data Applications Using Apache Kafka
Building Streaming Data Applications Using Apache KafkaBuilding Streaming Data Applications Using Apache Kafka
Building Streaming Data Applications Using Apache Kafka
 
Kubernetes Infra 2.0
Kubernetes Infra 2.0Kubernetes Infra 2.0
Kubernetes Infra 2.0
 
Database@Home : Data Driven Apps - Data-driven Microservices Architecture wit...
Database@Home : Data Driven Apps - Data-driven Microservices Architecture wit...Database@Home : Data Driven Apps - Data-driven Microservices Architecture wit...
Database@Home : Data Driven Apps - Data-driven Microservices Architecture wit...
 
Migrating from a monolith to microservices – is it worth it?
Migrating from a monolith to microservices – is it worth it?Migrating from a monolith to microservices – is it worth it?
Migrating from a monolith to microservices – is it worth it?
 
Apache Kafka - Scalable Message-Processing and more !
Apache Kafka - Scalable Message-Processing and more !Apache Kafka - Scalable Message-Processing and more !
Apache Kafka - Scalable Message-Processing and more !
 
apidays LIVE Jakarta - Building an Event-Driven Architecture by Harin Honesty...
apidays LIVE Jakarta - Building an Event-Driven Architecture by Harin Honesty...apidays LIVE Jakarta - Building an Event-Driven Architecture by Harin Honesty...
apidays LIVE Jakarta - Building an Event-Driven Architecture by Harin Honesty...
 
How Tencent Applies Apache Pulsar to Apache InLong —— A Streaming Data Integr...
How Tencent Applies Apache Pulsar to Apache InLong —— A Streaming Data Integr...How Tencent Applies Apache Pulsar to Apache InLong —— A Streaming Data Integr...
How Tencent Applies Apache Pulsar to Apache InLong —— A Streaming Data Integr...
 
Devfest uk & ireland using apache nifi with apache pulsar for fast data on-r...
Devfest uk & ireland  using apache nifi with apache pulsar for fast data on-r...Devfest uk & ireland  using apache nifi with apache pulsar for fast data on-r...
Devfest uk & ireland using apache nifi with apache pulsar for fast data on-r...
 
Microservices-101
Microservices-101Microservices-101
Microservices-101
 

Kürzlich hochgeladen

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 

Kürzlich hochgeladen (20)

%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
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
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
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
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 

Removing dependencies between services: Messaging and Apache Kafka

  • 1.
  • 2. How to spread information between services? (I) Traditionally, a direct call from the producer to the consumer/s inside the producer service logic is performed. This approach has several drawbacks: • Caller lack of knowledge of the external services. • Complex logic when trying to ensure data consistency. • Caller needs to know if the consumer/s can process information as quick as it is produced (max. throughput) • Etc.
  • 3. How to spread information between services? (II) The usage of a message broker software is one of the better approaches to share information between services. It has several benefits: • Forget about nested web services, rollbacks and just focus in your own business. • Producer services does not need to know about the consumer service throughput. • Having a strong and reliable communication system between different systems in the company which will allow us to have new business opportunities. • Publish/Subscribe pattern. • Etc.
  • 4. Message broker solutions • Apache ActiveMQ • RabbitMQ • Microsoft Azure Service Bus • Apache Kafka • Etc
  • 5. What is Kafka? • Kafka is a distributed streaming platform developed by Apache Software Foundation and written in Scala and Java. • Scalability is possible both logical and physical. • It can be used as: • Messaging System • Event notification • Website Activity Tracking • Log Aggregation • Storage System • Stream Processing
  • 6. Kafka Infrastructure • Cluster of one or more nodes (brokers) • Each topic partition has a specific node as leader. • Apache ZooKeeper to keep in sync the brokers. • Streams of records are stored in categories  Topics • We can see a topic as a key/value dictionary. Offset and a timestamp are stored in the record as metadata.
  • 7. Writing to/Reading from Kafka • Producers • Consumers • Consumer group (parallel processing) • Connectors • Source (producers) • Sink (consumers) • Stream processors
  • 8. Writing to/Reading from Kafka (II) • Each record has an unique position inside the partition (offset) • Kafka stores the partition offset for a consumer group.
  • 10. What do we use it for? P&P WS P&P Apps WebShop BS PLM
  • 11. What do we use it for? (II) • Under the previous scenario we were asked to: • Ensure “transactionality” on the different “update” web services. • When something goes wrong, be sure that all systems are in a consistent state.
  • 12. What do we use it for? (III)
  • 13. What do we use it for? (IV) Producer Webshop consumer group C1 C2 C3 PLM consumer group C1 C2
  • 14. Useful Links • Apache Kafka documentation page: • https://kafka.apache.org/documentation/ • Confluent Blog: • https://www.confluent.io/blog/