SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Microservices on top of Kafka
How we got lost during the transition to Microservices,
and how we found our way out using Kafka
Vladi Feigin
Software Architect, LivePerson
vladif@liveperson.com
“This is an attempt to share our experience in breaking a monolith and
moving to a microservices world”
… Using Kafka
Preface
Active customers
Mission critical application
Complex business logic
Very high uptime SLA
The Monolith
The Decision
Project “Thor”
Develop a new system from scratch
OR
Gradually break the existing monolith
We believe the second option is the way to go!
How can it be broken?
Monolith First app out
(shadow mode)
Monolith
First app
out
Monolith
without app
Gradual progress
Events to Kafka. Tests! App out in shadow mode. Tests! App out in production mode
The Gradual Approach
TODO List
Microservices on Kafka
Define every service responsibility
Design services behavior first (the actions it does)
Define Data Model (see next slide)
Apply Domain Driven Design principles
Revise Data Model
Command (Request) is an action, addressed to, and consumed by, one single
service
Fact is a declaration to the rest of world about the service state change
(triggered by a command).
Entities - the business objects
Define Commands, Facts and Entities
A schema defines the language the services use to talk to each other
It can be JSON, Avro or Protobuf
Define and enforce rules for schema compatibility
Every schema change must be validated
Use schema
Define business flows
Separate the write from the read operations
Facts written chronologically into dedicated Kafka (event-sourced) topics
Create read-optimized views in external DB for queries
Use Event Sourcing and CQRS
Every service is allowed to write only on the topics it owns
Services are allowed to read from other service topics
Follow Single Writer Principle
Service topics should reflect the service data model
Topics are integral to all business flows
Every service usually has its own topic
Topic design is similar to the designing DB table
Carefully design Kafka topics
● Validate events before you write them to Kafka
● Validate against schema
● Validate against local state
Validate, Validate, Validate!
Data crucial for managing the core business flows should be managed in
Kafka
Avoid having other “moving parts”, such as a database for managing the
core business flow
Make your critical data mobility simple
Kafka is Single Source of Truth
Your application should be able to reprocess historical data from Kafka
This means reprocessing facts executed from the event-sourced topics
Design for reprocessing
Monitor
You must have full visibility over what’s going on in the system, from the
very beginning of the process
Constantly look for unexpected behaviour and anomalies
Be a smart pessimist
Be prepared for non-happy and edge case scenarios!
List all possible difficult scenarios and use your architecture to test them
Ensure you have a solution for every scenario
Postscript
Microservices Cons:
● Microservices is hard and challenging
● Operational costs are high
● Hard to debug in production
Microservices Pros:
● Unleash development speed
● Services scale-out is easier
● Clear roles and responsibilities of services
LivePerson is hiring!
In Tel-Aviv and Raanana
https://www.liveperson.com/company/careers
We’re hiring
Appendix
Consider Kafka Compacted topics
Long topic retention
Deletion by fact key
Smaller local state
Custom retention mechanisms
The only option for supporting GDPR
Producer parameters:
● acks=all
● Many retries on failure
If events order is critical set :
● max.in.flight.requests.per.connection=1
If your data throughput allow - use synchronous send
Server configuration:
● unclean.leader.election.enable=false
● min.isr=2
● replication factor at least 3
Configuration

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Modern Cloud Fundamentals: Misconceptions and Industry Trends
Modern Cloud Fundamentals: Misconceptions and Industry TrendsModern Cloud Fundamentals: Misconceptions and Industry Trends
Modern Cloud Fundamentals: Misconceptions and Industry Trends
 
Containerization: The DevOps Revolution
Containerization: The DevOps Revolution Containerization: The DevOps Revolution
Containerization: The DevOps Revolution
 
Infrastructure as Code (BBWorld/DevCon13)
Infrastructure as Code (BBWorld/DevCon13)Infrastructure as Code (BBWorld/DevCon13)
Infrastructure as Code (BBWorld/DevCon13)
 
Wall Street Derivative Risk Solutions Using Apache Geode
Wall Street Derivative Risk Solutions Using Apache GeodeWall Street Derivative Risk Solutions Using Apache Geode
Wall Street Derivative Risk Solutions Using Apache Geode
 
Enterprise Beacon Object Hive - Siebel Version Control
Enterprise Beacon Object Hive - Siebel Version ControlEnterprise Beacon Object Hive - Siebel Version Control
Enterprise Beacon Object Hive - Siebel Version Control
 
Microservices Testing at Scale
Microservices Testing at ScaleMicroservices Testing at Scale
Microservices Testing at Scale
 
Rebuilding Legacy Apps with Domain-Driven Design - Lessons learned
Rebuilding Legacy Apps with Domain-Driven Design - Lessons learnedRebuilding Legacy Apps with Domain-Driven Design - Lessons learned
Rebuilding Legacy Apps with Domain-Driven Design - Lessons learned
 
Денис Баталов
Денис БаталовДенис Баталов
Денис Баталов
 
Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...
Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...
Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...
 
Azure dev ops integrations with Jenkins
Azure dev ops integrations with JenkinsAzure dev ops integrations with Jenkins
Azure dev ops integrations with Jenkins
 
Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as Code
 
Spinnaker Microsrvices
Spinnaker MicrosrvicesSpinnaker Microsrvices
Spinnaker Microsrvices
 
Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as Code
 
Building A Diverse Geo-Architecture For Cloud Native Applications In One Day
Building A Diverse Geo-Architecture For Cloud Native Applications In One DayBuilding A Diverse Geo-Architecture For Cloud Native Applications In One Day
Building A Diverse Geo-Architecture For Cloud Native Applications In One Day
 
Sam Guckenheimer - Moving to One Engineering System
Sam Guckenheimer - Moving to One Engineering SystemSam Guckenheimer - Moving to One Engineering System
Sam Guckenheimer - Moving to One Engineering System
 
WinOps Conf 2016 - Jeffrey Snover - The DevOpsification of Windows Server
WinOps Conf 2016 - Jeffrey Snover - The DevOpsification of Windows ServerWinOps Conf 2016 - Jeffrey Snover - The DevOpsification of Windows Server
WinOps Conf 2016 - Jeffrey Snover - The DevOpsification of Windows Server
 
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
 
Infrastructure and Compliance Delight with Chef Automate
Infrastructure and Compliance Delight with Chef AutomateInfrastructure and Compliance Delight with Chef Automate
Infrastructure and Compliance Delight with Chef Automate
 
Creating Event Driven Serverless Applications - Sandeep - Adobe - Serverless ...
Creating Event Driven Serverless Applications - Sandeep - Adobe - Serverless ...Creating Event Driven Serverless Applications - Sandeep - Adobe - Serverless ...
Creating Event Driven Serverless Applications - Sandeep - Adobe - Serverless ...
 
Project Sherpa: How RightScale Went All in on Docker
Project Sherpa: How RightScale Went All in on DockerProject Sherpa: How RightScale Went All in on Docker
Project Sherpa: How RightScale Went All in on Docker
 

Ähnlich wie Microservices on top of kafka

How to Migrate Applications Off a Mainframe
How to Migrate Applications Off a MainframeHow to Migrate Applications Off a Mainframe
How to Migrate Applications Off a Mainframe
VMware Tanzu
 
From Monoliths to Microservices - A Journey With Confluent With Gayathri Veal...
From Monoliths to Microservices - A Journey With Confluent With Gayathri Veal...From Monoliths to Microservices - A Journey With Confluent With Gayathri Veal...
From Monoliths to Microservices - A Journey With Confluent With Gayathri Veal...
HostedbyConfluent
 

Ähnlich wie Microservices on top of kafka (20)

How to Migrate Applications Off a Mainframe
How to Migrate Applications Off a MainframeHow to Migrate Applications Off a Mainframe
How to Migrate Applications Off a Mainframe
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...
 
From Monoliths to Microservices - A Journey With Confluent With Gayathri Veal...
From Monoliths to Microservices - A Journey With Confluent With Gayathri Veal...From Monoliths to Microservices - A Journey With Confluent With Gayathri Veal...
From Monoliths to Microservices - A Journey With Confluent With Gayathri Veal...
 
Technology insights: Decision Science Platform
Technology insights: Decision Science PlatformTechnology insights: Decision Science Platform
Technology insights: Decision Science Platform
 
We are drowning in complexity—can we do better?
We are drowning in complexity—can we do better?We are drowning in complexity—can we do better?
We are drowning in complexity—can we do better?
 
Shattering The Monolith(s) (Martin Kess, Namely) Kafka Summit SF 2019
Shattering The Monolith(s) (Martin Kess, Namely) Kafka Summit SF 2019 Shattering The Monolith(s) (Martin Kess, Namely) Kafka Summit SF 2019
Shattering The Monolith(s) (Martin Kess, Namely) Kafka Summit SF 2019
 
170215 msa intro
170215 msa intro170215 msa intro
170215 msa intro
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolith
 
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...
 
Will ServerLess kill containers and Operations
Will ServerLess kill containers and OperationsWill ServerLess kill containers and Operations
Will ServerLess kill containers and Operations
 
APIdays Paris 2018 - Will Serverless kill Containers and Operations? Stéphane...
APIdays Paris 2018 - Will Serverless kill Containers and Operations? Stéphane...APIdays Paris 2018 - Will Serverless kill Containers and Operations? Stéphane...
APIdays Paris 2018 - Will Serverless kill Containers and Operations? Stéphane...
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolith
 
Reduce Risk with End to End Monitoring of Middleware-based Applications
Reduce Risk with End to End Monitoring of Middleware-based ApplicationsReduce Risk with End to End Monitoring of Middleware-based Applications
Reduce Risk with End to End Monitoring of Middleware-based Applications
 
Unleashing Apache Kafka and TensorFlow in the Cloud

Unleashing Apache Kafka and TensorFlow in the Cloud
Unleashing Apache Kafka and TensorFlow in the Cloud

Unleashing Apache Kafka and TensorFlow in the Cloud

 
Marketing Automation at Scale: How Marketo Solved Key Data Management Challen...
Marketing Automation at Scale: How Marketo Solved Key Data Management Challen...Marketing Automation at Scale: How Marketo Solved Key Data Management Challen...
Marketing Automation at Scale: How Marketo Solved Key Data Management Challen...
 
Event Sourcing in less than 20 minutes - With Akka and Java 8
Event Sourcing in less than 20 minutes - With Akka and Java 8Event Sourcing in less than 20 minutes - With Akka and Java 8
Event Sourcing in less than 20 minutes - With Akka and Java 8
 
Confluent Partner Tech Talk with Synthesis
Confluent Partner Tech Talk with SynthesisConfluent Partner Tech Talk with Synthesis
Confluent Partner Tech Talk with Synthesis
 
Modernizing Testing as Apps Re-Architect
Modernizing Testing as Apps Re-ArchitectModernizing Testing as Apps Re-Architect
Modernizing Testing as Apps Re-Architect
 
Modernizing Applications with Microservices
Modernizing Applications with MicroservicesModernizing Applications with Microservices
Modernizing Applications with Microservices
 

Mehr von LivePerson

Mehr von LivePerson (20)

Graph QL Introduction
Graph QL IntroductionGraph QL Introduction
Graph QL Introduction
 
Growing into a proactive Data Platform
Growing into a proactive Data PlatformGrowing into a proactive Data Platform
Growing into a proactive Data Platform
 
Measure() or die()
Measure() or die() Measure() or die()
Measure() or die()
 
Resilience from Theory to Practice
Resilience from Theory to PracticeResilience from Theory to Practice
Resilience from Theory to Practice
 
System Revolution- How We Did It
System Revolution- How We Did It System Revolution- How We Did It
System Revolution- How We Did It
 
Liveperson DLD 2015
Liveperson DLD 2015 Liveperson DLD 2015
Liveperson DLD 2015
 
Http 2: Should I care?
Http 2: Should I care?Http 2: Should I care?
Http 2: Should I care?
 
Mobile app real-time content modifications using websockets
Mobile app real-time content modifications using websocketsMobile app real-time content modifications using websockets
Mobile app real-time content modifications using websockets
 
Mobile SDK: Considerations & Best Practices
Mobile SDK: Considerations & Best Practices Mobile SDK: Considerations & Best Practices
Mobile SDK: Considerations & Best Practices
 
Functional programming with Java 8
Functional programming with Java 8Functional programming with Java 8
Functional programming with Java 8
 
Apache Avro in LivePerson [Hebrew]
Apache Avro in LivePerson [Hebrew]Apache Avro in LivePerson [Hebrew]
Apache Avro in LivePerson [Hebrew]
 
Apache Avro and Messaging at Scale in LivePerson
Apache Avro and Messaging at Scale in LivePersonApache Avro and Messaging at Scale in LivePerson
Apache Avro and Messaging at Scale in LivePerson
 
Data compression in Modern Application
Data compression in Modern ApplicationData compression in Modern Application
Data compression in Modern Application
 
Support Office Hour Webinar - LivePerson API
Support Office Hour Webinar - LivePerson API Support Office Hour Webinar - LivePerson API
Support Office Hour Webinar - LivePerson API
 
SIP - Introduction to SIP Protocol
SIP - Introduction to SIP ProtocolSIP - Introduction to SIP Protocol
SIP - Introduction to SIP Protocol
 
Scalding: Reaching Efficient MapReduce
Scalding: Reaching Efficient MapReduceScalding: Reaching Efficient MapReduce
Scalding: Reaching Efficient MapReduce
 
Building Enterprise Level End-To-End Monitor System with Open Source Solution...
Building Enterprise Level End-To-End Monitor System with Open Source Solution...Building Enterprise Level End-To-End Monitor System with Open Source Solution...
Building Enterprise Level End-To-End Monitor System with Open Source Solution...
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
From a Kafkaesque Story to The Promised Land at LivePerson
From a Kafkaesque Story to The Promised Land at LivePersonFrom a Kafkaesque Story to The Promised Land at LivePerson
From a Kafkaesque Story to The Promised Land at LivePerson
 
How can A/B testing go wrong?
How can A/B testing go wrong?How can A/B testing go wrong?
How can A/B testing go wrong?
 

Kürzlich hochgeladen

1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Kürzlich hochgeladen (20)

Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 

Microservices on top of kafka

  • 1. Microservices on top of Kafka How we got lost during the transition to Microservices, and how we found our way out using Kafka Vladi Feigin Software Architect, LivePerson vladif@liveperson.com
  • 2. “This is an attempt to share our experience in breaking a monolith and moving to a microservices world” … Using Kafka Preface
  • 3. Active customers Mission critical application Complex business logic Very high uptime SLA The Monolith
  • 6. Develop a new system from scratch OR Gradually break the existing monolith We believe the second option is the way to go! How can it be broken?
  • 7. Monolith First app out (shadow mode) Monolith First app out Monolith without app Gradual progress Events to Kafka. Tests! App out in shadow mode. Tests! App out in production mode The Gradual Approach
  • 9. Define every service responsibility Design services behavior first (the actions it does) Define Data Model (see next slide) Apply Domain Driven Design principles Revise Data Model
  • 10. Command (Request) is an action, addressed to, and consumed by, one single service Fact is a declaration to the rest of world about the service state change (triggered by a command). Entities - the business objects Define Commands, Facts and Entities
  • 11. A schema defines the language the services use to talk to each other It can be JSON, Avro or Protobuf Define and enforce rules for schema compatibility Every schema change must be validated Use schema
  • 13. Separate the write from the read operations Facts written chronologically into dedicated Kafka (event-sourced) topics Create read-optimized views in external DB for queries Use Event Sourcing and CQRS
  • 14. Every service is allowed to write only on the topics it owns Services are allowed to read from other service topics Follow Single Writer Principle
  • 15. Service topics should reflect the service data model Topics are integral to all business flows Every service usually has its own topic Topic design is similar to the designing DB table Carefully design Kafka topics
  • 16. ● Validate events before you write them to Kafka ● Validate against schema ● Validate against local state Validate, Validate, Validate!
  • 17. Data crucial for managing the core business flows should be managed in Kafka Avoid having other “moving parts”, such as a database for managing the core business flow Make your critical data mobility simple Kafka is Single Source of Truth
  • 18. Your application should be able to reprocess historical data from Kafka This means reprocessing facts executed from the event-sourced topics Design for reprocessing
  • 19. Monitor You must have full visibility over what’s going on in the system, from the very beginning of the process Constantly look for unexpected behaviour and anomalies
  • 20. Be a smart pessimist Be prepared for non-happy and edge case scenarios! List all possible difficult scenarios and use your architecture to test them Ensure you have a solution for every scenario
  • 21. Postscript Microservices Cons: ● Microservices is hard and challenging ● Operational costs are high ● Hard to debug in production Microservices Pros: ● Unleash development speed ● Services scale-out is easier ● Clear roles and responsibilities of services
  • 22. LivePerson is hiring! In Tel-Aviv and Raanana https://www.liveperson.com/company/careers We’re hiring
  • 24. Consider Kafka Compacted topics Long topic retention Deletion by fact key Smaller local state Custom retention mechanisms The only option for supporting GDPR
  • 25. Producer parameters: ● acks=all ● Many retries on failure If events order is critical set : ● max.in.flight.requests.per.connection=1 If your data throughput allow - use synchronous send Server configuration: ● unclean.leader.election.enable=false ● min.isr=2 ● replication factor at least 3 Configuration