SlideShare une entreprise Scribd logo
1  sur  32
Event Driven Architectures
Avinash Ramineni
• What is Event Driven Architecture
• How is EDA related to SOA
• Event Capture/Generation
• Event Processing
• Event Delivery Guarantees
• Complex Event Processing
• Events, Internet of Things and Big Data
Agenda
• Significant change in the state of an Object
– Bank Transaction
– Students grade gets posted
– New Order gets created
– Customer Profile gets updated
– Change in Heart Beat
• Characteristics of an Event
– Events are broadcast
– Communications are asynchronous
– Events are fine grained
Event
• Handling of the Events as they occur and the transfer of
events among the systems in a loosely coupled way
• Enables Situation Awareness and enables sense-and-respond
behavior
Event Driven Architecture (EDA)
• Characteristics of EDA
– Producer/Consumers are not aware of each other
– Little or no statefullness
– Distributed
– Loosely Coupled
– Platform and Language Independent
– Reliable
– Fast and Highly Scalable
Event Driven Architecture (EDA)
EDA extension of SOA
Computing
with event
objects
REST, URIs and
HTTP
Event Processing
RPC-style SOA
Event-driven
SOA
SOA
Web Architecture
Component
software done
right
Web-oriented
architecture
(WOA)
Non-SOA EDA
and CEP
Simple Web
sites
• EDA similar to SOA facilitates Agility by using Modular Design
and Separation of Concerns
• EDA fits well into organizations that have some SOA
infrastructure in place
• EDA adds another dimension / Possibilities to SOA
– Events are generally stateless and do not have much content
• While processing the events that do not have much data in them, the consuming
applications call the services exposed to get the actual data
• Publish – Subscribe Model
– Similar to Asynchronous Messaging Architectures
EDA extension to SOA
• Application Generated
– Application generates an event when a business transaction
completes
– Events generated by parsing the access logs/ server logs
– Polling web pages
– capturing the events from the services
• Database Generated
– Database Trigger generated Events
• On insert/update/delete
– During database replication
How to generate Events
• The network is reliable
• Latency is zero
• Bandwidth is infinite
• The network is secure
• Topology does not change
• Transport cost is zero
• Network is homogeneous
Fallacies of Distributed Systems
• Send an email when a customers profile gets updated
Customer Profile
– Assumptions:
• There is an Application A that provides a updateProfileService
• There is an Application B that provides a sendEmailService
• All the Events are delivered with Once and Only Once SLA and the Events
are processed
Usecase: 1
A
Event
Channel
DB
Update DB
Profile Updated Event
B
• The overhead involved in capturing events must be as low as
possible to avoid impairing the performance of a business
transaction.
• Business Transaction and the Event generation needs to be in
the same transaction
– 1,2 needs to be part of a same transaction
• Both 1 and 2 should succeed or both should fail
Considerations while generating Events
A
Event
Channel
DB
1. Update DB
2. Profile Updated Event
B
• Successful Update of Profile -- Call a service to publish a
Profile update Event
• Can a database transaction and Web service call be made
atomic?
Usecase: 1 – Web service
try{
1. Update Profile on DB
2. Call web service to publish profile
updated event
} catch(Exception e)
{
rollback();
}
commit;
try{
1. Update Profile on DB
} catch(Exception e)
{
rollback();
}
commit();
2. Call web service to publish profile
updated event
• Can Compensating Transaction work ?
• Successful Update of Profile -- Put a message on to Message
Broker
Usecase: 1 – JMS
A Event Channel
DB
1. Update DB
2. Profile Updated Event
(JMS message)
B
• Possible to make 1 and 2 into a single transaction but it
requires – Distributed Transaction.
• Follows 2 Phase Commit protocol
• Very Chatty protocol and does a lot of logging to be able to
recover from any failure scenario.
• Too much overhead to 99.9% of the cases to handle less than
0.1% of cases
• Increases the chances for deadlocks on the database.
• Lowers the overall performance of the system.
• Bane of scalability. Grinds the entire system to halt by adding
overhead to each and every transaction.
Distributed/XA Transactions (1)
• Availability of the Systems goes down.
• XA Configuration is complicated
• Difficult to test.
• Many People tend to believe that using JTA implementation of
transaction manager will take care of a XA transactions
• Many a time people end up using JTA Manager even while
dealing with single resource.
Distributed/XA Transactions (2)
• Successful Update of Profile -- Put a message on to Message
Broker
Usecase: 1 – Local Database
A
Event Channel
DB
1. Update DB
3. Batch process to send
events to Event Channel
B
• 1 and 2 are in same transaction. 3 can be retried multiple
times till they succeed.
2. Store Event
• Successful Update of Profile -- Put a message on to Message
Broker
Usecase: 1 – Local JMS
A
Event Channel
DB
1. Update DB
3. Publish to Event
Channel(JMS message)
B
• Possible to make 1 and 2 into a single transaction without a
Distributed Transaction as long as Queue is backed by a same
database
queue
Send Event to Local Queue
2
• Successful Update of Profile -- Put a message on to Message
Broker / Call a web service to publish an Event
• Have a Reconciliation Process in place to verify that there is
an event generated for every Business Transaction
– Have a unique Id (may be stored in DB) along with update and use that
Id as Correlation Id with the Events Archive
– If it events don’t tally up, recreate those events
• Use the DB triggers to generate events
– Write to a different local table
– Call a web service to send the event to event channel (have seen
people do that)
Usecase: 1 – Other Ways
• Event Delivery Guarantees
– Reliability
• At least Once
– Duplicate events can be delivered
• At most Once
– Some events can be lost
• Once and only Once
– Each is delivered Exactly once
– Order of Delivery
• In Order Guaranteed
• In Order not Guaranteed
Event Delivery
• Processing an Event and associated Business Transaction
needs to be in the same transaction
• 3,2 needs to be part of a same transaction
• Both 3 and 2 should succeed or both should fail
Considerations while Processing
Events
Event
Channel
3. Acknowledge Event
Process success
1. Profile Updated Event
B
2. Send Email
• On Profile Update Event -- Call a service to send Email and on
success acknowledge process successful
Usecase: 1 – Consumer (1)
onMessage
try {
sendEmail();
jms.commit()
}
catch (Exception e) {
jms.rollback()
}
• What if jms.commit() fails ??
• If Jms.commit() fails , message gets delivered again
Usecase: 1 – Consumer (2)
onMessage
try {
if I have not processed this message successfully before {
do some stuff in the database / Idempotency Logic /JMSRelivered flag
jdbc.commit;
}
jms.commit()
}
catch (Exception e) {
jms.rollback()
}
• Idempotent Operation
– An idempotent operations means that the result of a successful
performed request is independent of the number of times it is
executed.
• Design consumer to be an Idempotent Consumer
– By Understanding the Business rules it can be achieved relatively easy
• Good Practice to make all the write operations Idempotent !!
• Idempotency logic can be built on Event Ids, Business Ids –
orderId, customerId, etc based on the Business scenario
Work Around for At-Least-Once
• In-order delivery of events
– Limit the number of event publisher/consumer instance
for these specific events to 1
• Brings up questions like if one of the event is having an issue – all
the events of that event type can come to a stand still
– AVOID the need for In-order Delivery of Events
• By limiting the content in the Event , we can avoid a lot of cases
where In-order delivery is required
• Using Message Selectors to select and aggregate the events can
solve a few of the cases
What If In-order Delivery is required
• Student Information System (SIS) maintain a list of students in
a course roster. The students can be added or dropped from
the course roster. SIS sends an event to Learning Management
System (LMS) when the roster gets updated.
• Lets us assume that SIS is sending the course roster as part of
the event.
• Processing of this Event requires the Roster Change events to
be delivered in order to maintain the data from getting
corrupted.
Usecase: 2
Usecase: 2 – Requires In-Order
SIS
Event
Channel
DB
2. Deliver Roster
Change Event
LMS
LMS DB
1. Roster Change Event
• Remove the roster data from the event and just pass a roster
Id
• On Delivery of the Event , the LMS system would use the
rosterId from the event, makes a service call to the source
system (SIS) to get the latest Roster data and builds the
classes in LMS
• Even if the events are delivered out of order , the roster data
on LMS will be always be the latest.
• By making the processor on LMS idempotent, we can even
avoid the database update
Usecase: 2 - Solution
Usecase: 2
SIS
Event
Channel
DB
2. Deliver Roster
Change Event
LMS
LMS DB
1. Roster Change Event
3. Get the latest roster
for the Id
4. Update the LMS
database
• Make Event Publishers responsible for making sure that
events are generated for every Business transaction and are
published to the event channel
• Make Event Consumers responsible for making sure that they
react to the Stimuli from the event
• Dashboards in place to make sure failed Events are detected
and acted upon
• Collects Stats to see if the events need to be made finer or
coarser
• Maintain Event Catalogs and self service capabilities to
subscribe to events
Best Practices
Complex Event Processing (CEP)
Traditional BI finds "needles
in haystacks."
Event-driven CEP finds
"needles" in continuously
arriving streams of "hay."
• CEP tap the events happening with in an organization and
provide a situation awareness and enable better and faster
decisions
– Identify complicated events that are inferred from event pattern
detection, event pattern interpretors and so on
– Ex: Monitoring – capture events from ticket system, network load,
performance and send out notification bring up new servers into the
pool
• With Big Data hype and with the “capture-it-all“ approach and
IoT , EDA and Event Driven programming will get a huge boost
in the coming years.
• Events and EDA due to their characteristics will be very well
suited for Ubiquitous Computing
• We might start seeing an advent of Complex Event
Applications by being used by various gadgets
– The concepts of EDA and Events will be a perfect Match for gadgets like Basis ,FIT
Events ,Big Data and Internet of Things
Industry ExperienceQuestions ?
avinash@clairvoyantsoft.com
Twitter:@avinashramineni

Contenu connexe

Tendances

Event Driven Architectures
Event Driven ArchitecturesEvent Driven Architectures
Event Driven ArchitecturesAvinash Ramineni
 
Workflows via Event driven architecture
Workflows via Event driven architectureWorkflows via Event driven architecture
Workflows via Event driven architectureMilan Patel
 
Event-driven architecture
Event-driven architectureEvent-driven architecture
Event-driven architectureAndrew Easter
 
Event Driven Architecture – Enabling Microservices
Event Driven Architecture – Enabling MicroservicesEvent Driven Architecture – Enabling Microservices
Event Driven Architecture – Enabling MicroservicesBradley Irby
 
WSO2Con ASIA 2016: Event Driven Architecture: Managing Business Dynamics for ...
WSO2Con ASIA 2016: Event Driven Architecture: Managing Business Dynamics for ...WSO2Con ASIA 2016: Event Driven Architecture: Managing Business Dynamics for ...
WSO2Con ASIA 2016: Event Driven Architecture: Managing Business Dynamics for ...WSO2
 
A practical introduction to Event Sourcing and CQRS
A practical introduction to Event Sourcing and CQRSA practical introduction to Event Sourcing and CQRS
A practical introduction to Event Sourcing and CQRSRobert Lemke
 
Introducing Ironstream Support for ServiceNow Event Management
Introducing Ironstream Support for ServiceNow Event Management Introducing Ironstream Support for ServiceNow Event Management
Introducing Ironstream Support for ServiceNow Event Management Precisely
 
Bright talk mapping the right aut solution for you 2014 final (1)
Bright talk mapping the right aut solution for you 2014 final (1)Bright talk mapping the right aut solution for you 2014 final (1)
Bright talk mapping the right aut solution for you 2014 final (1)Sectricity
 
Partner Transformation for Hybrid Cloud Management
Partner Transformation for Hybrid Cloud ManagementPartner Transformation for Hybrid Cloud Management
Partner Transformation for Hybrid Cloud ManagementVistara
 
Hybrid IT Operations and the Hybrid Cloud
Hybrid IT Operations and the Hybrid CloudHybrid IT Operations and the Hybrid Cloud
Hybrid IT Operations and the Hybrid CloudVistara
 
Event Driven Architecture
Event Driven ArchitectureEvent Driven Architecture
Event Driven ArchitectureChris Patterson
 
Google Cloud and Confluent Streaming: Generating Real Value From Real Time | ...
Google Cloud and Confluent Streaming: Generating Real Value From Real Time | ...Google Cloud and Confluent Streaming: Generating Real Value From Real Time | ...
Google Cloud and Confluent Streaming: Generating Real Value From Real Time | ...confluent
 
Active directory solutions brochure
Active directory solutions brochureActive directory solutions brochure
Active directory solutions brochureZoho Corporation
 
Navigator - Your Cloud Management Platform
Navigator - Your Cloud Management PlatformNavigator - Your Cloud Management Platform
Navigator - Your Cloud Management PlatformFNTS
 
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
 
Mission IT operations for a good night's sleep
Mission IT operations for a good night's sleepMission IT operations for a good night's sleep
Mission IT operations for a good night's sleepwwwally
 
Decrypting the security mystery with SIEM (Part 1) ​
Decrypting the security mystery with SIEM (Part 1)  ​Decrypting the security mystery with SIEM (Part 1)  ​
Decrypting the security mystery with SIEM (Part 1) ​Zoho Corporation
 
RightScale Webinar - Taming Cloud- See and Manage All Your Cloud Usage
RightScale Webinar - Taming Cloud- See and Manage All Your Cloud Usage RightScale Webinar - Taming Cloud- See and Manage All Your Cloud Usage
RightScale Webinar - Taming Cloud- See and Manage All Your Cloud Usage RightScale
 
Analytics plus overview.pptx
Analytics plus overview.pptxAnalytics plus overview.pptx
Analytics plus overview.pptxFanky Christian
 

Tendances (20)

Event Driven Architectures
Event Driven ArchitecturesEvent Driven Architectures
Event Driven Architectures
 
Workflows via Event driven architecture
Workflows via Event driven architectureWorkflows via Event driven architecture
Workflows via Event driven architecture
 
Event-driven architecture
Event-driven architectureEvent-driven architecture
Event-driven architecture
 
Event Driven Architecture – Enabling Microservices
Event Driven Architecture – Enabling MicroservicesEvent Driven Architecture – Enabling Microservices
Event Driven Architecture – Enabling Microservices
 
WSO2Con ASIA 2016: Event Driven Architecture: Managing Business Dynamics for ...
WSO2Con ASIA 2016: Event Driven Architecture: Managing Business Dynamics for ...WSO2Con ASIA 2016: Event Driven Architecture: Managing Business Dynamics for ...
WSO2Con ASIA 2016: Event Driven Architecture: Managing Business Dynamics for ...
 
A practical introduction to Event Sourcing and CQRS
A practical introduction to Event Sourcing and CQRSA practical introduction to Event Sourcing and CQRS
A practical introduction to Event Sourcing and CQRS
 
Event driven architecture
Event driven architectureEvent driven architecture
Event driven architecture
 
Introducing Ironstream Support for ServiceNow Event Management
Introducing Ironstream Support for ServiceNow Event Management Introducing Ironstream Support for ServiceNow Event Management
Introducing Ironstream Support for ServiceNow Event Management
 
Bright talk mapping the right aut solution for you 2014 final (1)
Bright talk mapping the right aut solution for you 2014 final (1)Bright talk mapping the right aut solution for you 2014 final (1)
Bright talk mapping the right aut solution for you 2014 final (1)
 
Partner Transformation for Hybrid Cloud Management
Partner Transformation for Hybrid Cloud ManagementPartner Transformation for Hybrid Cloud Management
Partner Transformation for Hybrid Cloud Management
 
Hybrid IT Operations and the Hybrid Cloud
Hybrid IT Operations and the Hybrid CloudHybrid IT Operations and the Hybrid Cloud
Hybrid IT Operations and the Hybrid Cloud
 
Event Driven Architecture
Event Driven ArchitectureEvent Driven Architecture
Event Driven Architecture
 
Google Cloud and Confluent Streaming: Generating Real Value From Real Time | ...
Google Cloud and Confluent Streaming: Generating Real Value From Real Time | ...Google Cloud and Confluent Streaming: Generating Real Value From Real Time | ...
Google Cloud and Confluent Streaming: Generating Real Value From Real Time | ...
 
Active directory solutions brochure
Active directory solutions brochureActive directory solutions brochure
Active directory solutions brochure
 
Navigator - Your Cloud Management Platform
Navigator - Your Cloud Management PlatformNavigator - Your Cloud Management Platform
Navigator - Your Cloud Management Platform
 
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
 
Mission IT operations for a good night's sleep
Mission IT operations for a good night's sleepMission IT operations for a good night's sleep
Mission IT operations for a good night's sleep
 
Decrypting the security mystery with SIEM (Part 1) ​
Decrypting the security mystery with SIEM (Part 1)  ​Decrypting the security mystery with SIEM (Part 1)  ​
Decrypting the security mystery with SIEM (Part 1) ​
 
RightScale Webinar - Taming Cloud- See and Manage All Your Cloud Usage
RightScale Webinar - Taming Cloud- See and Manage All Your Cloud Usage RightScale Webinar - Taming Cloud- See and Manage All Your Cloud Usage
RightScale Webinar - Taming Cloud- See and Manage All Your Cloud Usage
 
Analytics plus overview.pptx
Analytics plus overview.pptxAnalytics plus overview.pptx
Analytics plus overview.pptx
 

Similaire à Event Driven Architectures - Phoenix Java Users Group 2013

Data Microservices with Spring Cloud
Data Microservices with Spring CloudData Microservices with Spring Cloud
Data Microservices with Spring CloudOrkhan Gasimov
 
CQRS + Event Sourcing
CQRS + Event SourcingCQRS + Event Sourcing
CQRS + Event SourcingMike Bild
 
Introduction to Stream Processing
Introduction to Stream ProcessingIntroduction to Stream Processing
Introduction to Stream ProcessingGuido Schmutz
 
8 application servers_v2
8 application servers_v28 application servers_v2
8 application servers_v2ashish61_scs
 
Patterns of Distributed Application Design
Patterns of Distributed Application DesignPatterns of Distributed Application Design
Patterns of Distributed Application DesignOrkhan Gasimov
 
Event driven architecure
Event driven architecureEvent driven architecure
Event driven architecureTouraj Ebrahimi
 
Stream Processing and Complex Event Processing together with Kafka, Flink and...
Stream Processing and Complex Event Processing together with Kafka, Flink and...Stream Processing and Complex Event Processing together with Kafka, Flink and...
Stream Processing and Complex Event Processing together with Kafka, Flink and...HostedbyConfluent
 
Introduction to Stream Processing
Introduction to Stream ProcessingIntroduction to Stream Processing
Introduction to Stream ProcessingGuido Schmutz
 
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
 
“Controlling of messages flow in Microservices architecture” by Andris Lubans...
“Controlling of messages flow in Microservices architecture” by Andris Lubans...“Controlling of messages flow in Microservices architecture” by Andris Lubans...
“Controlling of messages flow in Microservices architecture” by Andris Lubans...DevClub_lv
 
Patterns of Distributed Application Design
Patterns of Distributed Application DesignPatterns of Distributed Application Design
Patterns of Distributed Application DesignGlobalLogic Ukraine
 
Ekon21 Microservices - Event Driven Design
Ekon21 Microservices - Event Driven DesignEkon21 Microservices - Event Driven Design
Ekon21 Microservices - Event Driven DesignArnaud Bouchez
 
Event Driven Architectures - Net Conf UY 2018
Event Driven Architectures - Net Conf UY 2018Event Driven Architectures - Net Conf UY 2018
Event Driven Architectures - Net Conf UY 2018Bradley Irby
 
Growing into a proactive Data Platform
Growing into a proactive Data PlatformGrowing into a proactive Data Platform
Growing into a proactive Data PlatformLivePerson
 
apidays New York 2023 - Why Finance needs Asychronous APIs, Nicholas Goodman,...
apidays New York 2023 - Why Finance needs Asychronous APIs, Nicholas Goodman,...apidays New York 2023 - Why Finance needs Asychronous APIs, Nicholas Goodman,...
apidays New York 2023 - Why Finance needs Asychronous APIs, Nicholas Goodman,...apidays
 
RuSIEM overview (english version)
RuSIEM overview (english version)RuSIEM overview (english version)
RuSIEM overview (english version)Olesya Shelestova
 

Similaire à Event Driven Architectures - Phoenix Java Users Group 2013 (20)

Data Microservices with Spring Cloud
Data Microservices with Spring CloudData Microservices with Spring Cloud
Data Microservices with Spring Cloud
 
CQRS + Event Sourcing
CQRS + Event SourcingCQRS + Event Sourcing
CQRS + Event Sourcing
 
Micro service architecture
Micro service architecture  Micro service architecture
Micro service architecture
 
Introduction to Stream Processing
Introduction to Stream ProcessingIntroduction to Stream Processing
Introduction to Stream Processing
 
8 application servers_v2
8 application servers_v28 application servers_v2
8 application servers_v2
 
L21 scalability
L21 scalabilityL21 scalability
L21 scalability
 
Patterns of Distributed Application Design
Patterns of Distributed Application DesignPatterns of Distributed Application Design
Patterns of Distributed Application Design
 
Event driven architecure
Event driven architecureEvent driven architecure
Event driven architecure
 
Stream Processing and Complex Event Processing together with Kafka, Flink and...
Stream Processing and Complex Event Processing together with Kafka, Flink and...Stream Processing and Complex Event Processing together with Kafka, Flink and...
Stream Processing and Complex Event Processing together with Kafka, Flink and...
 
Introduction to Stream Processing
Introduction to Stream ProcessingIntroduction to Stream Processing
Introduction to Stream Processing
 
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...
 
“Controlling of messages flow in Microservices architecture” by Andris Lubans...
“Controlling of messages flow in Microservices architecture” by Andris Lubans...“Controlling of messages flow in Microservices architecture” by Andris Lubans...
“Controlling of messages flow in Microservices architecture” by Andris Lubans...
 
Patterns of Distributed Application Design
Patterns of Distributed Application DesignPatterns of Distributed Application Design
Patterns of Distributed Application Design
 
Ekon21 Microservices - Event Driven Design
Ekon21 Microservices - Event Driven DesignEkon21 Microservices - Event Driven Design
Ekon21 Microservices - Event Driven Design
 
Event Driven Architectures - Net Conf UY 2018
Event Driven Architectures - Net Conf UY 2018Event Driven Architectures - Net Conf UY 2018
Event Driven Architectures - Net Conf UY 2018
 
Growing into a proactive Data Platform
Growing into a proactive Data PlatformGrowing into a proactive Data Platform
Growing into a proactive Data Platform
 
Telecom OSS/BSS - Automation
Telecom OSS/BSS - Automation Telecom OSS/BSS - Automation
Telecom OSS/BSS - Automation
 
Database Management System - 2a
Database Management System - 2aDatabase Management System - 2a
Database Management System - 2a
 
apidays New York 2023 - Why Finance needs Asychronous APIs, Nicholas Goodman,...
apidays New York 2023 - Why Finance needs Asychronous APIs, Nicholas Goodman,...apidays New York 2023 - Why Finance needs Asychronous APIs, Nicholas Goodman,...
apidays New York 2023 - Why Finance needs Asychronous APIs, Nicholas Goodman,...
 
RuSIEM overview (english version)
RuSIEM overview (english version)RuSIEM overview (english version)
RuSIEM overview (english version)
 

Plus de clairvoyantllc

Getting started with SparkSQL - Desert Code Camp 2016
Getting started with SparkSQL  - Desert Code Camp 2016Getting started with SparkSQL  - Desert Code Camp 2016
Getting started with SparkSQL - Desert Code Camp 2016clairvoyantllc
 
MongoDB Replication fundamentals - Desert Code Camp - October 2014
MongoDB Replication fundamentals - Desert Code Camp - October 2014MongoDB Replication fundamentals - Desert Code Camp - October 2014
MongoDB Replication fundamentals - Desert Code Camp - October 2014clairvoyantllc
 
Architecture - December 2013 - Avinash Ramineni, Shekhar Veumuri
Architecture   - December 2013 - Avinash Ramineni, Shekhar VeumuriArchitecture   - December 2013 - Avinash Ramineni, Shekhar Veumuri
Architecture - December 2013 - Avinash Ramineni, Shekhar Veumuriclairvoyantllc
 
Big data in the cloud - Shekhar Vemuri
Big data in the cloud - Shekhar VemuriBig data in the cloud - Shekhar Vemuri
Big data in the cloud - Shekhar Vemuriclairvoyantllc
 
Webservices Workshop - september 2014
Webservices Workshop -  september 2014Webservices Workshop -  september 2014
Webservices Workshop - september 2014clairvoyantllc
 
Bigdata workshop february 2015
Bigdata workshop  february 2015 Bigdata workshop  february 2015
Bigdata workshop february 2015 clairvoyantllc
 
Running Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on HadoopRunning Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on Hadoopclairvoyantllc
 
Databricks Community Cloud
Databricks Community CloudDatabricks Community Cloud
Databricks Community Cloudclairvoyantllc
 
Log analysis using Logstash,ElasticSearch and Kibana - Desert Code Camp 2014
Log analysis using Logstash,ElasticSearch and Kibana - Desert Code Camp 2014Log analysis using Logstash,ElasticSearch and Kibana - Desert Code Camp 2014
Log analysis using Logstash,ElasticSearch and Kibana - Desert Code Camp 2014clairvoyantllc
 
Strata+Hadoop World NY 2016 - Avinash Ramineni
Strata+Hadoop World NY 2016 - Avinash RamineniStrata+Hadoop World NY 2016 - Avinash Ramineni
Strata+Hadoop World NY 2016 - Avinash Ramineniclairvoyantllc
 
HBase from the Trenches - Phoenix Data Conference 2015
HBase from the Trenches - Phoenix Data Conference 2015HBase from the Trenches - Phoenix Data Conference 2015
HBase from the Trenches - Phoenix Data Conference 2015clairvoyantllc
 

Plus de clairvoyantllc (12)

Getting started with SparkSQL - Desert Code Camp 2016
Getting started with SparkSQL  - Desert Code Camp 2016Getting started with SparkSQL  - Desert Code Camp 2016
Getting started with SparkSQL - Desert Code Camp 2016
 
MongoDB Replication fundamentals - Desert Code Camp - October 2014
MongoDB Replication fundamentals - Desert Code Camp - October 2014MongoDB Replication fundamentals - Desert Code Camp - October 2014
MongoDB Replication fundamentals - Desert Code Camp - October 2014
 
Architecture - December 2013 - Avinash Ramineni, Shekhar Veumuri
Architecture   - December 2013 - Avinash Ramineni, Shekhar VeumuriArchitecture   - December 2013 - Avinash Ramineni, Shekhar Veumuri
Architecture - December 2013 - Avinash Ramineni, Shekhar Veumuri
 
Big data in the cloud - Shekhar Vemuri
Big data in the cloud - Shekhar VemuriBig data in the cloud - Shekhar Vemuri
Big data in the cloud - Shekhar Vemuri
 
Webservices Workshop - september 2014
Webservices Workshop -  september 2014Webservices Workshop -  september 2014
Webservices Workshop - september 2014
 
Bigdata workshop february 2015
Bigdata workshop  february 2015 Bigdata workshop  february 2015
Bigdata workshop february 2015
 
Intro to Apache Spark
Intro to Apache SparkIntro to Apache Spark
Intro to Apache Spark
 
Running Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on HadoopRunning Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on Hadoop
 
Databricks Community Cloud
Databricks Community CloudDatabricks Community Cloud
Databricks Community Cloud
 
Log analysis using Logstash,ElasticSearch and Kibana - Desert Code Camp 2014
Log analysis using Logstash,ElasticSearch and Kibana - Desert Code Camp 2014Log analysis using Logstash,ElasticSearch and Kibana - Desert Code Camp 2014
Log analysis using Logstash,ElasticSearch and Kibana - Desert Code Camp 2014
 
Strata+Hadoop World NY 2016 - Avinash Ramineni
Strata+Hadoop World NY 2016 - Avinash RamineniStrata+Hadoop World NY 2016 - Avinash Ramineni
Strata+Hadoop World NY 2016 - Avinash Ramineni
 
HBase from the Trenches - Phoenix Data Conference 2015
HBase from the Trenches - Phoenix Data Conference 2015HBase from the Trenches - Phoenix Data Conference 2015
HBase from the Trenches - Phoenix Data Conference 2015
 

Dernier

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
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
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
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
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Dernier (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

Event Driven Architectures - Phoenix Java Users Group 2013

  • 2. • What is Event Driven Architecture • How is EDA related to SOA • Event Capture/Generation • Event Processing • Event Delivery Guarantees • Complex Event Processing • Events, Internet of Things and Big Data Agenda
  • 3. • Significant change in the state of an Object – Bank Transaction – Students grade gets posted – New Order gets created – Customer Profile gets updated – Change in Heart Beat • Characteristics of an Event – Events are broadcast – Communications are asynchronous – Events are fine grained Event
  • 4. • Handling of the Events as they occur and the transfer of events among the systems in a loosely coupled way • Enables Situation Awareness and enables sense-and-respond behavior Event Driven Architecture (EDA)
  • 5. • Characteristics of EDA – Producer/Consumers are not aware of each other – Little or no statefullness – Distributed – Loosely Coupled – Platform and Language Independent – Reliable – Fast and Highly Scalable Event Driven Architecture (EDA)
  • 6. EDA extension of SOA Computing with event objects REST, URIs and HTTP Event Processing RPC-style SOA Event-driven SOA SOA Web Architecture Component software done right Web-oriented architecture (WOA) Non-SOA EDA and CEP Simple Web sites
  • 7. • EDA similar to SOA facilitates Agility by using Modular Design and Separation of Concerns • EDA fits well into organizations that have some SOA infrastructure in place • EDA adds another dimension / Possibilities to SOA – Events are generally stateless and do not have much content • While processing the events that do not have much data in them, the consuming applications call the services exposed to get the actual data • Publish – Subscribe Model – Similar to Asynchronous Messaging Architectures EDA extension to SOA
  • 8. • Application Generated – Application generates an event when a business transaction completes – Events generated by parsing the access logs/ server logs – Polling web pages – capturing the events from the services • Database Generated – Database Trigger generated Events • On insert/update/delete – During database replication How to generate Events
  • 9. • The network is reliable • Latency is zero • Bandwidth is infinite • The network is secure • Topology does not change • Transport cost is zero • Network is homogeneous Fallacies of Distributed Systems
  • 10. • Send an email when a customers profile gets updated Customer Profile – Assumptions: • There is an Application A that provides a updateProfileService • There is an Application B that provides a sendEmailService • All the Events are delivered with Once and Only Once SLA and the Events are processed Usecase: 1 A Event Channel DB Update DB Profile Updated Event B
  • 11. • The overhead involved in capturing events must be as low as possible to avoid impairing the performance of a business transaction. • Business Transaction and the Event generation needs to be in the same transaction – 1,2 needs to be part of a same transaction • Both 1 and 2 should succeed or both should fail Considerations while generating Events A Event Channel DB 1. Update DB 2. Profile Updated Event B
  • 12. • Successful Update of Profile -- Call a service to publish a Profile update Event • Can a database transaction and Web service call be made atomic? Usecase: 1 – Web service try{ 1. Update Profile on DB 2. Call web service to publish profile updated event } catch(Exception e) { rollback(); } commit; try{ 1. Update Profile on DB } catch(Exception e) { rollback(); } commit(); 2. Call web service to publish profile updated event • Can Compensating Transaction work ?
  • 13. • Successful Update of Profile -- Put a message on to Message Broker Usecase: 1 – JMS A Event Channel DB 1. Update DB 2. Profile Updated Event (JMS message) B • Possible to make 1 and 2 into a single transaction but it requires – Distributed Transaction.
  • 14. • Follows 2 Phase Commit protocol • Very Chatty protocol and does a lot of logging to be able to recover from any failure scenario. • Too much overhead to 99.9% of the cases to handle less than 0.1% of cases • Increases the chances for deadlocks on the database. • Lowers the overall performance of the system. • Bane of scalability. Grinds the entire system to halt by adding overhead to each and every transaction. Distributed/XA Transactions (1)
  • 15. • Availability of the Systems goes down. • XA Configuration is complicated • Difficult to test. • Many People tend to believe that using JTA implementation of transaction manager will take care of a XA transactions • Many a time people end up using JTA Manager even while dealing with single resource. Distributed/XA Transactions (2)
  • 16. • Successful Update of Profile -- Put a message on to Message Broker Usecase: 1 – Local Database A Event Channel DB 1. Update DB 3. Batch process to send events to Event Channel B • 1 and 2 are in same transaction. 3 can be retried multiple times till they succeed. 2. Store Event
  • 17. • Successful Update of Profile -- Put a message on to Message Broker Usecase: 1 – Local JMS A Event Channel DB 1. Update DB 3. Publish to Event Channel(JMS message) B • Possible to make 1 and 2 into a single transaction without a Distributed Transaction as long as Queue is backed by a same database queue Send Event to Local Queue 2
  • 18. • Successful Update of Profile -- Put a message on to Message Broker / Call a web service to publish an Event • Have a Reconciliation Process in place to verify that there is an event generated for every Business Transaction – Have a unique Id (may be stored in DB) along with update and use that Id as Correlation Id with the Events Archive – If it events don’t tally up, recreate those events • Use the DB triggers to generate events – Write to a different local table – Call a web service to send the event to event channel (have seen people do that) Usecase: 1 – Other Ways
  • 19. • Event Delivery Guarantees – Reliability • At least Once – Duplicate events can be delivered • At most Once – Some events can be lost • Once and only Once – Each is delivered Exactly once – Order of Delivery • In Order Guaranteed • In Order not Guaranteed Event Delivery
  • 20. • Processing an Event and associated Business Transaction needs to be in the same transaction • 3,2 needs to be part of a same transaction • Both 3 and 2 should succeed or both should fail Considerations while Processing Events Event Channel 3. Acknowledge Event Process success 1. Profile Updated Event B 2. Send Email
  • 21. • On Profile Update Event -- Call a service to send Email and on success acknowledge process successful Usecase: 1 – Consumer (1) onMessage try { sendEmail(); jms.commit() } catch (Exception e) { jms.rollback() } • What if jms.commit() fails ??
  • 22. • If Jms.commit() fails , message gets delivered again Usecase: 1 – Consumer (2) onMessage try { if I have not processed this message successfully before { do some stuff in the database / Idempotency Logic /JMSRelivered flag jdbc.commit; } jms.commit() } catch (Exception e) { jms.rollback() }
  • 23. • Idempotent Operation – An idempotent operations means that the result of a successful performed request is independent of the number of times it is executed. • Design consumer to be an Idempotent Consumer – By Understanding the Business rules it can be achieved relatively easy • Good Practice to make all the write operations Idempotent !! • Idempotency logic can be built on Event Ids, Business Ids – orderId, customerId, etc based on the Business scenario Work Around for At-Least-Once
  • 24. • In-order delivery of events – Limit the number of event publisher/consumer instance for these specific events to 1 • Brings up questions like if one of the event is having an issue – all the events of that event type can come to a stand still – AVOID the need for In-order Delivery of Events • By limiting the content in the Event , we can avoid a lot of cases where In-order delivery is required • Using Message Selectors to select and aggregate the events can solve a few of the cases What If In-order Delivery is required
  • 25. • Student Information System (SIS) maintain a list of students in a course roster. The students can be added or dropped from the course roster. SIS sends an event to Learning Management System (LMS) when the roster gets updated. • Lets us assume that SIS is sending the course roster as part of the event. • Processing of this Event requires the Roster Change events to be delivered in order to maintain the data from getting corrupted. Usecase: 2
  • 26. Usecase: 2 – Requires In-Order SIS Event Channel DB 2. Deliver Roster Change Event LMS LMS DB 1. Roster Change Event
  • 27. • Remove the roster data from the event and just pass a roster Id • On Delivery of the Event , the LMS system would use the rosterId from the event, makes a service call to the source system (SIS) to get the latest Roster data and builds the classes in LMS • Even if the events are delivered out of order , the roster data on LMS will be always be the latest. • By making the processor on LMS idempotent, we can even avoid the database update Usecase: 2 - Solution
  • 28. Usecase: 2 SIS Event Channel DB 2. Deliver Roster Change Event LMS LMS DB 1. Roster Change Event 3. Get the latest roster for the Id 4. Update the LMS database
  • 29. • Make Event Publishers responsible for making sure that events are generated for every Business transaction and are published to the event channel • Make Event Consumers responsible for making sure that they react to the Stimuli from the event • Dashboards in place to make sure failed Events are detected and acted upon • Collects Stats to see if the events need to be made finer or coarser • Maintain Event Catalogs and self service capabilities to subscribe to events Best Practices
  • 30. Complex Event Processing (CEP) Traditional BI finds "needles in haystacks." Event-driven CEP finds "needles" in continuously arriving streams of "hay." • CEP tap the events happening with in an organization and provide a situation awareness and enable better and faster decisions – Identify complicated events that are inferred from event pattern detection, event pattern interpretors and so on – Ex: Monitoring – capture events from ticket system, network load, performance and send out notification bring up new servers into the pool
  • 31. • With Big Data hype and with the “capture-it-all“ approach and IoT , EDA and Event Driven programming will get a huge boost in the coming years. • Events and EDA due to their characteristics will be very well suited for Ubiquitous Computing • We might start seeing an advent of Complex Event Applications by being used by various gadgets – The concepts of EDA and Events will be a perfect Match for gadgets like Basis ,FIT Events ,Big Data and Internet of Things

Notes de l'éditeur

  1. As defined by Gartner SOA is classified into multiple styles RPC-Style , WOA-style , Event Driven SOA
  2. Application generated events are generally Coarse grained. Database generated events are generally grained
  3. kind of ID and version, you can often detect duplicates yourself and so not require to pay the performance cost of XA