SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Downloaden Sie, um offline zu lesen
Supporting iterative
development of an Event
Driven Platform
The Problem
Changes such as business logic modifications, adding enrichments, or bug fixing could
invalidate cached and persisted data.
And consumers need to be protected from changes by upstream producers.
How do we:
• Support active development and iterative releases
• Deal with failure pragmatically
• Only serve current and correct data
• Avoid breaching non-functional requirements
With agile approaches we (typically) don’t do big-bang releases but develop business
functionality through frequent incremental releases.
Classic approaches don’t meet these needs
Calculate on-demand
Pull model: Business logic is
applied on request.
Bulk recalculation ƛ
Push model: Result of business
logic is stored in a persisted store,
with the calculation running as a
large job.
Stream replay ϰ
Push model: Business logic is
applied to single messages or
small windows and then sent to
another stream or stored/cached.
• No risk of staleness as data is
always fresh
• Cannot use pure-streaming as
needs random access to data
• May breach NFRs if calculation
takes too long or dependent
services are slow
• Streaming!
• Risk of staleness or missing
data
• Can be used in conjunction
with streaming
• Risk of staleness or missing
data as request may happen
whilst results are being
updated
• Depending on scenarios,
tends to be more efficient for
large reprocessing
Always being right
Our approach
• Everything is versioned:
• Importantly, the persisted data is as well
• REST service requests appropriately
versioned persisted data
• Persisted data updated after business
logic change through bulk processing:
• Not really a lambda architecture à only run
bulk processing during uplift
• REST service could request data
waiting to be recalculated:
• Have a mechanism to ‘fast track’
calculations of requested stale data
Fully streaming
• Single code-base supports both BAU
and stale-data requests
• Need a separate topic and job for fast
tracked recalculation requests to allow
them to be prioritised:
• Cannot currently configure Consumers &
Streams to prioritise a topic (KIP-349)
• Simpler streaming jobs but increased
complexity in the REST services:
• REST services have to poll database until
version is updated
• REST services have to know how to put
messages onto the recalc topic%
Encapsulated REST services
• Streaming jobs are simple co-
ordinators:
• REST services contain the business logic
and do all data processing
• REST services are simpler and self-
contained for stale data requests:
• Don’t need to put messages back onto a
topic
• Requests simply block until the data is
updated
• Topic management is much simpler…
• But the complexity has moved into the
streaming jobs:
• Have to handle failure states for REST such
as overload, timeouts, transactions, etc
Bulk reprocessing
• ƛ-style: batch-job
• Requires original messages to have been saved to non-streaming store
• If business logic is held within REST services, can simply call them
• If stream job, can copy data back to the original stream or a new one
• Could also have the bulk job run the business logic, but then have duplicity issues
• ϰ-style: stream replay
• Have to be careful of caches: single topic can’t efficiently serve both the head and random access
• May be better to have two topics: one for live data and one for replays
• Simpler deployment stack as doesn’t require extra technology à simply reset the offset
Defending the realm
Defensive strategies
• Producers validate all messages against a JSON schema before sending
• Consumers accept a fixed range of schema versions and validate payloads:
• Ensure standards compliance of producer by ignoring incorrectly headered messages
• Will ignore any messages which fall outside of configured schema/library range
• Messages which fail schema validation are sent to a DLQ
• Schema failures over a configured windowed-threshold could kill the job
• Retry and failure functionality
• All interactions with services/systems use patterns such as circuit breakers and
back-pressure
• Baked in libraries such as Micrometer and OpenTracing to enforce integration with
operations stack
Retry & failure
• Developers could choose from multiple
retry and failure options
• Could combine strategies:
• Retry 5 times, then pause 5 times, then fail
• Pause and park had exponential time
strategies:
• Short pause now but then give a service
more time to recover
• Retry:
• Retry message immediately
• Pause:
• Pauses the job entirely
• Used when ordering is important
• Park:
• Puts message on hold but keeps processing
topic
• Could use multiple topics or RocksDB
• Used when ordering isn’t important
• Fail:
• Sends message to DLQ immediately
• Schema validation errors and the like
DLQs
• If all else fails, ask a human to intervene
• May need to kill the job, if message ordering is important
• Need to provide tooling for admins to investigate and replay messages from the DLQ
• Have to think about replays:
• Track attempts so that a message doesn’t keep looping through
• What happens if you replay the topic: do you want to replay dead messages?
• Typically only saw messages on the DLQ during pre-prod testing:
• Retry strategies dealt with most services issues
• Schema enforcement in producer removed chance of corrupt messages
Outcomes
• Reduced data risks surrounding deployments:
• Only correct data would be served via services
• Platform downtime was reduced:
• Allowing upgrade scripts to be run during live hours reduced deployment pressures
• Provided reassurance around NFRs during upgrades:
• Platform was sized to ensure NFRs weren’t breached during deployments
• Customer bought into trade-offs on increased latency for increased correctness
• Provided strong contracts between teams:
• Defensive measures allowed developers to focus on business logic
A Marriage of Lambda and Kappa: Supporting Iterative Development of an Event Driven Platform (Peter Hannam, 6point6) Kafka Summit London 2019

Weitere ähnliche Inhalte

Was ist angesagt?

Stream Me Up, Scotty: Transitioning to the Cloud Using a Streaming Data Platform
Stream Me Up, Scotty: Transitioning to the Cloud Using a Streaming Data PlatformStream Me Up, Scotty: Transitioning to the Cloud Using a Streaming Data Platform
Stream Me Up, Scotty: Transitioning to the Cloud Using a Streaming Data Platform
confluent
 

Was ist angesagt? (20)

Using Machine Learning to Understand Kafka Runtime Behavior (Shivanath Babu, ...
Using Machine Learning to Understand Kafka Runtime Behavior (Shivanath Babu, ...Using Machine Learning to Understand Kafka Runtime Behavior (Shivanath Babu, ...
Using Machine Learning to Understand Kafka Runtime Behavior (Shivanath Babu, ...
 
Kafka at scale facebook israel
Kafka at scale   facebook israelKafka at scale   facebook israel
Kafka at scale facebook israel
 
3 Ways to Deliver an Elastic, Cost-Effective Cloud Architecture (ANZ)
3 Ways to Deliver an Elastic, Cost-Effective Cloud Architecture (ANZ)3 Ways to Deliver an Elastic, Cost-Effective Cloud Architecture (ANZ)
3 Ways to Deliver an Elastic, Cost-Effective Cloud Architecture (ANZ)
 
KafkaConsumer - Decoupling Consumption and Processing for Better Resource Uti...
KafkaConsumer - Decoupling Consumption and Processing for Better Resource Uti...KafkaConsumer - Decoupling Consumption and Processing for Better Resource Uti...
KafkaConsumer - Decoupling Consumption and Processing for Better Resource Uti...
 
Real-time Data Ingestion from Kafka to ClickHouse with Deterministic Re-tries...
Real-time Data Ingestion from Kafka to ClickHouse with Deterministic Re-tries...Real-time Data Ingestion from Kafka to ClickHouse with Deterministic Re-tries...
Real-time Data Ingestion from Kafka to ClickHouse with Deterministic Re-tries...
 
Introducing Events and Stream Processing into Nationwide Building Society (Ro...
Introducing Events and Stream Processing into Nationwide Building Society (Ro...Introducing Events and Stream Processing into Nationwide Building Society (Ro...
Introducing Events and Stream Processing into Nationwide Building Society (Ro...
 
How Zillow Unlocked Kafka to 50 Teams in 8 months | Shahar Cizer Kobrinsky, Z...
How Zillow Unlocked Kafka to 50 Teams in 8 months | Shahar Cizer Kobrinsky, Z...How Zillow Unlocked Kafka to 50 Teams in 8 months | Shahar Cizer Kobrinsky, Z...
How Zillow Unlocked Kafka to 50 Teams in 8 months | Shahar Cizer Kobrinsky, Z...
 
Scaling Security on 100s of Millions of Mobile Devices Using Apache Kafka® an...
Scaling Security on 100s of Millions of Mobile Devices Using Apache Kafka® an...Scaling Security on 100s of Millions of Mobile Devices Using Apache Kafka® an...
Scaling Security on 100s of Millions of Mobile Devices Using Apache Kafka® an...
 
Kickstart your Kafka with Faker Data | Francesco Tisiot, Aiven.io
Kickstart your Kafka with Faker Data | Francesco Tisiot, Aiven.ioKickstart your Kafka with Faker Data | Francesco Tisiot, Aiven.io
Kickstart your Kafka with Faker Data | Francesco Tisiot, Aiven.io
 
Building Large-Scale Stream Infrastructures Across Multiple Data Centers with...
Building Large-Scale Stream Infrastructures Across Multiple Data Centers with...Building Large-Scale Stream Infrastructures Across Multiple Data Centers with...
Building Large-Scale Stream Infrastructures Across Multiple Data Centers with...
 
Data integration with Apache Kafka
Data integration with Apache KafkaData integration with Apache Kafka
Data integration with Apache Kafka
 
Easily Build a Smart Pulsar Stream Processor_Simon Crosby
Easily Build a Smart Pulsar Stream Processor_Simon CrosbyEasily Build a Smart Pulsar Stream Processor_Simon Crosby
Easily Build a Smart Pulsar Stream Processor_Simon Crosby
 
Metrics Are Not Enough: Monitoring Apache Kafka and Streaming Applications
Metrics Are Not Enough: Monitoring Apache Kafka and Streaming ApplicationsMetrics Are Not Enough: Monitoring Apache Kafka and Streaming Applications
Metrics Are Not Enough: Monitoring Apache Kafka and Streaming Applications
 
Building Retry Architectures in Kafka with Compacted Topics | Matthew Zhou, V...
Building Retry Architectures in Kafka with Compacted Topics | Matthew Zhou, V...Building Retry Architectures in Kafka with Compacted Topics | Matthew Zhou, V...
Building Retry Architectures in Kafka with Compacted Topics | Matthew Zhou, V...
 
Introduction to ksqlDB and stream processing (Vish Srinivasan - Confluent)
Introduction to ksqlDB and stream processing (Vish Srinivasan  - Confluent)Introduction to ksqlDB and stream processing (Vish Srinivasan  - Confluent)
Introduction to ksqlDB and stream processing (Vish Srinivasan - Confluent)
 
Kafka internals
Kafka internalsKafka internals
Kafka internals
 
Disaster Recovery Plans for Apache Kafka
Disaster Recovery Plans for Apache KafkaDisaster Recovery Plans for Apache Kafka
Disaster Recovery Plans for Apache Kafka
 
Multi-Datacenter Kafka - Strata San Jose 2017
Multi-Datacenter Kafka - Strata San Jose 2017Multi-Datacenter Kafka - Strata San Jose 2017
Multi-Datacenter Kafka - Strata San Jose 2017
 
Stream Me Up, Scotty: Transitioning to the Cloud Using a Streaming Data Platform
Stream Me Up, Scotty: Transitioning to the Cloud Using a Streaming Data PlatformStream Me Up, Scotty: Transitioning to the Cloud Using a Streaming Data Platform
Stream Me Up, Scotty: Transitioning to the Cloud Using a Streaming Data Platform
 
Papers we love realtime at facebook
Papers we love   realtime at facebookPapers we love   realtime at facebook
Papers we love realtime at facebook
 

Ähnlich wie A Marriage of Lambda and Kappa: Supporting Iterative Development of an Event Driven Platform (Peter Hannam, 6point6) Kafka Summit London 2019

Planning For Catastrophe with IBM WAS and IBM BPM
Planning For Catastrophe with IBM WAS and IBM BPMPlanning For Catastrophe with IBM WAS and IBM BPM
Planning For Catastrophe with IBM WAS and IBM BPM
WASdev Community
 
Чурюканов Вячеслав, “Code simple, but not simpler”
Чурюканов Вячеслав, “Code simple, but not simpler”Чурюканов Вячеслав, “Code simple, but not simpler”
Чурюканов Вячеслав, “Code simple, but not simpler”
EPAM Systems
 

Ähnlich wie A Marriage of Lambda and Kappa: Supporting Iterative Development of an Event Driven Platform (Peter Hannam, 6point6) Kafka Summit London 2019 (20)

Roman Rehak: 24/7 Database Administration + Database Mail Unleashed
Roman Rehak: 24/7 Database Administration + Database Mail UnleashedRoman Rehak: 24/7 Database Administration + Database Mail Unleashed
Roman Rehak: 24/7 Database Administration + Database Mail Unleashed
 
Resilience Planning & How the Empire Strikes Back
Resilience Planning & How the Empire Strikes BackResilience Planning & How the Empire Strikes Back
Resilience Planning & How the Empire Strikes Back
 
Data Vault Automation at the Bijenkorf
Data Vault Automation at the BijenkorfData Vault Automation at the Bijenkorf
Data Vault Automation at the Bijenkorf
 
Building data intensive applications
Building data intensive applicationsBuilding data intensive applications
Building data intensive applications
 
Planning For Catastrophe with IBM WAS and IBM BPM
Planning For Catastrophe with IBM WAS and IBM BPMPlanning For Catastrophe with IBM WAS and IBM BPM
Planning For Catastrophe with IBM WAS and IBM BPM
 
Expect the unexpected: Prepare for failures in microservices
Expect the unexpected: Prepare for failures in microservicesExpect the unexpected: Prepare for failures in microservices
Expect the unexpected: Prepare for failures in microservices
 
Performance Optimization of Cloud Based Applications by Peter Smith, ACL
Performance Optimization of Cloud Based Applications by Peter Smith, ACLPerformance Optimization of Cloud Based Applications by Peter Smith, ACL
Performance Optimization of Cloud Based Applications by Peter Smith, ACL
 
Relational data modeling trends for transactional applications
Relational data modeling trends for transactional applicationsRelational data modeling trends for transactional applications
Relational data modeling trends for transactional applications
 
Чурюканов Вячеслав, “Code simple, but not simpler”
Чурюканов Вячеслав, “Code simple, but not simpler”Чурюканов Вячеслав, “Code simple, but not simpler”
Чурюканов Вячеслав, “Code simple, but not simpler”
 
AWS re:Invent 2016: JustGiving: Serverless Data Pipelines, Event-Driven ETL, ...
AWS re:Invent 2016: JustGiving: Serverless Data Pipelines, Event-Driven ETL, ...AWS re:Invent 2016: JustGiving: Serverless Data Pipelines, Event-Driven ETL, ...
AWS re:Invent 2016: JustGiving: Serverless Data Pipelines, Event-Driven ETL, ...
 
Agile Data Architecture
Agile Data ArchitectureAgile Data Architecture
Agile Data Architecture
 
Software development planning and essentials
Software development planning and essentialsSoftware development planning and essentials
Software development planning and essentials
 
Software development planning and essentials
Software development planning and essentialsSoftware development planning and essentials
Software development planning and essentials
 
Data warehouse
Data warehouseData warehouse
Data warehouse
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Micro service architecture
Micro service architecture  Micro service architecture
Micro service architecture
 
Architecting for Failures in micro services: patterns and lessons learned
Architecting for Failures in micro services: patterns and lessons learnedArchitecting for Failures in micro services: patterns and lessons learned
Architecting for Failures in micro services: patterns and lessons learned
 
When small problems become big problems
When small problems become big problemsWhen small problems become big problems
When small problems become big problems
 
UNIT3 DBMS.pptx operation nd management of data base
UNIT3 DBMS.pptx operation nd management of data baseUNIT3 DBMS.pptx operation nd management of data base
UNIT3 DBMS.pptx operation nd management of data base
 
NVReddy
NVReddyNVReddy
NVReddy
 

Mehr von confluent

Mehr von confluent (20)

Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Santander Stream Processing with Apache Flink
Santander Stream Processing with Apache FlinkSantander Stream Processing with Apache Flink
Santander Stream Processing with Apache Flink
 
Unlocking the Power of IoT: A comprehensive approach to real-time insights
Unlocking the Power of IoT: A comprehensive approach to real-time insightsUnlocking the Power of IoT: A comprehensive approach to real-time insights
Unlocking the Power of IoT: A comprehensive approach to real-time insights
 
Workshop híbrido: Stream Processing con Flink
Workshop híbrido: Stream Processing con FlinkWorkshop híbrido: Stream Processing con Flink
Workshop híbrido: Stream Processing con Flink
 
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
 
AWS Immersion Day Mapfre - Confluent
AWS Immersion Day Mapfre   -   ConfluentAWS Immersion Day Mapfre   -   Confluent
AWS Immersion Day Mapfre - Confluent
 
Eventos y Microservicios - Santander TechTalk
Eventos y Microservicios - Santander TechTalkEventos y Microservicios - Santander TechTalk
Eventos y Microservicios - Santander TechTalk
 
Q&A with Confluent Experts: Navigating Networking in Confluent Cloud
Q&A with Confluent Experts: Navigating Networking in Confluent CloudQ&A with Confluent Experts: Navigating Networking in Confluent Cloud
Q&A with Confluent Experts: Navigating Networking in Confluent Cloud
 
Citi TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep DiveCiti TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep Dive
 
Build real-time streaming data pipelines to AWS with Confluent
Build real-time streaming data pipelines to AWS with ConfluentBuild real-time streaming data pipelines to AWS with Confluent
Build real-time streaming data pipelines to AWS with Confluent
 
Q&A with Confluent Professional Services: Confluent Service Mesh
Q&A with Confluent Professional Services: Confluent Service MeshQ&A with Confluent Professional Services: Confluent Service Mesh
Q&A with Confluent Professional Services: Confluent Service Mesh
 
Citi Tech Talk: Event Driven Kafka Microservices
Citi Tech Talk: Event Driven Kafka MicroservicesCiti Tech Talk: Event Driven Kafka Microservices
Citi Tech Talk: Event Driven Kafka Microservices
 
Confluent & GSI Webinars series - Session 3
Confluent & GSI Webinars series - Session 3Confluent & GSI Webinars series - Session 3
Confluent & GSI Webinars series - Session 3
 
Citi Tech Talk: Messaging Modernization
Citi Tech Talk: Messaging ModernizationCiti Tech Talk: Messaging Modernization
Citi Tech Talk: Messaging Modernization
 
Citi Tech Talk: Data Governance for streaming and real time data
Citi Tech Talk: Data Governance for streaming and real time dataCiti Tech Talk: Data Governance for streaming and real time data
Citi Tech Talk: Data Governance for streaming and real time data
 
Confluent & GSI Webinars series: Session 2
Confluent & GSI Webinars series: Session 2Confluent & GSI Webinars series: Session 2
Confluent & GSI Webinars series: Session 2
 
Data In Motion Paris 2023
Data In Motion Paris 2023Data In Motion Paris 2023
Data In Motion Paris 2023
 
Confluent Partner Tech Talk with Synthesis
Confluent Partner Tech Talk with SynthesisConfluent Partner Tech Talk with Synthesis
Confluent Partner Tech Talk with Synthesis
 
The Future of Application Development - API Days - Melbourne 2023
The Future of Application Development - API Days - Melbourne 2023The Future of Application Development - API Days - Melbourne 2023
The Future of Application Development - API Days - Melbourne 2023
 
The Playful Bond Between REST And Data Streams
The Playful Bond Between REST And Data StreamsThe Playful Bond Between REST And Data Streams
The Playful Bond Between REST And Data Streams
 

Kürzlich hochgeladen

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Kürzlich hochgeladen (20)

WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

A Marriage of Lambda and Kappa: Supporting Iterative Development of an Event Driven Platform (Peter Hannam, 6point6) Kafka Summit London 2019

  • 1. Supporting iterative development of an Event Driven Platform
  • 2. The Problem Changes such as business logic modifications, adding enrichments, or bug fixing could invalidate cached and persisted data. And consumers need to be protected from changes by upstream producers. How do we: • Support active development and iterative releases • Deal with failure pragmatically • Only serve current and correct data • Avoid breaching non-functional requirements With agile approaches we (typically) don’t do big-bang releases but develop business functionality through frequent incremental releases.
  • 3. Classic approaches don’t meet these needs Calculate on-demand Pull model: Business logic is applied on request. Bulk recalculation ƛ Push model: Result of business logic is stored in a persisted store, with the calculation running as a large job. Stream replay ϰ Push model: Business logic is applied to single messages or small windows and then sent to another stream or stored/cached. • No risk of staleness as data is always fresh • Cannot use pure-streaming as needs random access to data • May breach NFRs if calculation takes too long or dependent services are slow • Streaming! • Risk of staleness or missing data • Can be used in conjunction with streaming • Risk of staleness or missing data as request may happen whilst results are being updated • Depending on scenarios, tends to be more efficient for large reprocessing
  • 5. Our approach • Everything is versioned: • Importantly, the persisted data is as well • REST service requests appropriately versioned persisted data • Persisted data updated after business logic change through bulk processing: • Not really a lambda architecture à only run bulk processing during uplift • REST service could request data waiting to be recalculated: • Have a mechanism to ‘fast track’ calculations of requested stale data
  • 6. Fully streaming • Single code-base supports both BAU and stale-data requests • Need a separate topic and job for fast tracked recalculation requests to allow them to be prioritised: • Cannot currently configure Consumers & Streams to prioritise a topic (KIP-349) • Simpler streaming jobs but increased complexity in the REST services: • REST services have to poll database until version is updated • REST services have to know how to put messages onto the recalc topic%
  • 7. Encapsulated REST services • Streaming jobs are simple co- ordinators: • REST services contain the business logic and do all data processing • REST services are simpler and self- contained for stale data requests: • Don’t need to put messages back onto a topic • Requests simply block until the data is updated • Topic management is much simpler… • But the complexity has moved into the streaming jobs: • Have to handle failure states for REST such as overload, timeouts, transactions, etc
  • 8. Bulk reprocessing • ƛ-style: batch-job • Requires original messages to have been saved to non-streaming store • If business logic is held within REST services, can simply call them • If stream job, can copy data back to the original stream or a new one • Could also have the bulk job run the business logic, but then have duplicity issues • ϰ-style: stream replay • Have to be careful of caches: single topic can’t efficiently serve both the head and random access • May be better to have two topics: one for live data and one for replays • Simpler deployment stack as doesn’t require extra technology à simply reset the offset
  • 10. Defensive strategies • Producers validate all messages against a JSON schema before sending • Consumers accept a fixed range of schema versions and validate payloads: • Ensure standards compliance of producer by ignoring incorrectly headered messages • Will ignore any messages which fall outside of configured schema/library range • Messages which fail schema validation are sent to a DLQ • Schema failures over a configured windowed-threshold could kill the job • Retry and failure functionality • All interactions with services/systems use patterns such as circuit breakers and back-pressure • Baked in libraries such as Micrometer and OpenTracing to enforce integration with operations stack
  • 11. Retry & failure • Developers could choose from multiple retry and failure options • Could combine strategies: • Retry 5 times, then pause 5 times, then fail • Pause and park had exponential time strategies: • Short pause now but then give a service more time to recover • Retry: • Retry message immediately • Pause: • Pauses the job entirely • Used when ordering is important • Park: • Puts message on hold but keeps processing topic • Could use multiple topics or RocksDB • Used when ordering isn’t important • Fail: • Sends message to DLQ immediately • Schema validation errors and the like
  • 12. DLQs • If all else fails, ask a human to intervene • May need to kill the job, if message ordering is important • Need to provide tooling for admins to investigate and replay messages from the DLQ • Have to think about replays: • Track attempts so that a message doesn’t keep looping through • What happens if you replay the topic: do you want to replay dead messages? • Typically only saw messages on the DLQ during pre-prod testing: • Retry strategies dealt with most services issues • Schema enforcement in producer removed chance of corrupt messages
  • 13. Outcomes • Reduced data risks surrounding deployments: • Only correct data would be served via services • Platform downtime was reduced: • Allowing upgrade scripts to be run during live hours reduced deployment pressures • Provided reassurance around NFRs during upgrades: • Platform was sized to ensure NFRs weren’t breached during deployments • Customer bought into trade-offs on increased latency for increased correctness • Provided strong contracts between teams: • Defensive measures allowed developers to focus on business logic