SlideShare a Scribd company logo
1 of 30
Using Kafka
on Event-Driven
Microservices Architectures.
Who am I?
Oscar Gómez Soriano
What I Do?
Software Architect / Developer @Stratio BD
How can you contact me?
ogomez@stratio.com
Oscar Gómez Soriano
@oskarflesh
1. Event Driven Architectures
2. Real Use Case: Appointment Creation System
3. Architectural Solution
4. Improving the Architecture
AGENDA
EVENT-DRIVEN
ARCHITECTURES1
“An enterprise application is a
system that reacts to events
from the outside world”.
Martin Fowler
Event-driven Architectural Patterns
We can find 4 great types of event-driven architectural
patterns depending on the way the events are used:
● Event Notification - This happens when a system
sends event messages to notify other systems of a
change in its domain. A key element of event
notification is that the source system doesn't really
care much about the response.
● Event-Carried State Transfer - The event sended
contains all the info needed to update the
“recipient system” in such a way that it doesn't
need to contact the source system in order to do
further work.
Event-driven Architectural Patterns
● Event-Sourcing - The core idea
of event sourcing is that
whenever we make a change to
the state of a system, we record
that state change as an event,
and we can confidently rebuild
the system state by reprocessing
the events at any time in the
future.
The event store becomes the principal source of truth, and the system state is
purely derived from it. For programmers, the best example of this is a version-
control system. The log of all the commits is the event store and the working copy
of the source tree is the system state.
Event-driven Architectural Patterns
● CQRS - Command Query
Responsibility Segregation
(CQRS) is the notion of
having separate data
structures for reading and
writing information. Strictly
CQRS isn't really about
events, since you can use
CQRS without any events
present in your design. But
commonly people do
combine CQRS with the
earlier patterns here, hence
their presence at the
summit.
Implementing Event-driven Architectures
“A event-messaging-based application typically uses a message broker, which is an infrastructure
service through which the services communicates. However, a broker-based architecture is not the
only messaging architecture. You can also use a brokerless-based messaging architecture in which
the services communicate with one another directly”. Chris Richardson - Microservices Patterns
Broker-Based Messaging Benefits & Drawbacks
There are many advantages to using broker-based messaging:
● Loose Coupling - a client makes a request simply sending a message to the appropriate channel.
The client is completely unaware of the service instances. It does not need to use a discovery
mechanism to determine the location of a service instance.
● Message Buffering - the message broker buffers messages until they can be processed. This
means, for example, that an online store can accept orders from customers, even when the order
fulfillment system is slow or unavailable. The Order messages will simply queue up.
● Explicit Inter-Process Communication - Messaging makes differences between remote and local
services very explicit so developers are not lulled into a false sense of security.
Broker-Based Messaging Benefits & Drawbacks
There are some, however, downsides to using messaging:
● Potential performance bottleneck - there is a risk that the message broker could be a
performance bottleneck. Fortunately, many modern message brokers are designed to be highly
scalable.
● Potential single-point of failure - its essential that the message broker is highly available
otherwise system reliability will be impacted. Fortunately, most modern brokers have are designed
to be highly available.
● Additional operational complexity - the messaging system is yet another system component that
must be installed, configured and operated.
REAL USE CASE:
APPOINTMENT
CREATION SYSTEM
2
The Challenge
The basic idea is to construct an Appointment Creation System.
On matter of the performance & functional requirements we got 3 different
scenarios depends on the user who interacts with the system:
● Final user
● Admin User
● BI User
● AI User
The Challenge: Final User Requirements
1. The user can consult calendars to be able to see the available appointments
& create it.
2. The user can check their created appointments and reschedule/cancel it.
3. By default, a same hole can not be reserved by two users at the same time,
an overload algorithm determines if this restriction is disabled.
4. An AI model determines the probability that the patient attends the
appointment and an algorithm determines the overload capacity.
The Challenge: Admin User Requirements
1. A admin user can consult existing appointments. Using filters they can adjust
their search.
2. The Admin user can create appointments for patients.
The Challenge: BI User Requirements
1. The BI users can calculate business metrics from visits events in near real
time.
2. The BI user can visualize the values ​​of these metrics through dashboards.
The Challenge: AI User Requirements
1. A data scientist has an advanced analytical environment in which they can
develop models from the information obtained through the system.
2. The data scientist can do data discovery using Stratio Discovery
The Challenge: Performance Requirements
1. Response time for more complex operations less than 250 ms.
1. Transactional process supporting 10,000 online users interacting
appointment API (creation/cancel/Rescheduling) and consulting
calendars in a two minute window.
1. Replication of the data to the query model must respond to the principle
of eventual consistency with a delay of less than 1 minute, regardless of
the size of the HDFS block.
ARCHITECTURAL
SOLUTION3
Architectural Solution: The Big Picture
Architectural Solution: Microservice Architecture
Architectural Solution On Detail : Appointment Service
Architectural Solution On Detail : Calendar Search
Architectural Solution On Detail : KPIs (BI Users)
Performance Test Results: Test Scenario
Infrastructure:
● Stratio DataCentric Platform deployed on Azure Cloud
● 500,000 pre-reserved appointments.
● > 84,000 agendas registered in the system.
● Production Masters Data
● Test Distribution by functionality:
○ 37% Calendar Search
○ 16,67% Appointment Inserts
○ 15,15% Appointment Reschedule/Cancel
○ 30,30% Created Appointment Search
● Microservices Resource Configuration:
○ Calendar: 4 cores y 4GB, Autoscaler Config from 2 to 5 instances.
○ Appointment: 1 Core, 1GB, Autoscaler Config from 2 to 5 instances.
○ Masters: 1 Core, 1GB Autoscaler Config from 2 to 3 instances.
Performance Test Results
Performance Test Results:
2 Hour Performance Test
88 tps (10483 2 minute window)
Microservice
Request
Distribution
Request/
s
Media
Calendar
Search
37,88 % 33 20 ms
Appointment
Insert
16,67 % 15 64 ms
Reschedule /
Cancel
15,15 % 14 74 ms
Appointment
Search
30,30 % 26 26 ms
2 Hour Performance Test
178 tps (10483 1 minute window)
Microservice
Request
Distribution
Request/s Media
Calendar
Search
37,88 % 67 19 ms
Appointment
Insert
16,67 % 30 106 ms
Reschedule /
Cancel
15,15 % 28 91 ms
Appointment
Search
30,30 % 53 46 ms
IMPROVING THE
ARCHITECTURE4
Knowing the Gaps
With this numbers in mind we identify two possible bottlenecks on this Architecture:
● Created Appointment Search: As the search and insertion go against the same service and
database model both operations are penalized. In addition, the model applied to the insertion
is not optimal for the search since it forces the front to make auxiliary requests to obtain the
data it needs.
● Calendar Service Responsibilities: Another gap we found is that Calendar service has to
receive & process the kafka events (overbooking calculations & update the cache model) and at
the same time attend to the get calendar requests so in times of high demand we will have a
lot of kafka events to process which could slow down the search speed of the calendars.
● Another consideration to take is that despite having demonstrated a high performance,
Memcached is not a solution that can scale well having a series of limitations such as not
having a persistence mechanism of its own, having a high availability solution or not being a
distributed system
Once we know our service needs in matter of performance and scalability it’s time to take advantage of
the decoupled way of development we use and separate those subdomains on separate services.
Revisiting the Architecture
THANK YOU

More Related Content

What's hot

Domain Driven Data: Apache Kafka® and the Data Mesh
Domain Driven Data: Apache Kafka® and the Data MeshDomain Driven Data: Apache Kafka® and the Data Mesh
Domain Driven Data: Apache Kafka® and the Data Meshconfluent
 
Architecture Patterns for Event Streaming (Nick Dearden, Confluent) London 20...
Architecture Patterns for Event Streaming (Nick Dearden, Confluent) London 20...Architecture Patterns for Event Streaming (Nick Dearden, Confluent) London 20...
Architecture Patterns for Event Streaming (Nick Dearden, Confluent) London 20...confluent
 
Apache Kafka® Use Cases for Financial Services
Apache Kafka® Use Cases for Financial ServicesApache Kafka® Use Cases for Financial Services
Apache Kafka® Use Cases for Financial Servicesconfluent
 
batbern43 Stream all Things: Patterns of Data Integration in Event Driven Sys...
batbern43 Stream all Things: Patterns of Data Integration in Event Driven Sys...batbern43 Stream all Things: Patterns of Data Integration in Event Driven Sys...
batbern43 Stream all Things: Patterns of Data Integration in Event Driven Sys...BATbern
 
Data reply sneak peek: real time decision engines
Data reply sneak peek:  real time decision enginesData reply sneak peek:  real time decision engines
Data reply sneak peek: real time decision enginesconfluent
 
Real Time Analytics with Apache Cassandra - Cassandra Day Berlin
Real Time Analytics with Apache Cassandra - Cassandra Day BerlinReal Time Analytics with Apache Cassandra - Cassandra Day Berlin
Real Time Analytics with Apache Cassandra - Cassandra Day BerlinGuido Schmutz
 
Unlocking Operational Intelligence from the Data Lake
Unlocking Operational Intelligence from the Data LakeUnlocking Operational Intelligence from the Data Lake
Unlocking Operational Intelligence from the Data LakeMongoDB
 
[Webinar] Measure Twice, Build Once: Real-Time Predictive Analytics
[Webinar] Measure Twice, Build Once: Real-Time Predictive Analytics[Webinar] Measure Twice, Build Once: Real-Time Predictive Analytics
[Webinar] Measure Twice, Build Once: Real-Time Predictive AnalyticsInfochimps, a CSC Big Data Business
 
Customer Event Hub – a modern Customer 360° view with DataStax Enterprise (DSE)
Customer Event Hub – a modern Customer 360° view with DataStax Enterprise (DSE) Customer Event Hub – a modern Customer 360° view with DataStax Enterprise (DSE)
Customer Event Hub – a modern Customer 360° view with DataStax Enterprise (DSE) Guido Schmutz
 
Unlocking Geospatial Analytics Use Cases with CARTO and Databricks
Unlocking Geospatial Analytics Use Cases with CARTO and DatabricksUnlocking Geospatial Analytics Use Cases with CARTO and Databricks
Unlocking Geospatial Analytics Use Cases with CARTO and DatabricksDatabricks
 
IoT Connected Brewery
IoT Connected BreweryIoT Connected Brewery
IoT Connected BreweryJason Hubbard
 
Big Data Analytics for Real Time Systems
Big Data Analytics for Real Time SystemsBig Data Analytics for Real Time Systems
Big Data Analytics for Real Time SystemsKamalika Dutta
 
Cloud Modernization and Data as a Service Option
Cloud Modernization and Data as a Service OptionCloud Modernization and Data as a Service Option
Cloud Modernization and Data as a Service OptionDenodo
 
Introducing Databricks Delta
Introducing Databricks DeltaIntroducing Databricks Delta
Introducing Databricks DeltaDatabricks
 
Data Virtualization: From Zero to Hero (Middle East)
Data Virtualization: From Zero to Hero (Middle East)Data Virtualization: From Zero to Hero (Middle East)
Data Virtualization: From Zero to Hero (Middle East)Denodo
 
The Curse of the Data Lake Monster
The Curse of the Data Lake MonsterThe Curse of the Data Lake Monster
The Curse of the Data Lake MonsterThoughtworks
 
Big Data Storage Challenges and Solutions
Big Data Storage Challenges and SolutionsBig Data Storage Challenges and Solutions
Big Data Storage Challenges and SolutionsWSO2
 
Real-time Microservices and In-Memory Data Grids
Real-time Microservices and In-Memory Data GridsReal-time Microservices and In-Memory Data Grids
Real-time Microservices and In-Memory Data GridsAli Hodroj
 
Realtime data processing with Flink and Druid by Youngpyo Lee, SKT
Realtime data processing with Flink and Druid by Youngpyo Lee, SKTRealtime data processing with Flink and Druid by Youngpyo Lee, SKT
Realtime data processing with Flink and Druid by Youngpyo Lee, SKTMetatron
 

What's hot (20)

Domain Driven Data: Apache Kafka® and the Data Mesh
Domain Driven Data: Apache Kafka® and the Data MeshDomain Driven Data: Apache Kafka® and the Data Mesh
Domain Driven Data: Apache Kafka® and the Data Mesh
 
Architecture Patterns for Event Streaming (Nick Dearden, Confluent) London 20...
Architecture Patterns for Event Streaming (Nick Dearden, Confluent) London 20...Architecture Patterns for Event Streaming (Nick Dearden, Confluent) London 20...
Architecture Patterns for Event Streaming (Nick Dearden, Confluent) London 20...
 
Apache Kafka® Use Cases for Financial Services
Apache Kafka® Use Cases for Financial ServicesApache Kafka® Use Cases for Financial Services
Apache Kafka® Use Cases for Financial Services
 
batbern43 Stream all Things: Patterns of Data Integration in Event Driven Sys...
batbern43 Stream all Things: Patterns of Data Integration in Event Driven Sys...batbern43 Stream all Things: Patterns of Data Integration in Event Driven Sys...
batbern43 Stream all Things: Patterns of Data Integration in Event Driven Sys...
 
Data reply sneak peek: real time decision engines
Data reply sneak peek:  real time decision enginesData reply sneak peek:  real time decision engines
Data reply sneak peek: real time decision engines
 
Real Time Analytics with Apache Cassandra - Cassandra Day Berlin
Real Time Analytics with Apache Cassandra - Cassandra Day BerlinReal Time Analytics with Apache Cassandra - Cassandra Day Berlin
Real Time Analytics with Apache Cassandra - Cassandra Day Berlin
 
Unlocking Operational Intelligence from the Data Lake
Unlocking Operational Intelligence from the Data LakeUnlocking Operational Intelligence from the Data Lake
Unlocking Operational Intelligence from the Data Lake
 
[Webinar] Measure Twice, Build Once: Real-Time Predictive Analytics
[Webinar] Measure Twice, Build Once: Real-Time Predictive Analytics[Webinar] Measure Twice, Build Once: Real-Time Predictive Analytics
[Webinar] Measure Twice, Build Once: Real-Time Predictive Analytics
 
Customer Event Hub – a modern Customer 360° view with DataStax Enterprise (DSE)
Customer Event Hub – a modern Customer 360° view with DataStax Enterprise (DSE) Customer Event Hub – a modern Customer 360° view with DataStax Enterprise (DSE)
Customer Event Hub – a modern Customer 360° view with DataStax Enterprise (DSE)
 
Unlocking Geospatial Analytics Use Cases with CARTO and Databricks
Unlocking Geospatial Analytics Use Cases with CARTO and DatabricksUnlocking Geospatial Analytics Use Cases with CARTO and Databricks
Unlocking Geospatial Analytics Use Cases with CARTO and Databricks
 
IoT Connected Brewery
IoT Connected BreweryIoT Connected Brewery
IoT Connected Brewery
 
Big Data Analytics for Real Time Systems
Big Data Analytics for Real Time SystemsBig Data Analytics for Real Time Systems
Big Data Analytics for Real Time Systems
 
Big Data Landscape 2016
Big Data Landscape 2016Big Data Landscape 2016
Big Data Landscape 2016
 
Cloud Modernization and Data as a Service Option
Cloud Modernization and Data as a Service OptionCloud Modernization and Data as a Service Option
Cloud Modernization and Data as a Service Option
 
Introducing Databricks Delta
Introducing Databricks DeltaIntroducing Databricks Delta
Introducing Databricks Delta
 
Data Virtualization: From Zero to Hero (Middle East)
Data Virtualization: From Zero to Hero (Middle East)Data Virtualization: From Zero to Hero (Middle East)
Data Virtualization: From Zero to Hero (Middle East)
 
The Curse of the Data Lake Monster
The Curse of the Data Lake MonsterThe Curse of the Data Lake Monster
The Curse of the Data Lake Monster
 
Big Data Storage Challenges and Solutions
Big Data Storage Challenges and SolutionsBig Data Storage Challenges and Solutions
Big Data Storage Challenges and Solutions
 
Real-time Microservices and In-Memory Data Grids
Real-time Microservices and In-Memory Data GridsReal-time Microservices and In-Memory Data Grids
Real-time Microservices and In-Memory Data Grids
 
Realtime data processing with Flink and Druid by Youngpyo Lee, SKT
Realtime data processing with Flink and Druid by Youngpyo Lee, SKTRealtime data processing with Flink and Druid by Youngpyo Lee, SKT
Realtime data processing with Flink and Druid by Youngpyo Lee, SKT
 

Similar to Using Kafka on Event-driven Microservices Architectures - Apache Kafka Meetup

System analysis and_design.docx
System analysis and_design.docxSystem analysis and_design.docx
System analysis and_design.docxAlaJebnoun
 
A Survey on Heuristic Based Techniques in Cloud Computing
A Survey on Heuristic Based Techniques in Cloud ComputingA Survey on Heuristic Based Techniques in Cloud Computing
A Survey on Heuristic Based Techniques in Cloud ComputingIRJET Journal
 
Ignou MCA 6th Semester Synopsis
Ignou MCA 6th Semester SynopsisIgnou MCA 6th Semester Synopsis
Ignou MCA 6th Semester SynopsisHitesh Jangid
 
Top 8 Trends in Performance Engineering
Top 8 Trends in Performance EngineeringTop 8 Trends in Performance Engineering
Top 8 Trends in Performance EngineeringConvetit
 
Over view of software artitecture
Over view of software artitectureOver view of software artitecture
Over view of software artitectureABDEL RAHMAN KARIM
 
Architectural Design Report G4
Architectural Design Report G4Architectural Design Report G4
Architectural Design Report G4Prizzl
 
12th CBSE Computer Science Project
12th CBSE Computer Science Project12th CBSE Computer Science Project
12th CBSE Computer Science ProjectAshwin Francis
 
2017 Melbourne YOW! CTO Summit - Monolith to micro-services with CQRS & Event...
2017 Melbourne YOW! CTO Summit - Monolith to micro-services with CQRS & Event...2017 Melbourne YOW! CTO Summit - Monolith to micro-services with CQRS & Event...
2017 Melbourne YOW! CTO Summit - Monolith to micro-services with CQRS & Event...Douglas English
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architectureFaren faren
 
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...apidays
 
A Project to Automate Inventory Management in a Fast Food, Cas.docx
A Project to Automate Inventory Management in a Fast Food, Cas.docxA Project to Automate Inventory Management in a Fast Food, Cas.docx
A Project to Automate Inventory Management in a Fast Food, Cas.docxransayo
 
construction management.pptx
construction management.pptxconstruction management.pptx
construction management.pptxpraful91
 
Whitepaper: 4 Approaches to Systems Integration
Whitepaper: 4 Approaches to Systems IntegrationWhitepaper: 4 Approaches to Systems Integration
Whitepaper: 4 Approaches to Systems IntegrationAudacia
 
apidays LIVE Hong Kong 2021 - Modernizing Monolith Applications with API Arch...
apidays LIVE Hong Kong 2021 - Modernizing Monolith Applications with API Arch...apidays LIVE Hong Kong 2021 - Modernizing Monolith Applications with API Arch...
apidays LIVE Hong Kong 2021 - Modernizing Monolith Applications with API Arch...apidays
 

Similar to Using Kafka on Event-driven Microservices Architectures - Apache Kafka Meetup (20)

System analysis and_design.docx
System analysis and_design.docxSystem analysis and_design.docx
System analysis and_design.docx
 
A Survey on Heuristic Based Techniques in Cloud Computing
A Survey on Heuristic Based Techniques in Cloud ComputingA Survey on Heuristic Based Techniques in Cloud Computing
A Survey on Heuristic Based Techniques in Cloud Computing
 
Ignou MCA 6th Semester Synopsis
Ignou MCA 6th Semester SynopsisIgnou MCA 6th Semester Synopsis
Ignou MCA 6th Semester Synopsis
 
Data dayposter v1.2
Data dayposter v1.2Data dayposter v1.2
Data dayposter v1.2
 
Top 8 Trends in Performance Engineering
Top 8 Trends in Performance EngineeringTop 8 Trends in Performance Engineering
Top 8 Trends in Performance Engineering
 
Cloud Computing Project
Cloud Computing ProjectCloud Computing Project
Cloud Computing Project
 
Over view of software artitecture
Over view of software artitectureOver view of software artitecture
Over view of software artitecture
 
Architectural Design Report G4
Architectural Design Report G4Architectural Design Report G4
Architectural Design Report G4
 
Brilient login system
Brilient login systemBrilient login system
Brilient login system
 
IT Strategy, Cloud Benefit Realization
IT Strategy, Cloud Benefit RealizationIT Strategy, Cloud Benefit Realization
IT Strategy, Cloud Benefit Realization
 
12th CBSE Computer Science Project
12th CBSE Computer Science Project12th CBSE Computer Science Project
12th CBSE Computer Science Project
 
2017 Melbourne YOW! CTO Summit - Monolith to micro-services with CQRS & Event...
2017 Melbourne YOW! CTO Summit - Monolith to micro-services with CQRS & Event...2017 Melbourne YOW! CTO Summit - Monolith to micro-services with CQRS & Event...
2017 Melbourne YOW! CTO Summit - Monolith to micro-services with CQRS & Event...
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
 
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...
 
A Project to Automate Inventory Management in a Fast Food, Cas.docx
A Project to Automate Inventory Management in a Fast Food, Cas.docxA Project to Automate Inventory Management in a Fast Food, Cas.docx
A Project to Automate Inventory Management in a Fast Food, Cas.docx
 
construction management.pptx
construction management.pptxconstruction management.pptx
construction management.pptx
 
Blue book
Blue bookBlue book
Blue book
 
Whitepaper: 4 Approaches to Systems Integration
Whitepaper: 4 Approaches to Systems IntegrationWhitepaper: 4 Approaches to Systems Integration
Whitepaper: 4 Approaches to Systems Integration
 
Scheduling in CCE
Scheduling in CCEScheduling in CCE
Scheduling in CCE
 
apidays LIVE Hong Kong 2021 - Modernizing Monolith Applications with API Arch...
apidays LIVE Hong Kong 2021 - Modernizing Monolith Applications with API Arch...apidays LIVE Hong Kong 2021 - Modernizing Monolith Applications with API Arch...
apidays LIVE Hong Kong 2021 - Modernizing Monolith Applications with API Arch...
 

More from Stratio

Can an intelligent system exist without awareness? BDS18
Can an intelligent system exist without awareness? BDS18Can an intelligent system exist without awareness? BDS18
Can an intelligent system exist without awareness? BDS18Stratio
 
Kafka and KSQL - Apache Kafka Meetup
Kafka and KSQL - Apache Kafka MeetupKafka and KSQL - Apache Kafka Meetup
Kafka and KSQL - Apache Kafka MeetupStratio
 
Wild Data - The Data Science Meetup
Wild Data - The Data Science MeetupWild Data - The Data Science Meetup
Wild Data - The Data Science MeetupStratio
 
Ensemble methods in Machine Learning
Ensemble methods in Machine Learning Ensemble methods in Machine Learning
Ensemble methods in Machine Learning Stratio
 
Stratio Sparta 2.0
Stratio Sparta 2.0Stratio Sparta 2.0
Stratio Sparta 2.0Stratio
 
Big Data Security: Facing the challenge
Big Data Security: Facing the challengeBig Data Security: Facing the challenge
Big Data Security: Facing the challengeStratio
 
Operationalizing Big Data
Operationalizing Big DataOperationalizing Big Data
Operationalizing Big DataStratio
 
Artificial Intelligence on Data Centric Platform
Artificial Intelligence on Data Centric PlatformArtificial Intelligence on Data Centric Platform
Artificial Intelligence on Data Centric PlatformStratio
 
Introduction to Artificial Neural Networks
Introduction to Artificial Neural NetworksIntroduction to Artificial Neural Networks
Introduction to Artificial Neural NetworksStratio
 
Meetup: Cómo monitorizar y optimizar procesos de Spark usando la Spark Web - ...
Meetup: Cómo monitorizar y optimizar procesos de Spark usando la Spark Web - ...Meetup: Cómo monitorizar y optimizar procesos de Spark usando la Spark Web - ...
Meetup: Cómo monitorizar y optimizar procesos de Spark usando la Spark Web - ...Stratio
 
Lunch&Learn: Combinación de modelos
Lunch&Learn: Combinación de modelosLunch&Learn: Combinación de modelos
Lunch&Learn: Combinación de modelosStratio
 
Meetup: Spark + Kerberos
Meetup: Spark + KerberosMeetup: Spark + Kerberos
Meetup: Spark + KerberosStratio
 
Distributed Logistic Model Trees
Distributed Logistic Model TreesDistributed Logistic Model Trees
Distributed Logistic Model TreesStratio
 
Multiplaform Solution for Graph Datasources
Multiplaform Solution for Graph DatasourcesMultiplaform Solution for Graph Datasources
Multiplaform Solution for Graph DatasourcesStratio
 
Stratio's Cassandra Lucene index: Geospatial use cases - Big Data Spain 2016
Stratio's Cassandra Lucene index: Geospatial use cases - Big Data Spain 2016Stratio's Cassandra Lucene index: Geospatial use cases - Big Data Spain 2016
Stratio's Cassandra Lucene index: Geospatial use cases - Big Data Spain 2016Stratio
 
[Strata] Sparkta
[Strata] Sparkta[Strata] Sparkta
[Strata] SparktaStratio
 
Introduction to Asynchronous scala
Introduction to Asynchronous scalaIntroduction to Asynchronous scala
Introduction to Asynchronous scalaStratio
 
Functional programming in scala
Functional programming in scalaFunctional programming in scala
Functional programming in scalaStratio
 
Spark Streaming @ Berlin Apache Spark Meetup, March 2015
Spark Streaming @ Berlin Apache Spark Meetup, March 2015Spark Streaming @ Berlin Apache Spark Meetup, March 2015
Spark Streaming @ Berlin Apache Spark Meetup, March 2015Stratio
 
Advanced search and Top-K queries in Cassandra
Advanced search and Top-K queries in CassandraAdvanced search and Top-K queries in Cassandra
Advanced search and Top-K queries in CassandraStratio
 

More from Stratio (20)

Can an intelligent system exist without awareness? BDS18
Can an intelligent system exist without awareness? BDS18Can an intelligent system exist without awareness? BDS18
Can an intelligent system exist without awareness? BDS18
 
Kafka and KSQL - Apache Kafka Meetup
Kafka and KSQL - Apache Kafka MeetupKafka and KSQL - Apache Kafka Meetup
Kafka and KSQL - Apache Kafka Meetup
 
Wild Data - The Data Science Meetup
Wild Data - The Data Science MeetupWild Data - The Data Science Meetup
Wild Data - The Data Science Meetup
 
Ensemble methods in Machine Learning
Ensemble methods in Machine Learning Ensemble methods in Machine Learning
Ensemble methods in Machine Learning
 
Stratio Sparta 2.0
Stratio Sparta 2.0Stratio Sparta 2.0
Stratio Sparta 2.0
 
Big Data Security: Facing the challenge
Big Data Security: Facing the challengeBig Data Security: Facing the challenge
Big Data Security: Facing the challenge
 
Operationalizing Big Data
Operationalizing Big DataOperationalizing Big Data
Operationalizing Big Data
 
Artificial Intelligence on Data Centric Platform
Artificial Intelligence on Data Centric PlatformArtificial Intelligence on Data Centric Platform
Artificial Intelligence on Data Centric Platform
 
Introduction to Artificial Neural Networks
Introduction to Artificial Neural NetworksIntroduction to Artificial Neural Networks
Introduction to Artificial Neural Networks
 
Meetup: Cómo monitorizar y optimizar procesos de Spark usando la Spark Web - ...
Meetup: Cómo monitorizar y optimizar procesos de Spark usando la Spark Web - ...Meetup: Cómo monitorizar y optimizar procesos de Spark usando la Spark Web - ...
Meetup: Cómo monitorizar y optimizar procesos de Spark usando la Spark Web - ...
 
Lunch&Learn: Combinación de modelos
Lunch&Learn: Combinación de modelosLunch&Learn: Combinación de modelos
Lunch&Learn: Combinación de modelos
 
Meetup: Spark + Kerberos
Meetup: Spark + KerberosMeetup: Spark + Kerberos
Meetup: Spark + Kerberos
 
Distributed Logistic Model Trees
Distributed Logistic Model TreesDistributed Logistic Model Trees
Distributed Logistic Model Trees
 
Multiplaform Solution for Graph Datasources
Multiplaform Solution for Graph DatasourcesMultiplaform Solution for Graph Datasources
Multiplaform Solution for Graph Datasources
 
Stratio's Cassandra Lucene index: Geospatial use cases - Big Data Spain 2016
Stratio's Cassandra Lucene index: Geospatial use cases - Big Data Spain 2016Stratio's Cassandra Lucene index: Geospatial use cases - Big Data Spain 2016
Stratio's Cassandra Lucene index: Geospatial use cases - Big Data Spain 2016
 
[Strata] Sparkta
[Strata] Sparkta[Strata] Sparkta
[Strata] Sparkta
 
Introduction to Asynchronous scala
Introduction to Asynchronous scalaIntroduction to Asynchronous scala
Introduction to Asynchronous scala
 
Functional programming in scala
Functional programming in scalaFunctional programming in scala
Functional programming in scala
 
Spark Streaming @ Berlin Apache Spark Meetup, March 2015
Spark Streaming @ Berlin Apache Spark Meetup, March 2015Spark Streaming @ Berlin Apache Spark Meetup, March 2015
Spark Streaming @ Berlin Apache Spark Meetup, March 2015
 
Advanced search and Top-K queries in Cassandra
Advanced search and Top-K queries in CassandraAdvanced search and Top-K queries in Cassandra
Advanced search and Top-K queries in Cassandra
 

Recently uploaded

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
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 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
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 DevelopmentsTrustArc
 

Recently uploaded (20)

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
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
 

Using Kafka on Event-driven Microservices Architectures - Apache Kafka Meetup

  • 2. Who am I? Oscar Gómez Soriano What I Do? Software Architect / Developer @Stratio BD How can you contact me? ogomez@stratio.com Oscar Gómez Soriano @oskarflesh
  • 3. 1. Event Driven Architectures 2. Real Use Case: Appointment Creation System 3. Architectural Solution 4. Improving the Architecture AGENDA
  • 5. “An enterprise application is a system that reacts to events from the outside world”. Martin Fowler
  • 6. Event-driven Architectural Patterns We can find 4 great types of event-driven architectural patterns depending on the way the events are used: ● Event Notification - This happens when a system sends event messages to notify other systems of a change in its domain. A key element of event notification is that the source system doesn't really care much about the response. ● Event-Carried State Transfer - The event sended contains all the info needed to update the “recipient system” in such a way that it doesn't need to contact the source system in order to do further work.
  • 7. Event-driven Architectural Patterns ● Event-Sourcing - The core idea of event sourcing is that whenever we make a change to the state of a system, we record that state change as an event, and we can confidently rebuild the system state by reprocessing the events at any time in the future. The event store becomes the principal source of truth, and the system state is purely derived from it. For programmers, the best example of this is a version- control system. The log of all the commits is the event store and the working copy of the source tree is the system state.
  • 8. Event-driven Architectural Patterns ● CQRS - Command Query Responsibility Segregation (CQRS) is the notion of having separate data structures for reading and writing information. Strictly CQRS isn't really about events, since you can use CQRS without any events present in your design. But commonly people do combine CQRS with the earlier patterns here, hence their presence at the summit.
  • 9. Implementing Event-driven Architectures “A event-messaging-based application typically uses a message broker, which is an infrastructure service through which the services communicates. However, a broker-based architecture is not the only messaging architecture. You can also use a brokerless-based messaging architecture in which the services communicate with one another directly”. Chris Richardson - Microservices Patterns
  • 10. Broker-Based Messaging Benefits & Drawbacks There are many advantages to using broker-based messaging: ● Loose Coupling - a client makes a request simply sending a message to the appropriate channel. The client is completely unaware of the service instances. It does not need to use a discovery mechanism to determine the location of a service instance. ● Message Buffering - the message broker buffers messages until they can be processed. This means, for example, that an online store can accept orders from customers, even when the order fulfillment system is slow or unavailable. The Order messages will simply queue up. ● Explicit Inter-Process Communication - Messaging makes differences between remote and local services very explicit so developers are not lulled into a false sense of security.
  • 11. Broker-Based Messaging Benefits & Drawbacks There are some, however, downsides to using messaging: ● Potential performance bottleneck - there is a risk that the message broker could be a performance bottleneck. Fortunately, many modern message brokers are designed to be highly scalable. ● Potential single-point of failure - its essential that the message broker is highly available otherwise system reliability will be impacted. Fortunately, most modern brokers have are designed to be highly available. ● Additional operational complexity - the messaging system is yet another system component that must be installed, configured and operated.
  • 13. The Challenge The basic idea is to construct an Appointment Creation System. On matter of the performance & functional requirements we got 3 different scenarios depends on the user who interacts with the system: ● Final user ● Admin User ● BI User ● AI User
  • 14. The Challenge: Final User Requirements 1. The user can consult calendars to be able to see the available appointments & create it. 2. The user can check their created appointments and reschedule/cancel it. 3. By default, a same hole can not be reserved by two users at the same time, an overload algorithm determines if this restriction is disabled. 4. An AI model determines the probability that the patient attends the appointment and an algorithm determines the overload capacity.
  • 15. The Challenge: Admin User Requirements 1. A admin user can consult existing appointments. Using filters they can adjust their search. 2. The Admin user can create appointments for patients.
  • 16. The Challenge: BI User Requirements 1. The BI users can calculate business metrics from visits events in near real time. 2. The BI user can visualize the values ​​of these metrics through dashboards.
  • 17. The Challenge: AI User Requirements 1. A data scientist has an advanced analytical environment in which they can develop models from the information obtained through the system. 2. The data scientist can do data discovery using Stratio Discovery
  • 18. The Challenge: Performance Requirements 1. Response time for more complex operations less than 250 ms. 1. Transactional process supporting 10,000 online users interacting appointment API (creation/cancel/Rescheduling) and consulting calendars in a two minute window. 1. Replication of the data to the query model must respond to the principle of eventual consistency with a delay of less than 1 minute, regardless of the size of the HDFS block.
  • 22. Architectural Solution On Detail : Appointment Service
  • 23. Architectural Solution On Detail : Calendar Search
  • 24. Architectural Solution On Detail : KPIs (BI Users)
  • 25. Performance Test Results: Test Scenario Infrastructure: ● Stratio DataCentric Platform deployed on Azure Cloud ● 500,000 pre-reserved appointments. ● > 84,000 agendas registered in the system. ● Production Masters Data ● Test Distribution by functionality: ○ 37% Calendar Search ○ 16,67% Appointment Inserts ○ 15,15% Appointment Reschedule/Cancel ○ 30,30% Created Appointment Search ● Microservices Resource Configuration: ○ Calendar: 4 cores y 4GB, Autoscaler Config from 2 to 5 instances. ○ Appointment: 1 Core, 1GB, Autoscaler Config from 2 to 5 instances. ○ Masters: 1 Core, 1GB Autoscaler Config from 2 to 3 instances.
  • 26. Performance Test Results Performance Test Results: 2 Hour Performance Test 88 tps (10483 2 minute window) Microservice Request Distribution Request/ s Media Calendar Search 37,88 % 33 20 ms Appointment Insert 16,67 % 15 64 ms Reschedule / Cancel 15,15 % 14 74 ms Appointment Search 30,30 % 26 26 ms 2 Hour Performance Test 178 tps (10483 1 minute window) Microservice Request Distribution Request/s Media Calendar Search 37,88 % 67 19 ms Appointment Insert 16,67 % 30 106 ms Reschedule / Cancel 15,15 % 28 91 ms Appointment Search 30,30 % 53 46 ms
  • 28. Knowing the Gaps With this numbers in mind we identify two possible bottlenecks on this Architecture: ● Created Appointment Search: As the search and insertion go against the same service and database model both operations are penalized. In addition, the model applied to the insertion is not optimal for the search since it forces the front to make auxiliary requests to obtain the data it needs. ● Calendar Service Responsibilities: Another gap we found is that Calendar service has to receive & process the kafka events (overbooking calculations & update the cache model) and at the same time attend to the get calendar requests so in times of high demand we will have a lot of kafka events to process which could slow down the search speed of the calendars. ● Another consideration to take is that despite having demonstrated a high performance, Memcached is not a solution that can scale well having a series of limitations such as not having a persistence mechanism of its own, having a high availability solution or not being a distributed system Once we know our service needs in matter of performance and scalability it’s time to take advantage of the decoupled way of development we use and separate those subdomains on separate services.