SlideShare a Scribd company logo
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

More Related Content

PPTX
The Journey to Becoming Cloud Native – A Three Step Path to Modernizing Appli...
PPTX
Vulnerability Discovery in the Cloud
PPTX
Puppet plugin for vRealize Automation (vRA)
PDF
Introduction To Jenkins - SpringPeople
PPTX
Kubernetes your tests! automation with docker on google cloud platform
PPTX
Measure() or die()
PDF
Siebel Monitoring Tools
PDF
Infrastructure as Code
The Journey to Becoming Cloud Native – A Three Step Path to Modernizing Appli...
Vulnerability Discovery in the Cloud
Puppet plugin for vRealize Automation (vRA)
Introduction To Jenkins - SpringPeople
Kubernetes your tests! automation with docker on google cloud platform
Measure() or die()
Siebel Monitoring Tools
Infrastructure as Code

What's hot (20)

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

Similar to Microservices on top of kafka (20)

PDF
From Monoliths to Microservices - A Journey With Confluent With Gayathri Veal...
PDF
Building event-driven (Micro)Services with Apache Kafka
PPTX
Microservices in the Apache Kafka Ecosystem
PDF
Building event-driven (Micro)Services with Apache Kafka Ecosystem
PPTX
10 Principals for Effective Event Driven Microservices
PDF
Building High-Throughput, Low-Latency Pipelines in Kafka
PPTX
Microservices in a Streaming World
PDF
Microservices with Kafka Ecosystem
PDF
AI&BigData Lab 2016. Сарапин Виктор: Размер имеет значение: анализ по требова...
PDF
Microservices with Kafka Ecosystem
PDF
20220311-EB-Designing_Event_Driven_Systems.pdf
PDF
Building event-driven (Micro)Services with Apache Kafka
PDF
Building Microservices with Apache Kafka by Colin McCabe
PDF
Building Event-Driven (Micro)Services with Apache Kafka
PPTX
10 Principals for Effective Event-Driven Microservices with Apache Kafka
PDF
The Migration to Event-Driven Microservices (Adam Bellemare, Flipp) Kafka Sum...
PPTX
Liveperson DLD 2015
PDF
Battle Tested Event-Driven Patterns for your Microservices Architecture - Dev...
PDF
Battle-tested event-driven patterns for your microservices architecture - Sca...
PDF
JAX London Slides
From Monoliths to Microservices - A Journey With Confluent With Gayathri Veal...
Building event-driven (Micro)Services with Apache Kafka
Microservices in the Apache Kafka Ecosystem
Building event-driven (Micro)Services with Apache Kafka Ecosystem
10 Principals for Effective Event Driven Microservices
Building High-Throughput, Low-Latency Pipelines in Kafka
Microservices in a Streaming World
Microservices with Kafka Ecosystem
AI&BigData Lab 2016. Сарапин Виктор: Размер имеет значение: анализ по требова...
Microservices with Kafka Ecosystem
20220311-EB-Designing_Event_Driven_Systems.pdf
Building event-driven (Micro)Services with Apache Kafka
Building Microservices with Apache Kafka by Colin McCabe
Building Event-Driven (Micro)Services with Apache Kafka
10 Principals for Effective Event-Driven Microservices with Apache Kafka
The Migration to Event-Driven Microservices (Adam Bellemare, Flipp) Kafka Sum...
Liveperson DLD 2015
Battle Tested Event-Driven Patterns for your Microservices Architecture - Dev...
Battle-tested event-driven patterns for your microservices architecture - Sca...
JAX London Slides
Ad

More from LivePerson (20)

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

Recently uploaded (20)

PPTX
additive manufacturing of ss316l using mig welding
PPTX
Sustainable Sites - Green Building Construction
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Geodesy 1.pptx...............................................
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PDF
ETO & MEO Certificate of Competency Questions and Answers
PPTX
web development for engineering and engineering
PPT
Mechanical Engineering MATERIALS Selection
PPT
Drone Technology Electronics components_1
PPTX
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
DOCX
573137875-Attendance-Management-System-original
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PDF
composite construction of structures.pdf
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
Structs to JSON How Go Powers REST APIs.pdf
additive manufacturing of ss316l using mig welding
Sustainable Sites - Green Building Construction
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
CH1 Production IntroductoryConcepts.pptx
Geodesy 1.pptx...............................................
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
OOP with Java - Java Introduction (Basics)
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Lesson 3_Tessellation.pptx finite Mathematics
ETO & MEO Certificate of Competency Questions and Answers
web development for engineering and engineering
Mechanical Engineering MATERIALS Selection
Drone Technology Electronics components_1
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
573137875-Attendance-Management-System-original
Strings in CPP - Strings in C++ are sequences of characters used to store and...
composite construction of structures.pdf
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Structs to JSON How Go Powers REST APIs.pdf

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